Skip to content

Commit

Permalink
chore: opt-out of codesanbox
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanCassiere committed May 14, 2024
1 parent b44e1aa commit 3b96d8b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
2 changes: 2 additions & 0 deletions app/libraries/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export type Library = {
scarfId?: string
defaultDocs?: string
handleRedirects?: (href: string) => void
hideCodesandboxUrl?: true
hideStackblitzUrl?: true
}

export const libraries = [
Expand Down
1 change: 1 addition & 0 deletions app/libraries/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ export const routerProject: Library = {
frameworks: ['react'],
scarfId: '3d14fff2-f326-4929-b5e1-6ecf953d24f4',
defaultDocs: 'framework/react/overview',
hideCodesandboxUrl: true,
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export default function Example() {
isDark ? 'dark' : 'light'
}`

const hideStackblitz = !!library.hideStackblitzUrl
const hideCodesandbox = !!library.hideCodesandboxUrl

return (
<div className="flex-1 flex flex-col min-h-0 overflow-auto">
<div className="p-4 lg:p-6">
Expand All @@ -68,22 +71,26 @@ export default function Example() {
>
<FaExternalLinkAlt /> Github
</a>
<a
href={stackBlitzUrl}
target="_blank"
className="flex gap-1 items-center"
rel="noreferrer"
>
<FaExternalLinkAlt /> StackBlitz
</a>
<a
href={codesandboxUrl}
target="_blank"
className="flex gap-1 items-center"
rel="noreferrer"
>
<FaExternalLinkAlt /> CodeSandbox
</a>
{!hideStackblitz ? (
<a
href={stackBlitzUrl}
target="_blank"
className="flex gap-1 items-center"
rel="noreferrer"
>
<FaExternalLinkAlt /> StackBlitz
</a>
) : null}
{!hideCodesandbox ? (
<a
href={codesandboxUrl}
target="_blank"
className="flex gap-1 items-center"
rel="noreferrer"
>
<FaExternalLinkAlt /> CodeSandbox
</a>
) : null}
</div>
</DocTitle>
</div>
Expand Down

0 comments on commit 3b96d8b

Please sign in to comment.