Skip to content

Commit

Permalink
feat: CommonLayout 컴포넌트 정의, Home 페이지 UI를 tailwind로 재구성
Browse files Browse the repository at this point in the history
  • Loading branch information
limgyumin committed Sep 10, 2023
1 parent f930e0e commit 5e27222
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 19 deletions.
20 changes: 6 additions & 14 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
import type { Metadata } from "next";
import { Titillium_Web } from "next/font/google";
import { Inter } from "next/font/google";

import type { PropsWithChildren } from "react";

import { Footer } from "components/shared/footer";
import { Header } from "components/shared/header";
import { CommonLayout } from "components/shared/common-layout";
import { Providers } from "components/shared/providers";

import "styles/main.css";
import "styles/ionicons.min.css";
import "styles/tailwind.css";

export const metadata: Metadata = {
title: "Real World",
description: "real world project",
};

const titillium = Titillium_Web({
const inter = Inter({
subsets: ["latin"],
weight: "400",
variable: "--titillium-web-font",
variable: "--font-sans",
});

const RootLayout = ({ children }: PropsWithChildren) => {
return (
<html lang="en" className={titillium.variable}>
<html lang="en" className={inter.variable}>
<Providers>
<body>
<Header />
{children}
<Footer />
</body>
<CommonLayout>{children}</CommonLayout>
</Providers>
</html>
);
Expand Down
10 changes: 5 additions & 5 deletions components/(home)/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { Banner } from "./banner";
import { Feed } from "./feed/feed";
import { Feed } from "./feed";
import { SideBar } from "./side-bar";

export const Home = () => {
return (
<div className="home-page">
<>
<Banner />

<div className="page container">
<div className="row">
<div className="flex justify-center">
<div className="page relative">
<Feed />
<SideBar />
</div>
</div>
</div>
</>
);
};
16 changes: 16 additions & 0 deletions components/shared/common-layout/common-layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { PropsWithChildren } from "react";

import { Footer } from "../footer";
import { Header } from "../header";

export const CommonLayout = ({ children }: PropsWithChildren) => {
return (
<body>
<div className="relative min-h-[100vh]">
<Header />
<div className="pb-14 pt-10">{children}</div>
<Footer />
</div>
</body>
);
};
1 change: 1 addition & 0 deletions components/shared/common-layout/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { CommonLayout } from "./common-layout";

0 comments on commit 5e27222

Please sign in to comment.