Skip to content

Commit

Permalink
fix: move the layout to an actual remix layout
Browse files Browse the repository at this point in the history
This allows me to have a data loader for the layout itself, which can
have a different caching strategy than the root loader.
  • Loading branch information
eligundry committed Jul 12, 2024
1 parent fe93b1b commit d3323e2
Show file tree
Hide file tree
Showing 32 changed files with 591 additions and 954 deletions.
8 changes: 4 additions & 4 deletions app/components/Base/HomeSection.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import clsx from 'clsx'
import { cn } from '~/lib/util'

import { Heading, Typography } from '~/components/Base'

Expand All @@ -15,12 +15,12 @@ const HomeSection: React.FC<React.PropsWithChildren<Props>> = ({
className,
}) => {
return (
<section className={clsx(className)}>
<Heading level="h3" className={clsx('mb-0')}>
<section className={cn(className)}>
<Heading level="h3" className={cn('mb-0')}>
{title}
</Heading>
{typeof subtitle === 'string' ? (
<Typography variant="hint" className={clsx('mb-2')}>
<Typography variant="hint" className={cn('mb-2')}>
{subtitle}
</Typography>
) : (
Expand Down
150 changes: 0 additions & 150 deletions app/components/Base/Layout.tsx

This file was deleted.

145 changes: 0 additions & 145 deletions app/components/Base/LayoutV2.tsx

This file was deleted.

1 change: 0 additions & 1 deletion app/components/Base/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import React from 'react'

import { cn } from '~/lib/util'

export { default as Layout } from './LayoutV2'
export { default as EmojiText } from './EmojiText'

const headingVariants = cva('', {
Expand Down
38 changes: 17 additions & 21 deletions app/components/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
Container,
EmojiText,
Heading,
Layout,
Typography,
} from '~/components/Base'
import Document from '~/components/Base/Document'
Expand All @@ -33,26 +32,23 @@ export const PageErrorBoundary: React.FC = () => {

return (
<Document>
<Layout>
<Container>
<div className={clsx('prose')}>
<Heading level="h2">⛔️ Whoops!</Heading>
<Typography>
We seem to have run into an error. We are working on fixing it
now.
</Typography>
<details className={clsx('mb-6')}>
<summary>Detailed error message</summary>
<pre className={clsx('whitespace-pre-line')}>{body}</pre>
</details>
<ButtonLink to="/">
<EmojiText emoji="🏚" label="broken home">
Head Home
</EmojiText>
</ButtonLink>
</div>
</Container>
</Layout>
<Container>
<div className={clsx('prose')}>
<Heading level="h2">⛔️ Whoops!</Heading>
<Typography>
We seem to have run into an error. We are working on fixing it now.
</Typography>
<details className={clsx('mb-6')}>
<summary>Detailed error message</summary>
<pre className={clsx('whitespace-pre-line')}>{body}</pre>
</details>
<ButtonLink to="/">
<EmojiText emoji="🏚" label="broken home">
Head Home
</EmojiText>
</ButtonLink>
</div>
</Container>
</Document>
)
}
Loading

0 comments on commit d3323e2

Please sign in to comment.