From f7b036fda0b217ec6baab3f879674ff46bd68844 Mon Sep 17 00:00:00 2001 From: Edwin Hernandez Date: Sun, 11 Feb 2024 15:41:48 -0600 Subject: [PATCH] refactor: add favicon.ico, global types, and layout component*** (#3) ***Update next.config.mjs and tsconfig.json*** ***Add global CSS styles --- next.config.mjs | 2 +- {src/app => public}/favicon.ico | Bin src/app/{ => (main)}/layout.tsx | 10 +++------- src/app/{ => (main)}/page.tsx | 0 src/{app => styles}/globals.css | 7 +------ src/types/index.d.ts | 7 +++++++ tsconfig.json | 10 ++-------- 7 files changed, 14 insertions(+), 22 deletions(-) rename {src/app => public}/favicon.ico (100%) rename src/app/{ => (main)}/layout.tsx (69%) rename src/app/{ => (main)}/page.tsx (100%) rename src/{app => styles}/globals.css (75%) create mode 100644 src/types/index.d.ts diff --git a/next.config.mjs b/next.config.mjs index bbde6fb..d5456a1 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,6 +1,6 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - reactStrictMode: true, + reactStrictMode: true, }; export default nextConfig; diff --git a/src/app/favicon.ico b/public/favicon.ico similarity index 100% rename from src/app/favicon.ico rename to public/favicon.ico diff --git a/src/app/layout.tsx b/src/app/(main)/layout.tsx similarity index 69% rename from src/app/layout.tsx rename to src/app/(main)/layout.tsx index a6df8d5..22a5e91 100644 --- a/src/app/layout.tsx +++ b/src/app/(main)/layout.tsx @@ -1,4 +1,4 @@ -import './globals.css'; +import '@/styles/globals.css'; import type { Metadata } from 'next'; import { Inter } from 'next/font/google'; @@ -10,13 +10,9 @@ export const metadata: Metadata = { description: 'Generated by create next app', }; -export default function RootLayout({ - children, -}: Readonly<{ - children: React.ReactNode; -}>) { +export default function RootLayout({ children }: ChildProps) { return ( - + {children} ); diff --git a/src/app/page.tsx b/src/app/(main)/page.tsx similarity index 100% rename from src/app/page.tsx rename to src/app/(main)/page.tsx diff --git a/src/app/globals.css b/src/styles/globals.css similarity index 75% rename from src/app/globals.css rename to src/styles/globals.css index 875c01e..a0d367b 100644 --- a/src/app/globals.css +++ b/src/styles/globals.css @@ -18,12 +18,7 @@ body { color: rgb(var(--foreground-rgb)); - background: linear-gradient( - to bottom, - transparent, - rgb(var(--background-end-rgb)) - ) - rgb(var(--background-start-rgb)); + background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb)); } @layer utilities { diff --git a/src/types/index.d.ts b/src/types/index.d.ts new file mode 100644 index 0000000..3bac874 --- /dev/null +++ b/src/types/index.d.ts @@ -0,0 +1,7 @@ +declare global { + export type ChildProps = Readonly<{ + children: React.ReactNode; + }>; +} + +export {}; diff --git a/tsconfig.json b/tsconfig.json index 7b28589..49e4cf3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,14 +12,8 @@ "isolatedModules": true, "jsx": "preserve", "incremental": true, - "plugins": [ - { - "name": "next" - } - ], - "paths": { - "@/*": ["./src/*"] - } + "plugins": [{ "name": "next" }], + "paths": { "@/*": ["./src/*"] } }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "exclude": ["node_modules"]