diff --git a/src/components/Create/components/pages/ReconfigurationRules/ReconfigurationRulesPage.tsx b/src/components/Create/components/pages/ReconfigurationRules/ReconfigurationRulesPage.tsx index b81704643d..7c34ac7671 100644 --- a/src/components/Create/components/pages/ReconfigurationRules/ReconfigurationRulesPage.tsx +++ b/src/components/Create/components/pages/ReconfigurationRules/ReconfigurationRulesPage.tsx @@ -15,10 +15,12 @@ import { TERMINAL_MIGRATION_EXPLANATION, } from 'components/strings' import { CREATE_FLOW } from 'constants/fathomEvents' +import { FEATURE_FLAGS } from 'constants/featureFlags' import { readNetwork } from 'constants/networks' import { trackFathomGoal } from 'lib/fathom' import { useContext } from 'react' import { useSetCreateFurthestPageReached } from 'redux/hooks/useEditingCreateFurthestPageReached' +import { featureFlagEnabled } from 'utils/featureFlags' import { CreateCollapse } from '../../CreateCollapse/CreateCollapse' import { PageContext } from '../../Wizard/contexts/PageContext' import { Wizard } from '../../Wizard/Wizard' @@ -82,12 +84,14 @@ export const ReconfigurationRulesPage = () => { - {/* - - */} + {featureFlagEnabled(FEATURE_FLAGS.OFAC) ? ( + + + + ) : null} { terminalMigration, controllerMigration, holdFees, - // ofac, + ofac, } = useRulesReview() return ( @@ -63,10 +65,12 @@ export const RulesReview = () => {
{controllerMigration}
} /> - {/* {ofac}} - /> */} + {featureFlagEnabled(FEATURE_FLAGS.OFAC) ? ( + {ofac}} + /> + ) : null} ) } diff --git a/src/packages/v2v3/components/V2V3Project/ProjectDashboard/components/EmptyScreen.tsx b/src/components/Project/ProjectTabs/EmptyScreen.tsx similarity index 100% rename from src/packages/v2v3/components/V2V3Project/ProjectDashboard/components/EmptyScreen.tsx rename to src/components/Project/ProjectTabs/EmptyScreen.tsx diff --git a/src/constants/featureFlags.ts b/src/constants/featureFlags.ts index f4c25425b8..464fd11bb0 100644 --- a/src/constants/featureFlags.ts +++ b/src/constants/featureFlags.ts @@ -1,6 +1,7 @@ -export type FeatureFlag = 'SIMULATE_TXS' | 'V4' +export type FeatureFlag = 'SIMULATE_TXS' | 'V4' | 'OFAC' export const FEATURE_FLAGS: { [k in FeatureFlag]: string } = { SIMULATE_TXS: 'simulateTxs', V4: 'v4', + OFAC: 'ofac', } diff --git a/src/locales/messages.pot b/src/locales/messages.pot index cf317d3fc8..31ad4d646e 100644 --- a/src/locales/messages.pot +++ b/src/locales/messages.pot @@ -152,6 +152,9 @@ msgstr "" msgid "An address" msgstr "" +msgid "Activating this option enables running the user's wallet address against OFAC’s Specially Designated Nationals (SDN) list" +msgstr "" + msgid "Pay {0}" msgstr "" @@ -1748,6 +1751,9 @@ msgstr "" msgid "About the protocol" msgstr "" +msgid "OFAC Sanctions screening" +msgstr "" + msgid "Existing project payer addresses can be found in the Tools drawer (<0/>) on the project page." msgstr "" @@ -2309,6 +2315,9 @@ msgstr "" msgid "to close" msgstr "" +msgid "Disallow payments from users who appear on OFAC’s Specially Designated Nationals (SDN) list. Note: payments are still possible on other websites (for example, Etherscan)." +msgstr "" + msgid "Immediately" msgstr "" @@ -3074,6 +3083,9 @@ msgstr "" msgid "If you don't plan on unlocking the held fees later on, you can use the button below to process them now. When you press the button, the held fees will be used to buy $JBX. This cannot be undone." msgstr "" +msgid "Check User Wallet Address" +msgstr "" + msgid "Set ENS text record for {ensName}" msgstr "" @@ -3692,6 +3704,9 @@ msgstr "" msgid "Payment amount can't exceed your wallet balance." msgstr "" +msgid "Additional settings" +msgstr "" + msgid "Last paid" 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 394f7045c3..890ea0bbe4 100644 --- a/src/packages/v2v3/components/V2V3Project/ProjectDashboard/components/AboutPanel/AboutPanel.tsx +++ b/src/packages/v2v3/components/V2V3Project/ProjectDashboard/components/AboutPanel/AboutPanel.tsx @@ -1,7 +1,7 @@ import { t } from '@lingui/macro' +import { EmptyScreen } from 'components/Project/ProjectTabs/EmptyScreen' import { RichPreview } from 'components/RichPreview/RichPreview' import { useAboutPanel } from 'packages/v2v3/components/V2V3Project/ProjectDashboard/hooks/useAboutPanel' -import { EmptyScreen } from '../EmptyScreen' export const AboutPanel = () => { const { description } = useAboutPanel() diff --git a/src/packages/v2v3/components/V2V3Project/ProjectDashboard/components/NftRewardsPanel/NftRewardsPanel.tsx b/src/packages/v2v3/components/V2V3Project/ProjectDashboard/components/NftRewardsPanel/NftRewardsPanel.tsx index 16b1a5a0cd..10e08157d7 100644 --- a/src/packages/v2v3/components/V2V3Project/ProjectDashboard/components/NftRewardsPanel/NftRewardsPanel.tsx +++ b/src/packages/v2v3/components/V2V3Project/ProjectDashboard/components/NftRewardsPanel/NftRewardsPanel.tsx @@ -1,5 +1,5 @@ import { Trans, t } from '@lingui/macro' -import { EmptyScreen } from '../EmptyScreen' +import { EmptyScreen } from 'components/Project/ProjectTabs/EmptyScreen' import { NftReward, NftRewardSkeleton } from './NftReward/NftReward' import { RedeemNftsSection } from './RedeemNftsSection/RedeemNftsSection' import { useNftRewardsPanel } from './hooks/useNftRewardsPanel' diff --git a/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/pages/ProjectDetailsSettingsPage/ProjectDetailsForm.tsx b/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/pages/ProjectDetailsSettingsPage/ProjectDetailsForm.tsx index c7c978b0fd..e5e4151c59 100644 --- a/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/pages/ProjectDetailsSettingsPage/ProjectDetailsForm.tsx +++ b/src/packages/v2v3/components/V2V3Project/V2V3ProjectSettings/pages/ProjectDetailsSettingsPage/ProjectDetailsForm.tsx @@ -3,12 +3,15 @@ import { Button, Form, FormInstance } from 'antd' import { useWatch } from 'antd/lib/form/Form' import { FormItems } from 'components/formItems' import { FormImageUploader } from 'components/inputs/FormImageUploader' +import { JuiceSwitch } from 'components/inputs/JuiceSwitch' import { JuiceInput } from 'components/inputs/JuiceTextInput' import { MinimalCollapse } from 'components/MinimalCollapse' import { RichEditor } from 'components/RichEditor' +import { FEATURE_FLAGS } from 'constants/featureFlags' import { ProjectTagName } from 'models/project-tags' import { inputIsLengthRule } from 'utils/antdRules/inputIsLengthRule' +import { featureFlagEnabled } from 'utils/featureFlags' import { normalizeHandle } from 'utils/format/formatHandle' export type ProjectDetailsFormFields = { @@ -145,17 +148,21 @@ export function ProjectDetailsForm({ - {/*
- Additional settings}> - - - - -
*/} + + {featureFlagEnabled(FEATURE_FLAGS.OFAC) ? ( +
+ Additional settings}> + + + + +
+ ) : null} +
{saveButton ?? ( diff --git a/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4AboutPanel/V4AboutPanel.tsx b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4AboutPanel/V4AboutPanel.tsx new file mode 100644 index 0000000000..1832984957 --- /dev/null +++ b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4AboutPanel/V4AboutPanel.tsx @@ -0,0 +1,21 @@ +import { t } from "@lingui/macro" +import { EmptyScreen } from "components/Project/ProjectTabs/EmptyScreen" +import { RichPreview } from "components/RichPreview/RichPreview" +import { useV4AboutPanel } from "./hooks/useV4AboutPanel" + +export const V4AboutPanel = () => { + const { description } = useV4AboutPanel() + return ( +
+
+ {description ? ( + + ) : ( + <> + + + )} +
+
+ ) +} diff --git a/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4AboutPanel/hooks/useV4AboutPanel.ts b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4AboutPanel/hooks/useV4AboutPanel.ts new file mode 100644 index 0000000000..935d116136 --- /dev/null +++ b/src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4AboutPanel/hooks/useV4AboutPanel.ts @@ -0,0 +1,27 @@ +import { useJBProjectMetadataContext } from 'juice-sdk-react' +import { wrapNonAnchorsInAnchor } from 'utils/wrapNonAnchorsInAnchor' + +export type SocialLink = 'twitter' | 'discord' | 'telegram' | 'website' + +export const useV4AboutPanel = () => { + const { metadata } = useJBProjectMetadataContext() + const projectMetadata = metadata?.data + + const description = projectMetadata?.description + ? addHttpsToDescriptionUrls( + wrapNonAnchorsInAnchor(projectMetadata?.description), + ) + : undefined + + + return { + description, + projectName: projectMetadata?.name, + } +} + +const addHttpsToDescriptionUrls = (description: string) => { + // find all dangling a hrefs missing a https:// or http:// or any protocol and add https:// + const urlRegex = / { const tabs: ProjectTabConfig[] = useMemo( () => [ { id: 'activity', name: t`Activity`, panel: }, - { id: 'about', name: t`About`, panel: <> }, + { id: 'about', name: t`About`, panel: }, { id: 'cycle_payouts', name: t`Cycles & Payouts`,