-
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.
[feat] Toast Component 추가 및 filter 변경
- Loading branch information
1 parent
e9e205a
commit 26425e4
Showing
9 changed files
with
94 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.toast { | ||
@apply fixed bottom-5 left-1/2 transform -translate-x-1/2 bg-a1 text-white font-bold rounded-lg py-2 px-4 shadow-lg z-10 w-full h-[48px] text-center; | ||
} |
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,25 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import styles from './Toast.module.scss'; | ||
|
||
interface ToastProps { | ||
message: string; | ||
duration?: number; | ||
onVisibleChange: (visible: boolean) => void; // 새로운 콜백 함수 추가 | ||
} | ||
|
||
export default function Toast({ message, duration = 3000, onVisibleChange }: ToastProps) { | ||
const [visible, setVisible] = useState(true); | ||
|
||
useEffect(() => { | ||
const timer = setTimeout(() => { | ||
setVisible(false); | ||
onVisibleChange(!onVisibleChange); | ||
}, duration); | ||
|
||
return () => { | ||
clearTimeout(timer); | ||
}; | ||
}, [duration, visible, onVisibleChange]); | ||
|
||
return visible ? <div className={styles.toast}>{message}</div> : null; | ||
} |
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
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,36 @@ | ||
{ | ||
"location": "Location", | ||
"gu": "Gu", | ||
"koo": "Gu", | ||
"dong": "Dong", | ||
"deposit": "Deposit", | ||
"viewRoomsWithoutDeposit": "View rooms without deposit", | ||
"minMax": "Min 0 ₩ - Max 500,000,000 ₩ ", | ||
"min": "Min", | ||
"max": "Max", | ||
"monthRent": "Monthly rent", | ||
"includeMainFee": "Include maintenance fee", | ||
"dateAvailable": "Date available", | ||
"viewRoomsAvailable": "View rooms available now", | ||
"typeOfHousing": "Type of housing", | ||
"studio": "Studio", | ||
"bedFlats ": "1bed flats", | ||
"shareHouse": "Share house", | ||
"furnishing": "Furnishing", | ||
"bed": "Bed", | ||
"wardrobe": "Wardrobe", | ||
"tv": "TV", | ||
"airconditioner": "Air conditioner", | ||
"heater": "Heater", | ||
"doorLock": "Door lock", | ||
"refrigerator": "Refrigerator", | ||
"stove": "Stove", | ||
"washingMachine": "Washing machine", | ||
"induction": "Induction", | ||
"gasStove": "Gas stove", | ||
"kitchenette": "Kitchenette", | ||
"reset": "Reset", | ||
"apply": "Apply", | ||
"mmddyyyy": "MM-DD-YYYY", | ||
"uptofive" : "You can select up to five" | ||
} |