Skip to content

Commit

Permalink
add global styles to layout head
Browse files Browse the repository at this point in the history
  • Loading branch information
ccatherinetan committed Nov 26, 2024
1 parent d744c2c commit 69e4558
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import StyledComponentsRegistry from '@/lib/registry';
import { GlobalStyle } from '@/styles/globalStyles';
import ProfileProvider from '@/utils/ProfileProvider';
import { AuthProvider } from '../utils/AuthProvider';

Expand All @@ -12,8 +13,9 @@ const sans = Inter({

// site metadata - what shows up on embeds
export const metadata: Metadata = {
title: 'Project Name',
description: 'Description of project',
title: 'Trap Garden',
description:
'A web app to assist individuals, schools, and small organizations in establishing and maintaining their own gardens.',
};

export default function RootLayout({
Expand All @@ -23,6 +25,9 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<head>
<GlobalStyle />
</head>
<body className={sans.className}>
<AuthProvider>
<ProfileProvider>
Expand Down
24 changes: 24 additions & 0 deletions styles/globalStyles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use client';

import { createGlobalStyle } from 'styled-components';

export const GlobalStyle = createGlobalStyle`
body {
margin: 0;
padding: 0;
box-sizing: border-box;
}
`;

export default function GlobalStyleWrapper({
children,
}: {
children: React.ReactNode;
}) {
return (
<>
<GlobalStyle />
{children}
</>
);
}

0 comments on commit 69e4558

Please sign in to comment.