Skip to content

Commit

Permalink
[docs] Fix redirection to GitHub example view (#4642)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Jan 30, 2025
1 parent b730f9f commit f20fd55
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions docs/src/modules/components/examples/ExamplesFeatured.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function ExamplesFeatured(props: FeaturedExamplesProps) {
}}
>
<Link
href={versionGitHubLink(example.href)}
href={example.href}
target="_blank"
sx={{
position: 'relative',
Expand Down Expand Up @@ -162,7 +162,7 @@ export default function ExamplesFeatured(props: FeaturedExamplesProps) {
</Box>
<Button
component="a"
href={versionGitHubLink(example.href)}
href={example.href}
size="small"
variant="outlined"
color="primary"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/examples/ExamplesGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function ExamplesGrid(props: ExamplesGridProps) {
component="a"
image={computedSrc}
title={example.description}
href={versionGitHubLink(example.href || example.source)}
href={example.href || versionGitHubLink(example.source)}
rel="nofollow"
sx={(theme) => ({
height: 0,
Expand Down
13 changes: 6 additions & 7 deletions docs/src/modules/components/examples/coreExamples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const coreExamples = [
'This app shows you to how to get started using Toolpad Core with Auth.js Passkeys and the Next.js App Router.',
src: '/static/toolpad/docs/core/auth-next-passkey.png',
srcDark: '/static/toolpad/docs/core/auth-next-passkey-dark.png',
source: 'https://github.com/mui/toolpad/tree/master/examples/core/auth-nextjs-passkey/',
source: 'https://github.com/mui/toolpad/tree/master/examples/core/auth-nextjs-passkey',
// Crash with Prisma
codeSandbox: false,
stackBlitz: false,
Expand All @@ -53,8 +53,7 @@ const coreExamples = [
'This app shows you to how to get started using Toolpad Core with Auth.js v4 and the Next.js Pages router.',
src: '/static/toolpad/docs/core/auth-next.png',
srcDark: '/static/toolpad/docs/core/auth-next-dark.png',
source:
'https://github.com/mui/toolpad/tree/master/examples/core/auth-nextjs-pages-nextauth-4/',
source: 'https://github.com/mui/toolpad/tree/master/examples/core/auth-nextjs-pages-nextauth-4',
codeSandbox: true,
// Show nothing
stackBlitz: false,
Expand All @@ -65,7 +64,7 @@ const coreExamples = [
'This app shows you to how to get started using Toolpad Core with Vite and React Router.',
src: '/static/toolpad/docs/core/vite-react-router.png',
srcDark: '/static/toolpad/docs/core/vite-react-router.png', // TODO Fix
source: 'https://github.com/mui/toolpad/tree/master/examples/core/vite/',
source: 'https://github.com/mui/toolpad/tree/master/examples/core/vite',
codeSandbox: true,
// Show nothing
stackBlitz: false,
Expand All @@ -87,7 +86,7 @@ const coreExamples = [
'This app shows you to how to get started using Toolpad Core with Auth.js and the Next.js Pages router.',
src: '/static/toolpad/docs/core/auth-next.png',
srcDark: '/static/toolpad/docs/core/auth-next-dark.png',
source: 'https://github.com/mui/toolpad/tree/master/examples/core/auth-nextjs-pages/',
source: 'https://github.com/mui/toolpad/tree/master/examples/core/auth-nextjs-pages',
// infinite redirection
codeSandbox: false,
stackBlitz: false,
Expand All @@ -98,7 +97,7 @@ const coreExamples = [
'This app shows you to how to get started using Toolpad Core with Auth.js and the Next.js App Router.',
src: '/static/toolpad/docs/core/auth-next.png',
srcDark: '/static/toolpad/docs/core/auth-next-dark.png',
source: 'https://github.com/mui/toolpad/tree/master/examples/core/auth-nextjs/',
source: 'https://github.com/mui/toolpad/tree/master/examples/core/auth-nextjs',
codeSandbox: true,
stackBlitz: true,
},
Expand All @@ -109,7 +108,7 @@ const coreExamples = [
src: '/static/toolpad/docs/core/tutorial-1.png',
srcDark: '/static/toolpad/docs/core/tutorial-1.png', // TODO Fix
href: 'https://mui.com/toolpad/core/introduction/tutorial/',
source: 'https://github.com/mui/toolpad/tree/master/examples/core/tutorial/',
source: 'https://github.com/mui/toolpad/tree/master/examples/core/tutorial',
codeSandbox: true,
stackBlitz: true,
},
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/examples/examplesUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function versionGitHubLink(href: string) {

return href.replace(
`${process.env.SOURCE_CODE_REPO}/tree/master`,
`${process.env.SOURCE_CODE_REPO}/blob/v${process.env.LIB_VERSION}`,
`${process.env.SOURCE_CODE_REPO}/tree/v${process.env.LIB_VERSION}`,
);
}

Expand Down

0 comments on commit f20fd55

Please sign in to comment.