Skip to content

Commit

Permalink
DRY up usages of <Layout>
Browse files Browse the repository at this point in the history
  • Loading branch information
setsun committed Jun 30, 2023
1 parent bf87b43 commit 112a1c2
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 39 deletions.
7 changes: 6 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Analytics } from '@vercel/analytics/react';
import { AppProps } from 'next/app';
import { ThemeProvider, DefaultTheme } from 'styled-components'
import GlobalStyle from '../components/GlobalStyle';
import Layout from '../components/Layout';

const theme: DefaultTheme = {
colors: {
Expand All @@ -15,7 +16,11 @@ const App = ({ Component, pageProps }: AppProps) => {
return (
<ThemeProvider theme={theme}>
<GlobalStyle />
<Component {...pageProps} />

<Layout>
<Component {...pageProps} />
</Layout>

<Analytics />
</ThemeProvider>
);
Expand Down
4 changes: 0 additions & 4 deletions pages/games/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import Layout from "../../components/Layout"

interface Props { }

const Games: React.FC<Props> = (props) => {
return (
<Layout>
<div className="h-screen text-3xl flex justify-center items-center">
🚧 🚧 🚧
</div>
</Layout>
);
}

Expand Down
18 changes: 8 additions & 10 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@ interface Props {}

const Index: React.FC<Props> = (props) => {
return (
<Layout>
<Canvas
className="w-full aspect-video"
camera={{
position: [0, 0, -30]
}}
>
<WireframePlanet />
</Canvas>
</Layout>
<Canvas
className="w-full aspect-video"
camera={{
position: [0, 0, -30]
}}
>
<WireframePlanet />
</Canvas>
)
}

Expand Down
3 changes: 0 additions & 3 deletions pages/now-playing/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import Layout from "../../components/Layout"
import SpotifyIframePlaylist from "../../components/SpotifyIframePlaylist";

interface Props { }

const NowPlaying: React.FC<Props> = (props) => {
return (
<Layout>
<div className="grid grid-cols-3 gap-4">
<SpotifyIframePlaylist src="https://open.spotify.com/embed/playlist/1bUUPhe0zP9FgrsqYjxbTp?theme=0" />
<SpotifyIframePlaylist src="https://open.spotify.com/embed/playlist/1cUbQxIOFcxeL5oUheu85i?theme=0" />
Expand All @@ -14,7 +12,6 @@ const NowPlaying: React.FC<Props> = (props) => {
<SpotifyIframePlaylist src="https://open.spotify.com/embed/playlist/1aQK4Hz4Xmz3Y4NEhz9ReT?theme=0" />
<SpotifyIframePlaylist src="https://open.spotify.com/embed/playlist/26ItkYptyl56YEIYQDQs7r?theme=0" />
</div>
</Layout>
);
}

Expand Down
10 changes: 3 additions & 7 deletions pages/photos/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import Layout from "../../components/Layout"

interface Props { }

const Photos: React.FC<Props> = (props) => {
return (
<Layout>
<div className="h-screen text-3xl flex justify-center items-center">
🚧 🚧 🚧
</div>
</Layout>
<div className="h-screen text-3xl flex justify-center items-center">
🚧 🚧 🚧
</div>
);
}

Expand Down
10 changes: 3 additions & 7 deletions pages/visualizers/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import Layout from "../../components/Layout"

interface Props { }

const Visualizers: React.FC<Props> = (props) => {
return (
<Layout>
<div className="h-screen text-3xl flex justify-center items-center">
🚧 🚧 🚧
</div>
</Layout>
<div className="h-screen text-3xl flex justify-center items-center">
🚧 🚧 🚧
</div>
);
}

Expand Down
7 changes: 3 additions & 4 deletions pages/writing/[id].tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react"
import { GetServerSideProps } from "next"
import ReactMarkdown from "react-markdown"
import Layout from "../../components/Layout"
import { PostProps } from "../../components/Post"
import prisma from "../../lib/prisma";

Expand Down Expand Up @@ -29,7 +28,7 @@ const Post: React.FC<PostProps> = (props) => {
}

return (
<Layout>
<>
<div>
<h2>{title}</h2>
<p>By {props?.author?.name || "Unknown author"}</p>
Expand Down Expand Up @@ -58,8 +57,8 @@ const Post: React.FC<PostProps> = (props) => {
margin-left: 1rem;
}
`}</style>
</Layout>
</>
)
}

export default Post
export default Post;
5 changes: 2 additions & 3 deletions pages/writing/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react"
import { GetStaticProps } from "next"
import Layout from "../../components/Layout"
import Post, { PostProps } from "../../components/Post"
import prisma from "../../lib/prisma";

Expand All @@ -26,12 +25,12 @@ type Props = {

const Blog: React.FC<Props> = (props) => {
return (
<Layout>
<div>
<h2 className="underline mb-2">Recent Posts</h2>
{props.feed.map((post, i) => (
<Post key={i} post={post} />
))}
</Layout>
</div>
);
}

Expand Down

1 comment on commit 112a1c2

@vercel
Copy link

@vercel vercel bot commented on 112a1c2 Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

setsun-xyz – ./

www.setsun.xyz
setsun-xyz-setsun.vercel.app
setsun-xyz-git-main-setsun.vercel.app
setsun.xyz

Please sign in to comment.