-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0345210
commit a7c49ac
Showing
21 changed files
with
890 additions
and
20 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
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
41 changes: 41 additions & 0 deletions
41
src/components/MyReview/EditReviewBottomSlide/DateBottomSlide/DateBottomSlide.module.scss
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,41 @@ | ||
@use "@/sass" as *; | ||
|
||
.slideContainer { | ||
position: fixed; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
|
||
width: 100%; | ||
height: 150%; | ||
|
||
background-color: rgba(20, 20, 20, 0.8); | ||
z-index: 3; | ||
|
||
visibility: visible; | ||
transition: all 0.2s ease-out; | ||
} | ||
|
||
.slide { | ||
display: flex; | ||
justify-content: center; | ||
z-index: 10; | ||
max-height: 80rem; | ||
|
||
&__content { | ||
border: 1px solid black; | ||
width: 100%; | ||
height: 26rem; | ||
overflow: scroll; | ||
background-color: $neutral0; | ||
padding: 24px 24px 40px 24px; | ||
display: flex; | ||
flex-direction: column; | ||
|
||
position: relative; | ||
|
||
&::-webkit-scrollbar { | ||
display: none; | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/components/MyReview/EditReviewBottomSlide/DateBottomSlide/DateBottomSlide.tsx
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,27 @@ | ||
import { Slide } from "@chakra-ui/react"; | ||
|
||
import styles from "./DateBottomSlide.module.scss"; | ||
|
||
import { BottomSlideProps } from "@/types/bottomSlide"; | ||
|
||
function DateBottomSlide({ isOpen, onClose, children }: BottomSlideProps) { | ||
return ( | ||
<> | ||
<div | ||
className={styles.slideContainer} | ||
style={{ | ||
visibility: isOpen ? "visible" : "hidden", | ||
}} | ||
onClick={() => { | ||
document.body.style.removeProperty("overflow"); | ||
onClose(); | ||
}} | ||
></div> | ||
<Slide className={styles.slide} direction="bottom" in={isOpen}> | ||
<div className={styles.slide__content}>{children}</div> | ||
</Slide> | ||
</> | ||
); | ||
} | ||
|
||
export default DateBottomSlide; |
26 changes: 26 additions & 0 deletions
26
src/components/MyReview/EditReviewBottomSlide/DateScrollPicker/DateScrollPicker.module.scss
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 @@ | ||
@use "@/sass" as *; | ||
|
||
.datePickerWrapper { | ||
width: 100%; | ||
max-width: 45rem; | ||
height: 100%; | ||
|
||
position: fixed; | ||
|
||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
|
||
z-index: 2; | ||
|
||
transition: all 1s; | ||
} | ||
|
||
.background { | ||
position: absolute; | ||
top: 0; | ||
width: 100%; | ||
height: 100vh; | ||
background-color: rgba(20, 20, 20, 0.8); | ||
z-index: 1; | ||
} |
64 changes: 64 additions & 0 deletions
64
src/components/MyReview/EditReviewBottomSlide/DateScrollPicker/DateScrollPicker.tsx
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,64 @@ | ||
import DatePicker from 'react-mobile-datepicker'; | ||
|
||
import {DateScrollPickerProps} from '@/types/detail'; | ||
|
||
interface DateConfig { | ||
year: { | ||
format: string; | ||
caption: string; | ||
step: number; | ||
}; | ||
month: { | ||
format: string; | ||
caption: string; | ||
step: number; | ||
}; | ||
} | ||
function DateScrollPicker({time, setTime, isValued, setIsValued, slideOnClose}: DateScrollPickerProps) { | ||
const handleCancel = () => { | ||
slideOnClose(); | ||
// setIsOpen(false); | ||
}; | ||
|
||
const handleSelect = (time: Date) => { | ||
if (!isValued) { | ||
setIsValued(true); | ||
} | ||
setTime(time); | ||
slideOnClose(); | ||
}; | ||
|
||
const dateConfig: DateConfig = { | ||
year: { | ||
format: 'YYYY', | ||
caption: 'Year', | ||
step: 1, | ||
}, | ||
month: { | ||
format: 'MM', | ||
caption: 'Mon', | ||
step: 1, | ||
}, | ||
}; | ||
|
||
return ( | ||
<> | ||
<DatePicker | ||
dateConfig={dateConfig} | ||
theme={'ios'} | ||
value={time} | ||
min={new Date(1999, 0, 1)} | ||
max={new Date()} | ||
onSelect={handleSelect} | ||
onCancel={handleCancel} | ||
isPopup={false} | ||
headerFormat={'YYYY년 MM월'} | ||
showHeader={false} | ||
confirmText='선택' | ||
cancelText='취소' | ||
/> | ||
</> | ||
); | ||
} | ||
|
||
export default DateScrollPicker; |
45 changes: 45 additions & 0 deletions
45
src/components/MyReview/EditReviewBottomSlide/DateWrapper/DateWrapper.module.scss
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,45 @@ | ||
@use "@/sass" as *; | ||
|
||
.container { | ||
margin-top: 32px; | ||
padding: 20px 16px; | ||
border: 1px solid $neutral200; | ||
border-radius: 8px; | ||
|
||
width: 100%; | ||
|
||
cursor: pointer; | ||
&__dateWrapper { | ||
@include typography(tabLabel); | ||
color: $neutral900; | ||
|
||
display: flex; | ||
align-items: center; | ||
gap: 8px; | ||
} | ||
} | ||
|
||
.datePickerWrapper { | ||
width: 100%; | ||
max-width: 45rem; | ||
height: 100%; | ||
|
||
position: fixed; | ||
|
||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
|
||
z-index: 2; | ||
|
||
transition: all 1s; | ||
} | ||
|
||
.background { | ||
position: absolute; | ||
top: 0; | ||
width: 100%; | ||
height: 100vh; | ||
background-color: rgba(20, 20, 20, 0.8); | ||
z-index: 1; | ||
} |
33 changes: 33 additions & 0 deletions
33
src/components/MyReview/EditReviewBottomSlide/DateWrapper/DateWrapper.tsx
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,33 @@ | ||
import {RiCalendarCheckLine} from 'react-icons/ri'; | ||
|
||
import styles from './DateWrapper.module.scss'; | ||
|
||
interface DateWrapperProps { | ||
onOpen?: () => void; | ||
time: Date; | ||
isValued: boolean; | ||
} | ||
|
||
function DateWrapper({onOpen, time, isValued}: DateWrapperProps) { | ||
return ( | ||
<> | ||
<div className={styles.container} onClick={onOpen}> | ||
<div className={styles.container__dateWrapper}> | ||
{isValued ? ( | ||
<> | ||
<RiCalendarCheckLine fontSize='2.4rem' /> | ||
<span>{`${time.getFullYear()}년 ${time.getMonth() + 1}월 방문`}</span> | ||
</> | ||
) : ( | ||
<> | ||
<RiCalendarCheckLine fontSize='2.4rem' color='#CDCFD0' /> | ||
<span style={{color: '#CDCFD0'}}>언제 방문하셨나요?</span> | ||
</> | ||
)} | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
export default DateWrapper; |
Oops, something went wrong.