-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from TEAM-Hearus/develop
배포
- Loading branch information
Showing
21 changed files
with
730 additions
and
112 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
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
64 changes: 64 additions & 0 deletions
64
src/components/organisms/Alerts/confirmAlert/ConfirmAlert.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,64 @@ | ||
@import '../../../../styles/variables/colors.scss'; | ||
@import '../../../../styles/variables/fonts.scss'; | ||
|
||
.overlay { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background-color: rgba(0, 0, 0, 0.1); | ||
z-index: 10; | ||
} | ||
.container { | ||
width: 380px; | ||
background-color: white; | ||
border: 0; | ||
border-radius: 12px; | ||
padding: 30px 20px; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 30px; | ||
z-index: 20; | ||
} | ||
.title { | ||
padding-top: 10px; | ||
width: 300px; | ||
color: $dark-font_33; | ||
@include SemiBold_Title_28; | ||
text-align: center; | ||
} | ||
.message { | ||
color: $dark-font_33; | ||
@include SemiBold_Body_16; | ||
text-align: center; | ||
white-space: pre-wrap; | ||
} | ||
.btnBox { | ||
display: flex; | ||
gap: 10px; | ||
} | ||
.cancleBtn { | ||
width: 160px; | ||
height: 48px; | ||
border: 0; | ||
border-radius: 8px; | ||
background-color: $light-bg_F2; | ||
color: $dark-font_5A; | ||
@include SemiBold_Body_16; | ||
cursor: pointer; | ||
} | ||
.selectBtn { | ||
width: 160px; | ||
height: 48px; | ||
border: 0; | ||
border-radius: 8px; | ||
background-color: $brand-point; | ||
color: $white_FF; | ||
@include SemiBold_Body_16; | ||
cursor: pointer; | ||
} |
34 changes: 34 additions & 0 deletions
34
src/components/organisms/Alerts/confirmAlert/ConfirmAlert.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,34 @@ | ||
import styles from './ConfirmAlert.module.scss'; | ||
|
||
interface ConfirmAlertProps { | ||
title: string; | ||
message: string; | ||
buttonText: string; | ||
onConfirm: (result: boolean) => void; | ||
} | ||
|
||
const ConfirmAlert = ({ | ||
message, | ||
title, | ||
buttonText, | ||
onConfirm, | ||
}: ConfirmAlertProps) => { | ||
return ( | ||
<div className={styles.overlay}> | ||
<div className={styles.container}> | ||
<h2 className={styles.title}>{title}</h2> | ||
<p className={styles.message}>{message}</p> | ||
<div className={styles.btnBox}> | ||
<button className={styles.cancleBtn} onClick={() => onConfirm(false)}> | ||
취소 | ||
</button> | ||
<button className={styles.selectBtn} onClick={() => onConfirm(true)}> | ||
{buttonText} | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ConfirmAlert; |
64 changes: 64 additions & 0 deletions
64
src/components/organisms/Alerts/globalAlert/GlobalAlert.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,64 @@ | ||
@import '../../../../styles/variables/colors.scss'; | ||
@import '../../../../styles/variables/fonts.scss'; | ||
|
||
@keyframes slide-up { | ||
0% { | ||
transform: translateY(50%); | ||
opacity: 0; | ||
} | ||
100% { | ||
transform: translateY(0); | ||
opacity: 1; | ||
} | ||
} | ||
|
||
@keyframes slide-down { | ||
0% { | ||
transform: translateY(0); | ||
opacity: 1; | ||
} | ||
100% { | ||
transform: translateY(-30%); | ||
opacity: 0; | ||
} | ||
} | ||
|
||
.alertContainer { | ||
position: fixed; | ||
top: 10px; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
z-index: 40; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 5px; | ||
} | ||
|
||
.alert { | ||
animation: slide-up 0.5s ease-out forwards; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
color: $brand-point; | ||
background-color: $white_FF; | ||
border: 1px solid $brand-point; | ||
border-radius: 8px; | ||
width: 300px; | ||
height: 44px; | ||
cursor: pointer; | ||
word-break: break-all; | ||
white-space: pre-wrap; | ||
padding: 5px 15px; | ||
box-shadow: 0 3px 2px rgba(0, 0, 0, 0.2); | ||
} | ||
|
||
.alert.closing { | ||
animation: slide-down 0.5s ease; | ||
} | ||
|
||
.success { | ||
color: $dark-font_33; | ||
background-color: $white_FF; | ||
border: 1px solid $dark-font_33; | ||
} |
32 changes: 32 additions & 0 deletions
32
src/components/organisms/Alerts/globalAlert/GlobalAlert.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,32 @@ | ||
import { useAlert } from '../../../../contexts/AlertContext'; | ||
import { useState } from 'react'; | ||
import styles from './GlobalAlert.module.scss'; | ||
|
||
const AlertComponent = () => { | ||
const { alerts, removeAlert } = useAlert(); | ||
const [closingAlertIds, setClosingAlertIds] = useState<number[]>([]); | ||
|
||
const handleClose = (id: number) => { | ||
setClosingAlertIds((prev) => [...prev, id]); | ||
|
||
setTimeout(() => { | ||
removeAlert(id); | ||
}, 300); | ||
}; | ||
|
||
return ( | ||
<div className={styles.alertContainer}> | ||
{alerts.map((alert) => ( | ||
<button | ||
key={alert.id} | ||
className={`${styles.alert} ${styles[alert.type]} ${alert.closing || closingAlertIds.includes(alert.id) ? styles.closing : ''}`} | ||
onClick={() => handleClose(alert.id)} | ||
> | ||
{alert.message} | ||
</button> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default AlertComponent; |
Oops, something went wrong.