diff --git a/.example.env b/.example.env index ca2d6f22bf..8f1a8414d8 100644 --- a/.example.env +++ b/.example.env @@ -62,3 +62,5 @@ DB_PROJECTS_WEBHOOK_URL= # Discord Webhook URL for /contact page. CONTACT_WEBHOOK_URL= + +NEXT_PUBLIC_V4_ENABLED=false \ No newline at end of file diff --git a/src/lib/api/supabase/projects/api.ts b/src/lib/api/supabase/projects/api.ts index 76b6193894..af682f74d6 100644 --- a/src/lib/api/supabase/projects/api.ts +++ b/src/lib/api/supabase/projects/api.ts @@ -50,14 +50,18 @@ export async function queryAllSGProjectsForServer() { chainId: readNetwork.chainId, } }) as unknown as Json>[] - const _resSepoliaV4 = resSepoliaV4.map(p => { - return { - ...p, - id: getSubgraphIdForProject(PV_V4, p.projectId), // Patch in the subgraph ID for V4 projects (to be consitent with legacy subgraph) - pv: PV_V4, // Patch in the PV for V4 projects, - chainId: sepolia.id, - } - }) as unknown as Json>[] + const _resSepoliaV4 = process.env.NEXT_PUBLIC_V4_ENABLED + ? (resSepoliaV4.map(p => { + return { + ...p, + id: getSubgraphIdForProject(PV_V4, p.projectId), // Patch in the subgraph ID for V4 projects (to be consitent with legacy subgraph) + pv: PV_V4, // Patch in the PV for V4 projects, + chainId: sepolia.id, + } + }) as unknown as Json< + Pick + >[]) + : [] return [..._res, ..._resSepoliaV4].map(formatSGProjectForDB) } diff --git a/src/locales/messages.pot b/src/locales/messages.pot index 499ad578a7..911a89df0c 100644 --- a/src/locales/messages.pot +++ b/src/locales/messages.pot @@ -3278,6 +3278,9 @@ msgstr "" msgid "Available payout" msgstr "" +msgid "Notice from {name}" +msgstr "" + msgid "Big ups to the Ethereum community for crafting the infrastructure and economy to make Juicebox possible." msgstr "" diff --git a/src/packages/v2v3/components/V2V3Project/ProjectDashboard/components/AboutPanel/AboutPanel.tsx b/src/packages/v2v3/components/V2V3Project/ProjectDashboard/components/AboutPanel/AboutPanel.tsx index 890ea0bbe4..8e81f3dadc 100644 --- a/src/packages/v2v3/components/V2V3Project/ProjectDashboard/components/AboutPanel/AboutPanel.tsx +++ b/src/packages/v2v3/components/V2V3Project/ProjectDashboard/components/AboutPanel/AboutPanel.tsx @@ -1,10 +1,18 @@ -import { t } from '@lingui/macro' +import { EnvelopeIcon } from '@heroicons/react/24/outline' +import { t, Trans } from '@lingui/macro' +import { Callout } from 'components/Callout/Callout' import { EmptyScreen } from 'components/Project/ProjectTabs/EmptyScreen' import { RichPreview } from 'components/RichPreview/RichPreview' +import { useProjectMetadataContext } from 'contexts/ProjectMetadataContext' import { useAboutPanel } from 'packages/v2v3/components/V2V3Project/ProjectDashboard/hooks/useAboutPanel' export const AboutPanel = () => { const { description } = useAboutPanel() + const { projectMetadata } = useProjectMetadataContext() + + const payDisclosure = projectMetadata?.payDisclosure + const name = projectMetadata?.name + return (
@@ -15,6 +23,22 @@ export const AboutPanel = () => { )} + {/* provide an anchorpoint */} + + {name && payDisclosure && ( + } + > + <> +
+ Notice from {name} +
+

{payDisclosure}

+ +
+ )}
) diff --git a/src/pages/api/projects/trending.ts b/src/pages/api/projects/trending.ts index e4c122e1c0..095a215f3d 100644 --- a/src/pages/api/projects/trending.ts +++ b/src/pages/api/projects/trending.ts @@ -63,9 +63,11 @@ const handler: NextApiHandler = async (req, res) => { const projects = [ ...projectsRes.data.projects, - ...v4SepoliaProjectsRes.data.projects.map(p => { - return { ...p, chainId: sepolia.id, pv: PV_V4 } - }), + ...(process.env.NEXT_PUBLIC_V4_ENABLED + ? v4SepoliaProjectsRes.data.projects.map(p => { + return { ...p, chainId: sepolia.id, pv: PV_V4 } + }) + : []), ] try {