diff --git a/client/package.json b/client/package.json index b8ac073..d41eb4d 100644 --- a/client/package.json +++ b/client/package.json @@ -27,6 +27,7 @@ "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-popover": "^1.0.6", "@radix-ui/react-radio-group": "^1.1.3", + "@radix-ui/react-scroll-area": "^1.1.0", "@radix-ui/react-select": "^1.2.2", "@radix-ui/react-slider": "^1.1.2", "@radix-ui/react-slot": "^1.0.2", diff --git a/client/public/images/map/story-marker.png b/client/public/images/map/story-marker.png index bc4ba02..0f42f24 100644 Binary files a/client/public/images/map/story-marker.png and b/client/public/images/map/story-marker.png differ diff --git a/client/src/components/ui/card.tsx b/client/src/components/ui/card.tsx index 55dfef5..64a6e5f 100644 --- a/client/src/components/ui/card.tsx +++ b/client/src/components/ui/card.tsx @@ -4,6 +4,8 @@ import { InfoIcon } from 'lucide-react'; import { cn } from '@/lib/classnames'; +// import { ScrollArea } from '@/components/ui/scroll-area'; + type CardProps = PropsWithChildren & { title?: string; info?: string; @@ -14,17 +16,21 @@ const Card = ({ children, title, info, className }: CardProps) => { return (
{title && ( -
-

{title}

+
+

{title}

{info && }
)} - {children} + {/* */} +
+
{children}
+
+ {/*
*/}
); }; diff --git a/client/src/components/ui/gradient-line.tsx b/client/src/components/ui/gradient-line.tsx index 966ce08..01cc50c 100644 --- a/client/src/components/ui/gradient-line.tsx +++ b/client/src/components/ui/gradient-line.tsx @@ -1,3 +1,3 @@ -const GradientLine = () =>
; +const GradientLine = () =>
; export default GradientLine; diff --git a/client/src/components/ui/scroll-area.tsx b/client/src/components/ui/scroll-area.tsx new file mode 100644 index 0000000..7b73228 --- /dev/null +++ b/client/src/components/ui/scroll-area.tsx @@ -0,0 +1,47 @@ +'use client'; + +import * as React from 'react'; + +import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area'; + +import { cn } from '@/lib/classnames'; + +const ScrollArea = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + {children} + + + + +)); +ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName; + +const ScrollBar = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, orientation = 'vertical', ...props }, ref) => ( + + + +)); +ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName; + +export { ScrollArea, ScrollBar }; diff --git a/client/src/containers/home/dashboard/numbers.tsx b/client/src/containers/home/dashboard/numbers.tsx index ead5667..a7b4730 100644 --- a/client/src/containers/home/dashboard/numbers.tsx +++ b/client/src/containers/home/dashboard/numbers.tsx @@ -8,9 +8,9 @@ const DashboardNumbers = () => { return (
{numbers.map(({ stat, number }) => ( -
-

{number}

-

{stat}

+
+

{number}

+

{stat}

))}
diff --git a/client/src/containers/home/index.tsx b/client/src/containers/home/index.tsx index b3f11cd..2f57a9c 100644 --- a/client/src/containers/home/index.tsx +++ b/client/src/containers/home/index.tsx @@ -36,31 +36,34 @@ export default function Home() { }, []); return ( -
+
-
+
- -
diff --git a/client/src/containers/home/sidebar/index.tsx b/client/src/containers/home/sidebar/index.tsx index fc630f9..c25e724 100644 --- a/client/src/containers/home/sidebar/index.tsx +++ b/client/src/containers/home/sidebar/index.tsx @@ -14,13 +14,14 @@ export default function Sidebar({ children }: PropsWithChildren) { return (
-
{children}
+
+ {children} +
); } diff --git a/client/src/containers/home/top-stories/index.tsx b/client/src/containers/home/top-stories/index.tsx index b004759..201beb9 100644 --- a/client/src/containers/home/top-stories/index.tsx +++ b/client/src/containers/home/top-stories/index.tsx @@ -10,7 +10,7 @@ const TopStories = () => { }); return ( -
+
{topStories?.data?.map((topStory) => ( ))} diff --git a/client/src/containers/map/markers/home-markers/index.tsx b/client/src/containers/map/markers/home-markers/index.tsx index e5ce3e3..07b1658 100644 --- a/client/src/containers/map/markers/home-markers/index.tsx +++ b/client/src/containers/map/markers/home-markers/index.tsx @@ -66,7 +66,7 @@ const StoryMarkers = () => { type="circle" filter={['has', 'point_count']} paint={{ - 'circle-color': '#000', + 'circle-color': '#FFE094', 'circle-radius': 12, }} layout={{ @@ -85,7 +85,7 @@ const StoryMarkers = () => { 'text-allow-overlap': true, }} paint={{ - 'text-color': '#fff', + 'text-color': '#003247', }} /> diff --git a/client/src/containers/story/steps/layouts/components/map-content.tsx b/client/src/containers/story/steps/layouts/components/map-content.tsx new file mode 100644 index 0000000..d0ef91f --- /dev/null +++ b/client/src/containers/story/steps/layouts/components/map-content.tsx @@ -0,0 +1,45 @@ +import { PropsWithChildren } from 'react'; + +import { ChevronDownIcon } from 'lucide-react'; + +import { cn } from '@/lib/classnames'; + +import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible'; + +type MapContentProps = PropsWithChildren & { + showContent?: boolean; + title?: string; + titlePlaceholder?: string; +}; + +const MapContent = ({ showContent, title, titlePlaceholder, children }: MapContentProps) => { + return ( + + +

+ {title ? ( + title + ) : ( + + {titlePlaceholder} + + )} +

+ +
+ +
+
{children}
+
+
+
+ ); +}; + +export default MapContent; diff --git a/client/src/containers/story/steps/layouts/map-step.tsx b/client/src/containers/story/steps/layouts/map-step.tsx index 834a909..2c6f640 100644 --- a/client/src/containers/story/steps/layouts/map-step.tsx +++ b/client/src/containers/story/steps/layouts/map-step.tsx @@ -3,7 +3,6 @@ import { InfoIcon } from 'lucide-react'; import { cn } from '@/lib/classnames'; -// import { useScrollToItem } from '@/lib/scroll'; import { StepLayoutMapStepComponent, @@ -17,6 +16,8 @@ import CategoryIcon from '@/components/ui/category-icon'; import RichText from '@/components/ui/rich-text'; import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'; +import MapContent from './components/map-content'; + type MapStepLayoutProps = { step: StoryStepsItem; category: StoryCategoryDataAttributes | undefined; @@ -27,14 +28,8 @@ type MapStepLayoutProps = { const cardClassName = 'rounded border border-gray-800 bg-[#335e6f] bg-opacity-50 py-6 px-4 backdrop-blur'; -const MapStepLayout = ({ step, category, showContent, stepIndex }: MapStepLayoutProps) => { +const MapStepLayout = ({ step, category, showContent }: MapStepLayoutProps) => { const { story_summary, card, widget } = step as StepLayoutMapStepComponent; - // const scrollToItem = useScrollToItem(); - - // const handleClickCard = () => { - // scrollToItem(stepIndex + 1); - // }; - return (
@@ -80,33 +75,21 @@ const MapStepLayout = ({ step, category, showContent, stepIndex }: MapStepLayout
{!!card && ( -
-
- {card?.title &&

{card?.title}

} -
- {card?.content} -
-
-
+ {card.content} + )} {!!widget?.id && ( -
-
- {widget?.title &&

{widget?.title}

} + +
{(widget as any)?.legend && {(widget as any).legend}}
-
+ )}
diff --git a/yarn.lock b/yarn.lock index 59d0ecb..ba35ea7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2828,6 +2828,7 @@ __metadata: "@radix-ui/react-label": ^2.0.2 "@radix-ui/react-popover": ^1.0.6 "@radix-ui/react-radio-group": ^1.1.3 + "@radix-ui/react-scroll-area": ^1.1.0 "@radix-ui/react-select": ^1.2.2 "@radix-ui/react-slider": ^1.1.2 "@radix-ui/react-slot": ^1.0.2 @@ -4499,6 +4500,13 @@ __metadata: languageName: node linkType: hard +"@radix-ui/number@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/number@npm:1.1.0" + checksum: e4fc7483c19141c25dbaf3d140b75e2b7fed0bfa3ad969f4441f0266ed34b35413f57a35df7b025e2a977152bbe6131849d3444fc6f15a73345dfc2bfdc105fa + languageName: node + linkType: hard + "@radix-ui/primitive@npm:1.0.1, @radix-ui/primitive@npm:^1.0.1": version: 1.0.1 resolution: "@radix-ui/primitive@npm:1.0.1" @@ -4508,6 +4516,13 @@ __metadata: languageName: node linkType: hard +"@radix-ui/primitive@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/primitive@npm:1.1.0" + checksum: 7cbf70bfd4b2200972dbd52a9366801b5a43dd844743dc97eb673b3ec8e64f5dd547538faaf9939abbfe8bb275773767ecf5a87295d90ba09c15cba2b5528c89 + languageName: node + linkType: hard + "@radix-ui/react-accordion@npm:^1.1.2": version: 1.1.2 resolution: "@radix-ui/react-accordion@npm:1.1.2" @@ -4659,6 +4674,19 @@ __metadata: languageName: node linkType: hard +"@radix-ui/react-compose-refs@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-compose-refs@npm:1.1.0" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 047a4ed5f87cb848be475507cd62836cf5af5761484681f521ea543ea7c9d59d61d42806d6208863d5e2380bf38cdf4cff73c2bbe5f52dbbe50fb04e1a13ac72 + languageName: node + linkType: hard + "@radix-ui/react-context@npm:1.0.1, @radix-ui/react-context@npm:^1.0.1": version: 1.0.1 resolution: "@radix-ui/react-context@npm:1.0.1" @@ -4674,6 +4702,19 @@ __metadata: languageName: node linkType: hard +"@radix-ui/react-context@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-context@npm:1.1.0" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: d48df5e5193a1d963a1ff7a58f08497c60ddc364216c59090c8267985bd478447dd617847ea277afe10e67c4e0c528894c8d7407082325e0650038625140558a + languageName: node + linkType: hard + "@radix-ui/react-dialog@npm:^1.0.4": version: 1.0.5 resolution: "@radix-ui/react-dialog@npm:1.0.5" @@ -4722,6 +4763,19 @@ __metadata: languageName: node linkType: hard +"@radix-ui/react-direction@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-direction@npm:1.1.0" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 25ad0d1d65ad08c93cebfbefdff9ef2602e53f4573a66b37d2c366ede9485e75ec6fc8e7dd7d2939b34ea5504ca0fe6ac4a3acc2f6ee9b62d131d65486eafd49 + languageName: node + linkType: hard + "@radix-ui/react-dismissable-layer@npm:1.0.4": version: 1.0.4 resolution: "@radix-ui/react-dismissable-layer@npm:1.0.4" @@ -5096,6 +5150,26 @@ __metadata: languageName: node linkType: hard +"@radix-ui/react-presence@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-presence@npm:1.1.0" + dependencies: + "@radix-ui/react-compose-refs": 1.1.0 + "@radix-ui/react-use-layout-effect": 1.1.0 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 7f482268aa5bb5a4214dcf39d20ad93cac96585f1f248931be897ed8a9f99965b7f9b2e8bd4f4140c64eb243b471c471bf148e107f49578cc582faa773d3e83a + languageName: node + linkType: hard + "@radix-ui/react-primitive@npm:1.0.2": version: 1.0.2 resolution: "@radix-ui/react-primitive@npm:1.0.2" @@ -5129,6 +5203,25 @@ __metadata: languageName: node linkType: hard +"@radix-ui/react-primitive@npm:2.0.0": + version: 2.0.0 + resolution: "@radix-ui/react-primitive@npm:2.0.0" + dependencies: + "@radix-ui/react-slot": 1.1.0 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 04afc0f3a5ccf1de6e4861f755a89f31640d5a07237c5ac5bffe47bcd8fdf318257961fa56fedc823af49281800ee755752a371561c36fd92f008536a0553748 + languageName: node + linkType: hard + "@radix-ui/react-radio-group@npm:^1.1.3": version: 1.1.3 resolution: "@radix-ui/react-radio-group@npm:1.1.3" @@ -5186,6 +5279,33 @@ __metadata: languageName: node linkType: hard +"@radix-ui/react-scroll-area@npm:^1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-scroll-area@npm:1.1.0" + dependencies: + "@radix-ui/number": 1.1.0 + "@radix-ui/primitive": 1.1.0 + "@radix-ui/react-compose-refs": 1.1.0 + "@radix-ui/react-context": 1.1.0 + "@radix-ui/react-direction": 1.1.0 + "@radix-ui/react-presence": 1.1.0 + "@radix-ui/react-primitive": 2.0.0 + "@radix-ui/react-use-callback-ref": 1.1.0 + "@radix-ui/react-use-layout-effect": 1.1.0 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: d49eef44edaba88c58583eaae5b917139067ff371a16978cd7fa65ea3a85a7652fdf8750e8fb9e3955f7adb327df035de27172c841ac3b0504ca6c3c15ebd7b5 + languageName: node + linkType: hard + "@radix-ui/react-select@npm:^1.2.2": version: 1.2.2 resolution: "@radix-ui/react-select@npm:1.2.2" @@ -5284,6 +5404,21 @@ __metadata: languageName: node linkType: hard +"@radix-ui/react-slot@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-slot@npm:1.1.0" + dependencies: + "@radix-ui/react-compose-refs": 1.1.0 + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 3c9cd90aabf08f541e20dbecb581744be01c552a0cd16e90d7c218381bcc5307aa8a6013d045864e692ba89d3d8c17bfae08df18ed18be6d223d9330ab0302fa + languageName: node + linkType: hard + "@radix-ui/react-switch@npm:^1.0.3": version: 1.0.3 resolution: "@radix-ui/react-switch@npm:1.0.3" @@ -5398,6 +5533,19 @@ __metadata: languageName: node linkType: hard +"@radix-ui/react-use-callback-ref@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-use-callback-ref@npm:1.1.0" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 2ec7903c67e3034b646005556f44fd975dc5204db6885fc58403e3584f27d95f0b573bc161de3d14fab9fda25150bf3b91f718d299fdfc701c736bd0bd2281fa + languageName: node + linkType: hard + "@radix-ui/react-use-controllable-state@npm:1.0.1, @radix-ui/react-use-controllable-state@npm:^1.0.1": version: 1.0.1 resolution: "@radix-ui/react-use-controllable-state@npm:1.0.1" @@ -5445,6 +5593,19 @@ __metadata: languageName: node linkType: hard +"@radix-ui/react-use-layout-effect@npm:1.1.0": + version: 1.1.0 + resolution: "@radix-ui/react-use-layout-effect@npm:1.1.0" + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 271ea0bf1cd74718895a68414a6e95537737f36e02ad08eeb61a82b229d6abda9cff3135a479e134e1f0ce2c3ff97bb85babbdce751985fb755a39b231d7ccf2 + languageName: node + linkType: hard + "@radix-ui/react-use-previous@npm:1.0.1, @radix-ui/react-use-previous@npm:^1.0.1": version: 1.0.1 resolution: "@radix-ui/react-use-previous@npm:1.0.1"