Skip to content

Commit

Permalink
next@15 WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
agnlez committed Nov 29, 2024
1 parent 81e6cf8 commit 111c08b
Show file tree
Hide file tree
Showing 19 changed files with 1,500 additions and 465 deletions.
2 changes: 1 addition & 1 deletion client/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
22 changes: 8 additions & 14 deletions client/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
import { NextConfig } from 'next';

const withPlugins = require('next-compose-plugins');
const withOptimizedImages = require('next-optimized-images');
import withPlugins from 'next-compose-plugins';
import withOptimizedImages from 'next-optimized-images';

const nextConfig: NextConfig = {
// ? https://github.com/vercel/next.js/issues/7755#issuecomment-812805708
// webpack: (config, { isServer }) => {
// if (!isServer) {
// config.resolve.fallback.fs = false;
// }
// return config;
// },

// ? https://nextjs.org/docs/api-reference/next.config.js/basepath
basePath: process.env.NEXT_PUBLIC_BASE_PATH,

images: {
domains: ['staging.fora.dev-vizzuality.com'],
remotePatterns: [
{
protocol: 'https',
hostname: 'staging.fora.dev-vizzuality.com',
},
],
},
};

Expand Down
7 changes: 2 additions & 5 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@tanstack/react-query": "4.0.10",
"@tanstack/react-table": "^8.5.22",
"@turf/rewind": "6.5.0",
"@types/geojson": "^7946.0.10",
"@visx/group": "^2.10.0",
"@visx/responsive": "^2.10.0",
"@visx/shape": "^2.12.2",
Expand All @@ -47,7 +46,7 @@
"jsonwebtoken": "8.5.1",
"lodash": "4.17.21",
"next": "15.0.3",
"next-auth": "4.3.4",
"next-auth": "4.24.10",
"next-compose-plugins": "2.2.1",
"next-optimized-images": "2.6.2",
"next-plausible": "3.10.1",
Expand All @@ -66,6 +65,7 @@
"validate.js": "0.13.1"
},
"devDependencies": {
"@types/geojson": "7946.0.14",
"@types/gtag.js": "0.0.5",
"@types/react": "18.0.15",
"@types/react-dom": "18.0.6",
Expand All @@ -91,8 +91,5 @@
"svgo-loader": "2.2.2",
"typescript": "4.5.2"
},
"resolutions": {
"webpack": "^5"
},
"packageManager": "[email protected]+sha512.6e2baf77d06b9362294152c851c4f278ede37ab1eba3a55fda317a4a17b209f4dbb973fb250a77abc463a341fcb1f17f17cfa24091c4eb319cda0d9b84278387"
}
1,744 changes: 1,388 additions & 356 deletions client/pnpm-lock.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useAppSelector } from 'store/hooks';
import rewind from '@turf/rewind';
import CHROMA from 'chroma-js';
import { geoCentroid } from 'd3-geo';
import { Feature, MultiPolygon, Polygon } from 'geojson';
import type { Feature, MultiPolygon, Polygon } from 'geojson';
import { max, min } from 'lodash';

import { MAP_RAMP } from 'constants/colors';
Expand Down
4 changes: 2 additions & 2 deletions client/src/containers/cards/card/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const Cards = ({
}, [subgeographics]);

return (
(<div
<div
className={cx({
'flex flex-col justify-between p-8': true,
[THEME[theme]]: true,
Expand Down Expand Up @@ -79,7 +79,7 @@ const Cards = ({
</Link>
</div>
</div>
</div>)
</div>
);
};

Expand Down
1 change: 0 additions & 1 deletion client/src/containers/footer/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const Footer = () => {
<Image
src={`${process.env.NEXT_PUBLIC_BASE_PATH}${LOGO_MONOCHROME_SVG}`}
alt="Logo"
layout="fixed"
width={122}
height={56}
priority
Expand Down
3 changes: 2 additions & 1 deletion client/src/containers/funder/overview/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ const FunderOverview = () => {
<Image
src={logo.small || '/images/avatar.jpg'}
alt={name}
layout="fill"
className="object-contain"
fill
sizes="100vw"
/>
</div>
)}
Expand Down
1 change: 0 additions & 1 deletion client/src/containers/header/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const Header = () => {
<Image
src={`${process.env.NEXT_PUBLIC_BASE_PATH}${LOGO_SVG}`}
alt="Logo"
layout="fixed"
width={pathname === '/' ? 156 : 156 - 156 * 0.2}
height={pathname === '/' ? 72 : 72 - 72 * 0.2}
priority
Expand Down
3 changes: 0 additions & 3 deletions client/src/containers/home/hero/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const Hero = () => {
>
<Image
priority
layout="fixed"
src={`${process.env.NEXT_PUBLIC_BASE_PATH}/images/hero/hero-2.png`}
alt="Hero 2"
width={406}
Expand All @@ -45,7 +44,6 @@ const Hero = () => {
>
<Image
priority
layout="fixed"
src={`${process.env.NEXT_PUBLIC_BASE_PATH}/images/hero/hero-1.png`}
alt="Hero 1"
width={389}
Expand All @@ -60,7 +58,6 @@ const Hero = () => {
>
<Image
priority
layout="fixed"
src={`${process.env.NEXT_PUBLIC_BASE_PATH}/images/hero/hero-3.png`}
alt="Hero 3"
width={389}
Expand Down
8 changes: 8 additions & 0 deletions client/src/containers/home/how/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ const How = () => {
alt="Dashboard"
width={1281}
height={1260}
style={{
maxWidth: '100%',
height: 'auto',
}}
/>
</AnimatedScroll>
</div>
Expand Down Expand Up @@ -307,6 +311,10 @@ const How = () => {
alt="Dashboard"
width={1563}
height={1047}
style={{
maxWidth: '100%',
height: 'auto',
}}
/>
</AnimatedScroll>
</div>
Expand Down
1 change: 0 additions & 1 deletion client/src/containers/home/invest/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ const Invest = () => {
>
<Image
priority
layout="fixed"
src={`${process.env.NEXT_PUBLIC_BASE_PATH}/images/invest/invest-1.jpg`}
alt="Invest 1"
width={408}
Expand Down
10 changes: 8 additions & 2 deletions client/src/containers/home/what/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const What = () => {
</div>
</div>
</Wrapper>

<Wrapper>
<div className="relative z-10 grid grid-cols-3 gap-10">
{PRINCIPLES.map(({ title, icon, description }, i) => (
Expand Down Expand Up @@ -71,7 +70,6 @@ const What = () => {
))}
</div>
</Wrapper>

<Wrapper>
<div className="grid grid-cols-12 gap-10">
<div className="relative col-span-6 col-start-2">
Expand Down Expand Up @@ -102,6 +100,10 @@ const What = () => {
alt="What 1"
width={238}
height={356}
style={{
maxWidth: '100%',
height: 'auto',
}}
/>
</AnimatedScroll>
<AnimatedScroll
Expand All @@ -115,6 +117,10 @@ const What = () => {
alt="What 2"
width={238}
height={356}
style={{
maxWidth: '100%',
height: 'auto',
}}
/>
</AnimatedScroll>
</div>
Expand Down
3 changes: 2 additions & 1 deletion client/src/containers/project/overview/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ const ProjectOverview = () => {
<Image
src={logo.small || '/images/avatar.jpg'}
alt={name}
layout="fill"
className="object-contain"
fill
sizes="100vw"
/>
</div>
)}
Expand Down
49 changes: 25 additions & 24 deletions client/src/containers/similars/areas-similars/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,32 +78,33 @@ const AreasSimilars = ({ type }: SimilarsSectionProps) => {
return shuffled.slice(0, 3);
}, [id, type, fundersData, projectsData, RANDOM_SORT]);

return (<>
{!!DATA_BY_AREA.length && (
<div className="space-y-3">
<div className="flex items-center justify-between">
<div className="font-semibold capitalize text-grey-20">By Area of Focus</div>
<div>
<Link
href={`/${type}?areas[]=${areas.join(',')}`}
className="flex items-center space-x-3 font-semibold underline decoration-1">

<span>{`View all similar ${type}`}</span>
<Icon
icon={CHEVRON_RIGHT_SVG}
className={cx({
'w-2 h-2 text-grey-0': true,
})}
/>

</Link>
return (
<>
{!!DATA_BY_AREA.length && (
<div className="space-y-3">
<div className="flex items-center justify-between">
<div className="font-semibold capitalize text-grey-20">By Area of Focus</div>
<div>
<Link
href={`/${type}?areas[]=${areas.join(',')}`}
className="flex items-center space-x-3 font-semibold underline decoration-1"
>
<span>{`View all similar ${type}`}</span>
<Icon
icon={CHEVRON_RIGHT_SVG}
className={cx({
'w-2 h-2 text-grey-0': true,
})}
/>
</Link>
</div>
</div>
</div>

<Cards pathname={`/${type}`} data={DATA_BY_AREA} />
</div>
)}
</>);
<Cards pathname={`/${type}`} data={DATA_BY_AREA} />
</div>
)}
</>
);
};

export default AreasSimilars;
49 changes: 25 additions & 24 deletions client/src/containers/similars/demographic-similars/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,32 +77,33 @@ const DemographicSimilars = ({ type }: SimilarsSectionProps) => {
return shuffled.slice(0, 3);
}, [id, type, fundersData, projectsData, RANDOM_SORT]);

return (<>
{!!DATA_BY_DEMOGRAPHIC.length && (
<div className="space-y-3">
<div className="flex items-center justify-between">
<div className="font-semibold capitalize text-grey-20">By Demographic Scope</div>
<div>
<Link
href={`/${type}?demographics[]=${demographics.join(',')}`}
className="flex items-center space-x-3 font-semibold underline decoration-1">

<span>{`View all similar ${type}`}</span>
<Icon
icon={CHEVRON_RIGHT_SVG}
className={cx({
'w-2 h-2 text-grey-0': true,
})}
/>

</Link>
return (
<>
{!!DATA_BY_DEMOGRAPHIC.length && (
<div className="space-y-3">
<div className="flex items-center justify-between">
<div className="font-semibold capitalize text-grey-20">By Demographic Scope</div>
<div>
<Link
href={`/${type}?demographics[]=${demographics.join(',')}`}
className="flex items-center space-x-3 font-semibold underline decoration-1"
>
<span>{`View all similar ${type}`}</span>
<Icon
icon={CHEVRON_RIGHT_SVG}
className={cx({
'w-2 h-2 text-grey-0': true,
})}
/>
</Link>
</div>
</div>
</div>

<Cards pathname={`/${type}`} data={DATA_BY_DEMOGRAPHIC} />
</div>
)}
</>);
<Cards pathname={`/${type}`} data={DATA_BY_DEMOGRAPHIC} />
</div>
)}
</>
);
};

export default DemographicSimilars;
Loading

0 comments on commit 111c08b

Please sign in to comment.