Skip to content

Commit

Permalink
Merge pull request #209 from sei-protocol/docsv2.1_cordt
Browse files Browse the repository at this point in the history
fix breaking errors, add custom 404 component to emit 404 status when…
  • Loading branch information
alexander-sei authored Feb 17, 2025
2 parents 0780984 + a4f3a46 commit 2b0918d
Show file tree
Hide file tree
Showing 102 changed files with 4,627 additions and 3,074 deletions.
10 changes: 7 additions & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
{
"tabWidth": 2,
"useTabs": true,
"bracketSpacing": true,
"jsxBracketSameLine": true,
"bracketSameLine": true,
"printWidth": 164,
"singleQuote": true,
"jsxSingleQuote": true,
"trailingComma": "none",
"arrowParens": "always",
"useTabs": true,
"importOrderSeparation": true,
"overrides": [
{
"files": "*.mdx",
"options": {
"parser": "mdx",
"useTabs": false,
"tabWidth": 2
"tabWidth": 2,
"proseWrap": "preserve",
"printWidth": 999,
"jsxSingleQuote": false
}
}
]
Expand Down
14 changes: 14 additions & 0 deletions components/Set404/Set404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { useEffect } from 'react';

export default function Set404() {
useEffect(() => {
if (typeof window !== 'undefined') {
const nextData = (window as any).__NEXT_DATA__;
if (nextData?.props?.pageProps) {
nextData.props.pageProps.statusCode = 404;
}
}
}, []);

return null;
}
1 change: 1 addition & 0 deletions components/Set404/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Set404';
1 change: 1 addition & 0 deletions components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export * from './MantineWrapper';
export * from './Nfts';
export * from './VersionFetcher';
export * from './PropertyInfo';
export * from './Set404';
export * from './EcosystemMap';
export * from './InteractiveTerminal';
export * from './AskCookbook';
Expand Down
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"generate-seid-docs": "./generate-seid-docs.sh"
"format:pages": "prettier --write 'pages/**/*.{js,ts,tsx,mdx}'",
"generate-seid-docs": "./generate-seid-docs.sh",
"check-links": "concurrently \"next start\" \"wait-on http://localhost:3000 && node scripts/check-links.mjs\" --kill-others --success first"
},
"license": "MIT",
"dependencies": {
Expand Down Expand Up @@ -38,12 +40,17 @@
"@types/styled-components": "^5.1.34",
"@types/underscore": "^1.11.15",
"autoprefixer": "^10.4.17",
"cheerio": "^1.0.0",
"concurrently": "^9.1.2",
"globby": "^14.1.0",
"lodash": "^4.17.21",
"node-fetch": "^3.3.2",
"postcss": "^8.4.38",
"postcss-preset-mantine": "^1.15.0",
"postcss-simple-vars": "^7.0.1",
"prettier": "^3.3.0",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
"typescript": "^5.3.3",
"wait-on": "^8.0.2"
}
}
8 changes: 6 additions & 2 deletions pages/404.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Page not Found
import Set404 from '../components/Set404';

The page you were looking for could not be found.
<Set404 />

# 404 - Page Not Found

This page could not be found.
16 changes: 8 additions & 8 deletions pages/_app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import { ThemeProvider } from 'next-themes';
import { MantineWrapper, AskCookbook } from '../components';

export default function Nextra({ Component, pageProps }) {
return (
<ThemeProvider attribute='class'>
<MantineWrapper>
<Component {...pageProps} />
<AskCookbook />
</MantineWrapper>
</ThemeProvider>
);
return (
<ThemeProvider attribute="class">
<MantineWrapper>
<Component {...pageProps} />
<AskCookbook />
</MantineWrapper>
</ThemeProvider>
);
}
18 changes: 9 additions & 9 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Head, Html, Main, NextScript } from 'next/document';

export default function Document() {
return (
<Html lang="en">
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
);
return (
<Html lang='en'>
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
Loading

0 comments on commit 2b0918d

Please sign in to comment.