-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
6 changed files
with
138 additions
and
17 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
components/diaries/edit/diary-edit-share/diary-edit-share.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,63 @@ | ||
.storyshareContainer { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding: 30px 24px; | ||
margin-bottom: 30px; | ||
} | ||
|
||
.storyshare { | ||
display: flex; | ||
align-items: center; | ||
gap: 5px; | ||
font-size: 14px; | ||
font-weight: 700; | ||
color: var(--text-color-gray); | ||
border-left: 2px solid var(--text-color-gray); | ||
padding-left: 10px; | ||
} | ||
|
||
.toggle { | ||
position: relative; | ||
display: inline-block; | ||
width: 37.69px; | ||
height: 20px; | ||
} | ||
|
||
.toggle input { | ||
opacity: 0; | ||
width: 0; | ||
height: 0; | ||
} | ||
|
||
.toggleSlide { | ||
position: absolute; | ||
cursor: pointer; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
background-color: var(--disabled-color); | ||
transition: 0.4s; | ||
border-radius: 27px; | ||
} | ||
|
||
.toggleSlide:before { | ||
position: absolute; | ||
content: ''; | ||
height: 16.92px; | ||
width: 16.92px; | ||
left: 2px; | ||
bottom: 1.54px; | ||
background-color: white; | ||
transition: 0.4s; | ||
border-radius: 50%; | ||
} | ||
|
||
input:checked + .toggleSlide { | ||
background-color: var(--main-color); | ||
} | ||
|
||
input:checked + .toggleSlide:before { | ||
transform: translateX(16.92px); | ||
} |
17 changes: 17 additions & 0 deletions
17
components/diaries/edit/diary-edit-share/diary-edit-share.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,17 @@ | ||
import React from 'react'; | ||
import styles from './diary-edit-share.module.scss'; | ||
import { useFormContext } from 'react-hook-form'; | ||
|
||
export default function DiaryEditShare() { | ||
const { register } = useFormContext(); | ||
|
||
return ( | ||
<div className={styles.storyshareContainer}> | ||
<div className={styles.storyshare}>스토리에 공유하기</div> | ||
<label className={styles.toggle}> | ||
<input type="checkbox" {...register('isShare')} /> | ||
<span className={styles.toggleSlide}></span> | ||
</label> | ||
</div> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.button { | ||
margin: 0 24px; | ||
height: 46px; | ||
} |
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