-
Notifications
You must be signed in to change notification settings - Fork 3
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/#84] 회원/비회원 예매 페이지 추가 #105
Changes from all commits
1e40601
56035c3
6235615
eecd1e1
7c92593
5cb0293
3d8d721
9e16aaf
14fc759
02980c3
784aa71
7a09ba9
7f37f76
0616c02
cd76a33
c92f8a1
666b1b0
14bca57
946a4c2
eb4e2a0
fd28f49
d8b028b
30a7a05
03ccfe2
0328f2c
160b257
4aae43a
7b89767
fac7645
b5c86b2
61a8138
1470b6b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,22 @@ import styled from "styled-components"; | |
|
||
import { IcomCopy } from "@assets/svgs"; | ||
|
||
export const ActionBottomSheetWrapper = styled.section` | ||
export const ActionBottomSheetWrapper = styled.section<{ $isOpen: boolean }>` | ||
position: fixed; | ||
top: 0; | ||
bottom: 0; | ||
left: auto; | ||
z-index: 30; | ||
display: flex; | ||
justify-content: center; | ||
width: 100%; | ||
height: 100%; | ||
|
||
background-color: rgb(0 0 0 / 50%); | ||
visibility: ${({ $isOpen }) => ($isOpen ? "visible" : "hidden")}; | ||
opacity: ${({ $isOpen }) => ($isOpen ? 1 : 0)}; | ||
|
||
transition: | ||
opacity 250ms ease-in-out, | ||
visibility 250ms ease-in-out; | ||
Comment on lines
+14
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. p5) visibility 라는 속성을 처음 알았는데 굉장히 유용하네요! 눈에는 안 보여도 공간을 차지할 수 있다는 점이 활용도가 높은 것 같아요. display: block | none 만 사용했는데, 나중에 저도 활용해볼게요 ! transition으로 부드러운 css 효과 지정한다음 부드럽게 사라지게 만든 것도 좋습니다~ 센스 굿굿 👍 |
||
`; | ||
|
||
export const SubTitle = styled.h2` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,18 +5,20 @@ import OuterLayout from "@components/commons/bottomSheet/OuterLayout"; | |
import ContextBox from "@components/commons/contextBox/ContextBox"; | ||
import { ContextBoxStyle } from "@typings/contextBoxProps"; | ||
|
||
import React, { ReactNode, Children, isValidElement } from "react"; | ||
import React, { Children, isValidElement, ReactNode, useEffect } from "react"; | ||
|
||
interface ActionBottomSheetProps | ||
extends React.ButtonHTMLAttributes<HTMLButtonElement>, | ||
ContextBoxStyle { | ||
isOpen: boolean; | ||
title?: string; | ||
subTitle?: string; | ||
children?: ReactNode; | ||
onClickOutside: () => void; | ||
} | ||
|
||
const ActionBottomSheet = ({ | ||
isOpen, | ||
title, | ||
subTitle, | ||
onClickOutside, | ||
|
@@ -37,9 +39,20 @@ const ActionBottomSheet = ({ | |
onClickOutside(); | ||
}; | ||
|
||
useEffect(() => { | ||
if (isOpen) { | ||
document.body.style.overflow = "hidden"; | ||
} else { | ||
document.body.style.overflow = "auto"; | ||
} | ||
return () => { | ||
document.body.style.overflow = "auto"; | ||
}; | ||
}, [isOpen]); | ||
Comment on lines
+42
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. p5) 저도 예전에 스크롤 방지하는 코드를 작성했어야 했는데, 도영님 코드 보고 궁금해서 좀 더 찾아봤어요! 다른 요소들은 그 크기를 넘어서는 순간 overflow가 되는거고, 스크롤바가 생기는 것이 기본인데 그 지식을 활용해서 애초에 document.body.style.overflow = "hidden" 으로 만들어서 스크롤이 생기지 않게 만들고, |
||
|
||
return ( | ||
<S.ActionBottomSheetWrapper onClick={handleWrapperClick}> | ||
<BottomSheet title={title}> | ||
<S.ActionBottomSheetWrapper $isOpen={isOpen} onClick={handleWrapperClick}> | ||
<BottomSheet isOpen={isOpen} title={title}> | ||
<ContextBox {...rest}> | ||
<S.SubTitle>{subTitle}</S.SubTitle> | ||
{innerChildren} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import styled from "styled-components"; | ||
|
||
export const ContentWrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
padding: 0 2.4rem; | ||
`; | ||
|
||
export const Divider = styled.div` | ||
width: 375px; | ||
height: 8px; | ||
margin-top: 1.6rem; | ||
|
||
background: ${({ theme }) => theme.colors.gray_800}; | ||
opacity: 0.6; | ||
border: 1px s; | ||
`; | ||
|
||
export const FooterContainer = styled.div` | ||
position: sticky; | ||
bottom: 0; | ||
padding: 2.4rem; | ||
|
||
background-color: ${({ theme }) => theme.colors.gray_900}; | ||
`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p5) css 에서 @Keyframe 으로 정의하던 애니메이션을 styled-components에서는 keyframe 이라는 템플릿 리터럴 함수를 사용해서 정의하는군요! 하나 배워 갑니다 !!