Skip to content

Commit 4f84a80

Browse files
committed
add about page
1 parent d6b868f commit 4f84a80

File tree

2 files changed

+96
-12
lines changed

2 files changed

+96
-12
lines changed

src/components/layout.tsx

Lines changed: 56 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,47 @@ const Container = styled.div<{ $isMain: boolean }>`
1212
header {
1313
padding: 16px 0 24px;
1414
color: gray;
15-
font-weight: 700;
1615
17-
h1,
18-
a {
19-
margin: 0;
20-
}
16+
${Inner} > div {
17+
display: flex;
18+
align-items: center;
19+
justify-content: space-between;
20+
21+
h1,
22+
a {
23+
margin: 0;
24+
}
25+
26+
a {
27+
color: #333333;
28+
text-decoration: none;
29+
}
30+
31+
h1 > a {
32+
font-weight: 700;
33+
font-size: ${({ $isMain }) => ($isMain ? '32px' : '18px')};
34+
}
2135
22-
a {
23-
font-size: ${({ $isMain }) => ($isMain ? '32px' : '18px')};
24-
color: #333333;
25-
text-decoration: none;
36+
nav {
37+
ul {
38+
all: unset;
39+
display: flex;
40+
gap: 12px;
41+
42+
li {
43+
all: unset;
44+
font-size: 1.125rem;
45+
46+
@media (max-width: 680px) {
47+
font-size: 1.5rem;
48+
}
49+
50+
&.selected {
51+
font-weight: 700;
52+
}
53+
}
54+
}
55+
}
2656
}
2757
2858
@media (max-width: 680px) {
@@ -35,16 +65,30 @@ const Container = styled.div<{ $isMain: boolean }>`
3565
}
3666
`;
3767

68+
const isBrowser = typeof window !== 'undefined';
69+
3870
function Layout({ pageTitle, children }: { pageTitle?: string; children: ReactNode }) {
3971
return (
4072
<Container $isMain={!pageTitle}>
4173
<GlobalStyle />
4274
<title>{pageTitle}</title>
4375
<header>
4476
<Inner>
45-
<h1>
46-
<Link to='/'>pyjun01</Link>
47-
</h1>
77+
<div>
78+
<h1>
79+
<Link to='/'>pyjun01</Link>
80+
</h1>
81+
<nav>
82+
<ul>
83+
<li className={isBrowser && window.location.pathname === '/' ? 'selected' : undefined}>
84+
<Link to='/'>Home</Link>
85+
</li>
86+
<li className={isBrowser && window.location.pathname === '/about/' ? 'selected' : undefined}>
87+
<Link to='/about'>About</Link>
88+
</li>
89+
</ul>
90+
</nav>
91+
</div>
4892
</Inner>
4993
</header>
5094
<main>

src/pages/about.tsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { Helmet } from 'react-helmet';
2+
3+
import { usePostList } from '../hooks/post';
4+
import Layout from '../components/layout';
5+
import List from '../components/List';
6+
7+
function IndexPage() {
8+
const data = usePostList();
9+
10+
return (
11+
<Layout>
12+
<Helmet
13+
htmlAttributes={{
14+
dir: 'ltr',
15+
lang: 'ko',
16+
}}
17+
title='개발자 박용준'
18+
>
19+
<meta property='og:title' content='개발자 박용준' />
20+
<meta property='og:url' content='https://pyjun01.github.io/about' />
21+
<meta name='description' content='About' />
22+
</Helmet>
23+
<div>
24+
<a href='https://www.facebook.com/profile.php?id=100007085719197' target='_blank'>
25+
<img src='https://img.shields.io/badge/facebook-1877f2?style=flat-square&logo=facebook&logoColor=white' />
26+
</a>
27+
<a href='https://github.com/pyjun01' target='_blank'>
28+
<img src='https://img.shields.io/badge/GitHub-181717?style=flat-square&logo=GitHub&logoColor=white' />
29+
</a>
30+
<a href='https://www.linkedin.com/in/pyjun01/' target='_blank'>
31+
<img src='https://img.shields.io/badge/LinkedIn-0077B5?style=flat-square&logo=linkedin&logoColor=white' />
32+
</a>
33+
<img src='https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fpyjun01.github.io/about&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false' />
34+
</div>
35+
준비중...
36+
</Layout>
37+
);
38+
}
39+
40+
export default IndexPage;

0 commit comments

Comments
 (0)