Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: hide csb links for router #229

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 hideCodesandbox = library.hideCodesandboxUrl
const hideStackblitz = library.hideStackblitzUrl

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
Loading