-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PREVIEW] Dev system for blocked projects and block Metakeys copy-cat
- Loading branch information
1 parent
414f05a
commit 247eee6
Showing
7 changed files
with
65 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/components/ProjectDashboard/components/BlockedProjectBanner.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Trans } from '@lingui/macro' | ||
import Banner from 'components/Banner' | ||
import ExternalLink from 'components/ExternalLink' | ||
import { useBlockedProject } from 'hooks/useBlockedProject' | ||
|
||
export function BlockedProjectBanner() { | ||
const isBlockedProject = useBlockedProject() | ||
if (!isBlockedProject) return null | ||
|
||
const delistingPolicyLink = | ||
'https://github.com/peeldao/proposals/pull/42/files' | ||
const discordLink = 'https://discord.gg/wFTh4QnDzk' | ||
|
||
return ( | ||
<Banner | ||
title={<Trans>Delisted project</Trans>} | ||
body={ | ||
<Trans> | ||
This project has been <strong>delisted</strong> for breaching our{' '} | ||
<ExternalLink href={delistingPolicyLink}>policy</ExternalLink>.{' '} | ||
<ExternalLink href={discordLink}>Get in touch</ExternalLink>. | ||
</Trans> | ||
} | ||
variant="warning" | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// List of delisted projects | ||
export const BLOCKED_PROJECT_IDS = [ | ||
'564', //copycat of 563 | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { BLOCKED_PROJECT_IDS } from 'constants/blocklist' | ||
import { ProjectMetadataContext } from 'contexts/shared/ProjectMetadataContext' | ||
import { useContext } from 'react' | ||
|
||
export const useBlockedProject = () => { | ||
const { projectId } = useContext(ProjectMetadataContext) | ||
const isBlockedProject = projectId | ||
? BLOCKED_PROJECT_IDS.includes(projectId?.toString()) | ||
: false | ||
return isBlockedProject | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters