Skip to content

Commit eaf2b06

Browse files
authored
Merge pull request #97 from cskime/feature/#92
[#92] Header logo를 클릭했을 때 메인 페이지로 이동
2 parents d42b282 + 6fded8f commit eaf2b06

File tree

3 files changed

+32
-14
lines changed

3 files changed

+32
-14
lines changed

src/components/header/header.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Link } from "react-router";
12
import styled from "styled-components";
23
import logoImage from "../../assets/logo.svg";
34
import { media } from "../../utils/media";
@@ -27,7 +28,9 @@ function Header({ className, children }) {
2728
return (
2829
<StyledHeader className={className}>
2930
<HeaderContent>
30-
<img src={logoImage} alt="로고" />
31+
<Link to="/">
32+
<img src={logoImage} alt="로고" />
33+
</Link>
3134
<div>{children}</div>
3235
</HeaderContent>
3336
</StyledHeader>

src/layouts/onboarding-layout.jsx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,40 @@
11
import { useNavigate } from "react-router";
2+
import styled from "styled-components";
23
import { OutlinedButton } from "../components/button/button";
34
import BUTTON_SIZE from "../components/button/button-size";
45
import Header from "../components/header/header";
56

7+
const LayoutHeader = styled(Header)`
8+
flex-shrink: 0;
9+
`;
10+
11+
const Main = styled.main`
12+
flex-grow: 1;
13+
min-height: 100vh - 64px;
14+
`;
15+
16+
const StyledOnbardingLayout = styled.div`
17+
display: flex;
18+
flex-direction: column;
19+
height: 100vh;
20+
`;
21+
622
function OnboardingLayout({ children }) {
723
const navigate = useNavigate();
824

925
const handlePostCreate = () => navigate("/post");
1026

1127
return (
12-
<>
13-
<Header>
28+
<StyledOnbardingLayout>
29+
<LayoutHeader>
1430
<OutlinedButton
1531
size={BUTTON_SIZE.medium}
1632
title="롤링 페이퍼 만들기"
1733
onClick={handlePostCreate}
1834
/>
19-
</Header>
20-
<main>{children}</main>
21-
</>
35+
</LayoutHeader>
36+
<Main>{children}</Main>
37+
</StyledOnbardingLayout>
2238
);
2339
}
2440

src/pages/rolling-paper-list-page.jsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
import { PrimaryButton } from "../components/button/button";
2-
import BUTTON_SIZE from "../components/button/button-size";
3-
import React, { useEffect, useState, useMemo } from "react";
1+
import { useEffect, useMemo, useState } from "react";
42
import { useNavigate } from "react-router";
53
import styled from "styled-components";
4+
import { apiClient } from "../api/client";
5+
import { PrimaryButton } from "../components/button/button";
6+
import BUTTON_SIZE from "../components/button/button-size";
67
import RollingPaperList from "../features/rolling-paper/components/rolling-paper-list";
7-
import { media } from "../utils/media";
88
import { useMedia } from "../hooks/use-media";
9-
import { apiClient } from "../api/client";
9+
import { media } from "../utils/media";
1010

1111
const TopContainer = styled.div`
1212
text-align: center;
1313
margin-top: 50px;
14-
min-height: calc(100vh - 64px);
1514
display: flex;
1615
flex-direction: column;
1716
`;
@@ -72,7 +71,7 @@ function getCachedImage(url) {
7271
return cache[url].src;
7372
}
7473

75-
function ShowMessageList() {
74+
function RollingPaperListPage() {
7675
const navigate = useNavigate();
7776

7877
const [recipientsData, setRecipientsData] = useState([]);
@@ -188,4 +187,4 @@ function ShowMessageList() {
188187
);
189188
}
190189

191-
export default ShowMessageList;
190+
export default RollingPaperListPage;

0 commit comments

Comments
 (0)