Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat/#363] Intro 페이지 추가 #364

Merged
merged 3 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added src/assets/images/intro.png
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5) 역시 우리 리드야~ 벌써 pr을 올리잖아~ 하고 들어왔다가 깜짝아!

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions src/components/commons/loading/Loading.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { lazy } from "react";
import * as S from "./Loading.styled";

const LoadingAnimation = lazy(() => import("@components/commons/loading/LoadingAnimation"));
import LoadingAnimation from "./LoadingAnimation";

Comment on lines 1 to +2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5) 이거 이렇게 바꾼 이유가 궁금합니다!!🫣🫢😦

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5) 저도 궁금합니다 ! 아마 처음엔 초기 로딩 성능을 최적화하려고 동적 import를 한 것 같은데, 오히려 LoadingAnimation 이 늦게 import 되는 단점 같은 게 발생했던건가요..?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

맞아요! 예전에 Next.js를 했을 때 애니메이션을 저 방식으로 lazy import 해왔는데!
지금 리액트에서 저렇게 사용하려고 하니까,,, 렌더링 될 때 오류가 발생하더라구요! 그래서 일단 지워줬습니다!

const Loading = () => {
return (
Expand Down
16 changes: 16 additions & 0 deletions src/pages/intro/Intro.styled.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import styled from "styled-components";

export const StyledIntroImg = styled.img`
width: 37.5rem;
min-height: 100vh;
`;

export const FooterContainer = styled.div`
position: relative;

/* 구분선 없애기 위해서 조금 올려주었습니다. */
bottom: 0.2rem;
padding: 1.6rem 2.4rem 4rem;

background-color: ${({ theme }) => theme.colors.black};
`;
24 changes: 24 additions & 0 deletions src/pages/intro/Intro.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import * as S from "./Intro.styled";
import IntroImg from "../../../src/assets/images/intro.png";
import { Button } from "@components/commons";
import { useNavigate } from "react-router-dom";

const Intro = () => {
const navigate = useNavigate();

const handleClick = () => {
navigate("/main");
};

return (
<>
<S.StyledIntroImg src={IntroImg} />

<S.FooterContainer>
<Button onClick={handleClick}>BEAT 바로가기</Button>
</S.FooterContainer>
</>
);
};

export default Intro;
2 changes: 2 additions & 0 deletions src/routes/Router.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Layout from "@components/layout/Layout";
import Intro from "@pages/intro/Intro";
import KakaoAuth from "@pages/kakaoAuth/KakaoAuth";
import Main from "@pages/main/Main";
import NotFound from "@pages/notFound/NotFound";
Expand All @@ -16,6 +17,7 @@ const router = createBrowserRouter([
</>
),
},
{ path: "/intro", element: <Intro /> },
{
path: "/",
element: <Layout />,
Expand Down
Loading