-
-
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.
Merge pull request #4424 from jbx-protocol/dev
release: 2024-08-10
- Loading branch information
Showing
12 changed files
with
109 additions
and
26 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
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
File renamed without changes.
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 |
---|---|---|
@@ -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', | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...ackages/v2v3/components/V2V3Project/ProjectDashboard/components/AboutPanel/AboutPanel.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
2 changes: 1 addition & 1 deletion
2
...v3/components/V2V3Project/ProjectDashboard/components/NftRewardsPanel/NftRewardsPanel.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
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
21 changes: 21 additions & 0 deletions
21
src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4AboutPanel/V4AboutPanel.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,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 ( | ||
<div className="flex min-h-[384px] w-full flex-col gap-8 md:gap-10"> | ||
<div className="flex flex-col gap-4 whitespace-pre-wrap"> | ||
{description ? ( | ||
<RichPreview source={description} /> | ||
) : ( | ||
<> | ||
<EmptyScreen subtitle={t`This project has no description`} /> | ||
</> | ||
)} | ||
</div> | ||
</div> | ||
) | ||
} |
27 changes: 27 additions & 0 deletions
27
src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4AboutPanel/hooks/useV4AboutPanel.ts
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 { 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 = /<a href="((?!http|https).+?)"/g | ||
return description.replace(urlRegex, '<a href="https://$1"') | ||
} |
3 changes: 3 additions & 0 deletions
3
src/packages/v4/views/V4ProjectDashboard/V4ProjectTabs/V4AboutPanel/index.ts
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,3 @@ | ||
import { V4AboutPanel } from "./V4AboutPanel"; | ||
|
||
export default V4AboutPanel; |
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