Skip to content

Commit d658c5d

Browse files
committed
Merge branch 'dev' into 329-feature-add-shimmer-effect-using-framer-motion
2 parents 8cc6847 + 1abb135 commit d658c5d

File tree

101 files changed

+16004
-8502
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+16004
-8502
lines changed

.env.local.example

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,15 @@ FEATURE_SITEMAPS='false'
3434
FEATURE_SITEMAP_BACKEND_BASE_URL= http://backendurl/api
3535
FEATURE_SITEMAP_ITEMS_PER_PAGE=5
3636
FEATURE_SITEMAP_CACHE_DURATION=3600
37-
FEATURE_SITEMAP_CHILD_CACHE_DURATION=21600
37+
FEATURE_SITEMAP_CHILD_CACHE_DURATION=21600
38+
39+
40+
41+
NODE_ENV=development
42+
43+
# Monitoring
44+
NEXT_PUBLIC_GRAPHQL_INTROSPECTION=false
45+
NEXT_TELEMETRY_DISABLED=1
46+
47+
# Turbopack (suppress Sentry warning when using --turbo)
48+
SENTRY_SUPPRESS_TURBOPACK_WARNING=1

.eslintrc.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

app/[locale]/(user)/collaboratives/CollaborativesListingClient.tsx

Lines changed: 127 additions & 121 deletions
Large diffs are not rendered by default.

app/[locale]/(user)/collaboratives/[collaborativeSlug]/CollaborativeDetailsClient.tsx

Lines changed: 191 additions & 158 deletions
Large diffs are not rendered by default.

app/[locale]/(user)/collaboratives/[collaborativeSlug]/page.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,15 @@ const CollaborativeInfoQuery = graphql(`
2626
export async function generateMetadata({
2727
params,
2828
}: {
29-
params: { collaborativeSlug: string };
29+
params: Promise<{ collaborativeSlug: string }>;
3030
}): Promise<Metadata> {
31+
const { collaborativeSlug } = await params;
3132
try {
32-
const data = await GraphQLPublic(CollaborativeInfoQuery, {}, { pk: params.collaborativeSlug });
33+
const data = await GraphQLPublic(
34+
CollaborativeInfoQuery,
35+
{},
36+
{ pk: collaborativeSlug }
37+
);
3338
const Collaborative = data?.collaborative;
3439

3540
return generatePageMetadata({
@@ -41,7 +46,7 @@ export async function generateMetadata({
4146
openGraph: {
4247
type: 'article',
4348
locale: 'en_US',
44-
url: `${process.env.NEXT_PUBLIC_PLATFORM_URL}/collaboratives/${params.collaborativeSlug}`,
49+
url: `${process.env.NEXT_PUBLIC_PLATFORM_URL}/collaboratives/${collaborativeSlug}`,
4550
title: `${Collaborative?.title} | Collaborative Data | CivicDataSpace`,
4651
description:
4752
Collaborative?.summary ||
@@ -59,7 +64,7 @@ export async function generateMetadata({
5964
openGraph: {
6065
type: 'article',
6166
locale: 'en_US',
62-
url: `${process.env.NEXT_PUBLIC_PLATFORM_URL}/collaboratives/${params.collaborativeSlug}`,
67+
url: `${process.env.NEXT_PUBLIC_PLATFORM_URL}/collaboratives/${collaborativeSlug}`,
6368
title: `Collaborative Details | CivicDataSpace`,
6469
description: `Explore open data and curated datasets in this collaborative.`,
6570
siteName: 'CivicDataSpace',

app/[locale]/(user)/collaboratives/components/Details.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
import Image from 'next/image';
44
import { Button, Icon, Spinner, Tag, Text, Tray } from 'opub-ui';
55
import { useState } from 'react';
6-
import ReactMarkdown from 'react-markdown';
7-
import rehypeRaw from 'rehype-raw';
8-
import remarkGfm from 'remark-gfm';
96

107
import { Icons } from '@/components/icons';
8+
import { RichTextRenderer } from '@/components/RichTextRenderer';
119
import Metadata from './Metadata';
1210

1311
const PrimaryDetails = ({ data, isLoading }: { data: any; isLoading: any }) => {
@@ -142,14 +140,10 @@ const PrimaryDetails = ({ data, isLoading }: { data: any; isLoading: any }) => {
142140
</div>
143141
)}
144142
<div className="mt-6 lg:mt-10">
145-
<div className="prose-h1:text-3xl prose-h2:text-2xl prose-h3:text-xl prose-p:leading-relaxed prose-a:text-blue-400 hover:prose-a:text-blue-300 prose-code:bg-gray-800 prose-code:rounded prose-pre:bg-gray-900 prose-pre:border prose-pre:border-gray-700 prose-blockquote:border-l-blue-500 prose-th:bg-gray-800 prose-img:rounded-lg prose prose-lg prose-invert mt-4 max-w-none prose-headings:text-white prose-p:text-white prose-a:underline prose-blockquote:text-white prose-strong:text-white prose-em:text-white prose-code:px-1 prose-code:py-0.5 prose-code:text-white prose-code:before:content-none prose-code:after:content-none prose-pre:text-white prose-ol:text-white prose-ul:text-white prose-li:text-white prose-li:marker:text-white prose-table:text-white prose-thead:border-white prose-tr:border-white prose-th:border-white prose-th:text-white prose-td:border-white prose-td:text-white prose-hr:border-white">
146-
<ReactMarkdown
147-
remarkPlugins={[remarkGfm]}
148-
rehypePlugins={[rehypeRaw]}
149-
>
150-
{data.collaborativeBySlug.summary}
151-
</ReactMarkdown>
152-
</div>
143+
<RichTextRenderer
144+
content={data.collaborativeBySlug.summary}
145+
className="text-white"
146+
/>
153147
</div>
154148
</div>
155149
</div>

app/[locale]/(user)/collaboratives/components/Metadata.tsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ const Metadata = ({ data, setOpen }: { data: any; setOpen?: any }) => {
3838
'N/A'
3939
) : (
4040
<Link
41-
className="text-primaryBlue underline"
41+
className="text-primaryBlue underline lg:text-white"
4242
href={data.collaborativeBySlug.platformUrl}
4343
>
44-
<Text className="underline" color="onBgDefault" variant="bodyLg">
44+
<Text className="underline text-primaryBlue lg:text-white" variant="bodyLg">
4545
{platformTitle?.trim() ? platformTitle : 'Visit Platform'}
4646
</Text>
4747
</Link>
@@ -78,15 +78,15 @@ const Metadata = ({ data, setOpen }: { data: any; setOpen?: any }) => {
7878
{
7979
label: 'SDG Goals',
8080
value: (
81-
<div className="flex flex-wrap gap-2">
81+
<div className="flex flex-wrap gap-2">
8282
{data.collaborativeBySlug.sdgs && data.collaborativeBySlug.sdgs.length > 0 ? (
8383
data.collaborativeBySlug.sdgs.map((sdg: any, index: number) => (
8484
<Tooltip content={`${sdg.code} - ${sdg.name}`} key={index}>
8585
<Image
8686
src={`/SDG/${sdg.code}.svg`}
8787
alt={sdg.name || ''}
88-
width={60}
89-
height={60}
88+
width={50}
89+
height={50}
9090
className="bg-white"
9191
/>
9292
</Tooltip>
@@ -111,11 +111,11 @@ const Metadata = ({ data, setOpen }: { data: any; setOpen?: any }) => {
111111
<Text
112112
variant="headingLg"
113113
fontWeight="semibold"
114-
color="onBgDefault"
114+
className="text-primaryBlue lg:text-white"
115115
>
116116
ABOUT THE COLLABORATIVE{' '}
117117
</Text>
118-
<Text variant="bodyLg" color="onBgDefault">DETAILS</Text>
118+
<Text variant="bodyLg" className="text-gray-900 lg:text-white">DETAILS</Text>
119119
</div>
120120
<div className="flex items-center justify-between">
121121
{setOpen && (
@@ -140,18 +140,16 @@ const Metadata = ({ data, setOpen }: { data: any; setOpen?: any }) => {
140140
{metadata.map((item, index) => (
141141
<div key={index} className="flex gap-2">
142142
<Text
143-
className="min-w-[120px] basis-1/4 uppercase"
143+
className="min-w-[120px] basis-1/4 uppercase text-gray-900 lg:text-white"
144144
variant="bodyMd"
145-
color="onBgDefault"
146145
>
147146
{item.label}
148147
</Text>
149148
<Tooltip content={item?.tooltipContent}>
150149
<Text
151-
className="max-w-xs truncate"
150+
className={`${item.label === 'SDG Goals' || item.label === 'Sectors' ? 'max-w-full' : 'max-w-xs truncate'} text-gray-900 lg:text-white`}
152151
variant="bodyLg"
153152
fontWeight="medium"
154-
color="onBgDefault"
155153
>
156154
{typeof item.value === 'string' ? item.value : item.value}
157155
</Text>
@@ -162,9 +160,8 @@ const Metadata = ({ data, setOpen }: { data: any; setOpen?: any }) => {
162160
{data.collaborativeBySlug.contributors && data.collaborativeBySlug.contributors.length > 0 && (
163161
<div className="flex gap-2">
164162
<Text
165-
className="min-w-[120px] basis-1/4 uppercase"
163+
className="min-w-[120px] basis-1/4 uppercase text-gray-900 lg:text-white"
166164
variant="bodyMd"
167-
color="onBgDefault"
168165
>
169166
Contributors
170167
</Text>

app/[locale]/(user)/components/Content.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { SearchInput, Spinner, Tag, Text } from 'opub-ui';
1010
import { GraphQL } from '@/lib/api';
1111
import { cn } from '@/lib/utils';
1212
import Styles from '../page.module.scss';
13+
import { useTourTrigger } from '@/hooks/use-tour-trigger';
1314

1415
const statsInfo: any = graphql(`
1516
query StatsList {
@@ -34,6 +35,10 @@ const statsInfo: any = graphql(`
3435

3536
export const Content = () => {
3637
const router = useRouter();
38+
39+
// Enable tour for first-time users
40+
useTourTrigger(true, 1500);
41+
3742
const Stats: { data: any; isLoading: any } = useQuery([`statsDetails`], () =>
3843
GraphQL(statsInfo, {}, [])
3944
);
@@ -76,7 +81,7 @@ export const Content = () => {
7681

7782
const Sectors = [
7883
'Public Finance',
79-
'Law and Justice',
84+
'Law And Justice',
8085
'Climate Action',
8186
'Urban Development',
8287
'Gender',
@@ -104,7 +109,11 @@ export const Content = () => {
104109
) : (
105110
<div className="flex flex-wrap items-center gap-4 md:gap-0 lg:gap-0 ">
106111
{Metrics.map((item, index) => (
107-
<Link key={`${item.label}_${index}`} href={item.link}>
112+
<Link
113+
key={`${item.label}_${index}`}
114+
href={item.link}
115+
data-tour={index === 0 ? 'datasets-link' : index === 1 ? 'usecases-link' : index === 2 ? 'publishers-link' : undefined}
116+
>
108117
<div
109118
key={index}
110119
className="flex flex-col border-x-[1px] border-solid border-tertiaryAccent px-4"
@@ -123,7 +132,7 @@ export const Content = () => {
123132
))}
124133
</div>
125134
)}
126-
<div className="w-full">
135+
<div className="w-full" data-tour="search-bar">
127136
<SearchInput
128137
className={cn(Styles.Search)}
129138
onSubmit={handleSearch}

app/[locale]/(user)/components/Datasets.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,25 +102,29 @@ const Datasets = () => {
102102
description={item.description}
103103
metadataContent={[
104104
{
105-
icon: Icons.calendar,
105+
icon: Icons.calendar as any,
106106
label: 'Date',
107-
value: new Date(item.modified).toLocaleDateString('en-US', {
108-
day: 'numeric',
109-
month: 'long',
110-
year: 'numeric',
111-
}),
107+
value: new Date(item.modified).toLocaleDateString(
108+
'en-US',
109+
{
110+
day: 'numeric',
111+
month: 'long',
112+
year: 'numeric',
113+
}
114+
),
112115
},
113116
{
114-
icon: Icons.download,
117+
icon: Icons.download as any,
115118
label: 'Download',
116119
value: item.download_count.toString(),
117120
},
118121
{
119122
icon: Icons.globe,
120123
label: 'Geography',
121-
value: item.geographies?.length > 0
122-
? item.geographies.join(', ')
123-
: 'Not specified',
124+
value:
125+
item.geographies?.length > 0
126+
? item.geographies.join(', ')
127+
: 'Not specified',
124128
},
125129
]}
126130
tag={item.tags}

0 commit comments

Comments
 (0)