Skip to content

Commit

Permalink
init type safety doc
Browse files Browse the repository at this point in the history
  • Loading branch information
DarrenBaldwin07 committed Oct 3, 2023
1 parent ee7648d commit 9e14c15
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/landing/app/routes/docs.middleware.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const loader: LoaderFunction = ({ request }) => {
return docsSetup('middleware', request);
};

const DocsIntroduction = () => {
const Middleware = () => {
const data = useLoaderData<LoaderOutput>();
return (
<div className='flex w-full flex-col'>
Expand All @@ -45,4 +45,4 @@ const DocsIntroduction = () => {
);
};

export default DocsIntroduction;
export default Middleware;
1 change: 1 addition & 0 deletions docs/landing/app/routes/docs.type-safety.doc.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello world :)
48 changes: 48 additions & 0 deletions docs/landing/app/routes/docs.type-safety.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import React from 'react';
import { docsSetup } from '~/helpers';
import { Heading } from '@rapid-web/ui';
import type { LoaderFunction, LinksFunction } from '@remix-run/node';
import { useLoaderData, Outlet } from '@remix-run/react';
import { BreadCrumb } from '~/components/BreadCrumb';
import styles from '../styles/markdown.css';
import NextDoc from '~/components/NextDoc';
import prism from '../styles/prism.css';

interface LoaderOutput {
routes: string[];
}

export const links: LinksFunction = () => {
return [
{
rel: 'stylesheet',
href: styles,
},
{
rel: 'stylesheet',
href: prism,
},
];
};

export const loader: LoaderFunction = ({ request }) => {
return docsSetup('type-safety', request);
};

const TypeSafety = () => {
const data = useLoaderData<LoaderOutput>();
return (
<div className='flex w-full flex-col'>
<BreadCrumb routes={data.routes} />
<Heading styles='exclude-from-markdown text-white text-5xl font-bold'>
Type safety
</Heading>
<div className='mt-6 text-white'>
<Outlet />
</div>
<NextDoc />
</div>
);
};

export default TypeSafety;

0 comments on commit 9e14c15

Please sign in to comment.