-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Here is how new functionality looks like: <img width="598" alt="image" src="https://github.com/user-attachments/assets/b3286579-0fee-4f60-9a65-834e3fb0911e" /> <img width="598" alt="image" src="https://github.com/user-attachments/assets/1eb21b09-334f-473a-93d8-f456f1a4393f" /> Variant for the feature without `simd_link`: <img width="598" alt="image" src="https://github.com/user-attachments/assets/be4488fb-47d7-4614-86e8-b988d3c30874" /> --------- Co-authored-by: Noah Gundotra <[email protected]>
- Loading branch information
Showing
12 changed files
with
1,190 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,4 +35,8 @@ yarn-error.log* | |
next-env.d.ts | ||
|
||
# Speedy Web Compiler | ||
.swc/ | ||
.swc/ | ||
|
||
# vim | ||
*.sw* | ||
.editorconfig |
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,35 @@ | ||
import { FeatureGateCard } from '@components/account/FeatureGateCard'; | ||
import getReadableTitleFromAddress, { AddressPageMetadataProps } from '@utils/get-readable-title-from-address'; | ||
import { Metadata } from 'next/types'; | ||
import ReactMarkdown from 'react-markdown'; | ||
import remarkFrontmatter from 'remark-frontmatter'; | ||
import remarkGFM from 'remark-gfm'; | ||
|
||
import { fetchFeatureGateInformation } from '@/app/features/feature-gate'; | ||
import { getFeatureInfo } from '@/app/utils/feature-gate/utils'; | ||
|
||
type Props = Readonly<{ | ||
params: { | ||
address: string; | ||
}; | ||
}>; | ||
|
||
export async function generateMetadata(props: AddressPageMetadataProps): Promise<Metadata> { | ||
return { | ||
description: `Feature information for address ${props.params.address} on Solana`, | ||
title: `Feature Gate | ${await getReadableTitleFromAddress(props)} | Solana`, | ||
}; | ||
} | ||
|
||
export default async function FeatureGatePage({ params: { address } }: Props) { | ||
const feature = getFeatureInfo(address); | ||
const data = await fetchFeatureGateInformation(feature); | ||
|
||
// remark-gfm won't handle github-flavoured-markdown with a table present at it | ||
// TODO: figure out a configuration to render GFM table correctly | ||
return ( | ||
<FeatureGateCard> | ||
<ReactMarkdown remarkPlugins={[remarkGFM, remarkFrontmatter]}>{data}</ReactMarkdown> | ||
</FeatureGateCard> | ||
); | ||
} |
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
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,12 @@ | ||
export function FeatureGateCard({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<div className="card"> | ||
<div className="card-header align-items-center"> | ||
<h3 className="card-header-title">Feature Information</h3> | ||
</div> | ||
<div className="card-footer"> | ||
<div className="text-muted">{children}</div> | ||
</div> | ||
</div> | ||
); | ||
} |
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
Oops, something went wrong.