-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* style(Icon): 가운데 정렬 추가 * style(FourthPage): 제목 줄바꿈 방지 설정 추가 * feat(LandingPage): TopButton 추가 --------- Co-authored-by: 손진영 <[email protected]>
- Loading branch information
1 parent
c8102c1
commit b220ad8
Showing
5 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
frontend/src/components/common/TopButton/TopButton.styled.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters