Skip to content

Commit

Permalink
refactor: detach Title component from Header component
Browse files Browse the repository at this point in the history
  • Loading branch information
lumirlumir committed Sep 16, 2024
1 parent bb31a6e commit 4ce4f06
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
6 changes: 5 additions & 1 deletion src/app/layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import Main from '@/components/layouts/Main';
import Categories from '@/components/aside/Categories';
import Home from '@/components/aside/Home';

import Title from '@/components/header/Title';

// TODO: import '@/styles/global.scss';

// TODO: export const metadata = {
Expand All @@ -20,7 +22,9 @@ export default function RootLayout({ children }) {
return (
<html lang="ko">
<Body>
<Header />
<Header>
<Title />
</Header>
<Aside>
<Home />
<Categories />
Expand Down
7 changes: 7 additions & 0 deletions src/components/header/Title/Title.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Link from 'next/link';

import { USER } from '@/constants/github';

export default function Title() {
return <Link href={USER.htmlUrl}>{USER.name}</Link>;
}
3 changes: 3 additions & 0 deletions src/components/header/Title/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Title from './Title';

export default Title;
10 changes: 2 additions & 8 deletions src/components/layouts/Header/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { USER } from '@/constants/github';

import styles from './Header.module.scss';

export default function Header() {
return (
<header className={styles.header}>
<a href={USER.htmlUrl}>{USER.name}</a>
</header>
);
export default function Header({ children }) {
return <header className={styles.header}>{children}</header>;
}

0 comments on commit 4ce4f06

Please sign in to comment.