Skip to content

Commit

Permalink
[Fix] - 6차 데모데이 1차 QA(리버) (#581)
Browse files Browse the repository at this point in the history
* style(Icon): 가운데 정렬 추가

* style(FourthPage): 제목 줄바꿈 방지 설정 추가

* feat(LandingPage): TopButton 추가

---------

Co-authored-by: 손진영 <[email protected]>
  • Loading branch information
0jenn0 and jinyoung234 authored Oct 24, 2024
1 parent c8102c1 commit b220ad8
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/src/components/common/Icon/Icon.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import styled from "@emotion/styled";

export const Wrapper = styled.div<{ size: string }>`
display: flex;
justify-content: center;
align-items: center;
width: ${({ size }) => size}px;
height: ${({ size }) => size}px;
`;
26 changes: 26 additions & 0 deletions frontend/src/components/common/TopButton/TopButton.styled.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import styled from "@emotion/styled";

export const FloatingButtonContainer = styled.div`
display: flex;
flex-direction: column;
align-items: flex-end;
position: fixed;
right: max(0vw + 2rem, calc(50vw - 22rem));
bottom: 2rem;
z-index: ${({ theme }) => theme.zIndex.floating};
`;

export const MainButtonWrapper = styled.div`
display: flex;
justify-content: center;
align-items: center;
width: 6rem;
height: 6rem;
border-radius: 50%;
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
background-color: ${({ theme }) => theme.colors.primary};
cursor: pointer;
`;
29 changes: 29 additions & 0 deletions frontend/src/components/common/TopButton/TopButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import IconButton from "@components/common/IconButton/IconButton";

import { PRIMITIVE_COLORS } from "@styles/tokens";

import * as S from "./TopButton.styled";

const TopButton = () => {
const handleScrollTop = () => {
window.scrollTo({
top: 0,
left: 0,
behavior: "smooth",
});
};
return (
<S.FloatingButtonContainer onClick={handleScrollTop}>
<S.MainButtonWrapper>
<IconButton
iconType="up-arrow"
color={PRIMITIVE_COLORS.white}
size="20"
title="여행 계획 및 여행기 작성 메뉴"
/>
</S.MainButtonWrapper>
</S.FloatingButtonContainer>
);
};

export default TopButton;
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const largeText = css`

export const titleStyle = css`
text-align: center;
word-break: keep-all;
`;

export const subtitleStyle = css`
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/components/pages/landing/LandingPage.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import TopButton from "@components/common/TopButton/TopButton";

import FirstPage from "./FirstPage/FirstPage";
import FourthPage from "./FourthPage/FourthPage";
import * as S from "./LandingPage.styled";
Expand All @@ -20,6 +22,7 @@ const LandingPage = () => {
</S.PageWrapper>
<ThirdPage />
<FourthPage />
<TopButton />
</S.Layout>
);
};
Expand Down

0 comments on commit b220ad8

Please sign in to comment.