Skip to content

Commit c4b6601

Browse files
committed
fix: post funnel alert창 토스트로 대체
1 parent 235e270 commit c4b6601

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/features/home/components/Filter/PriceFilter/CustomPriceInput.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import { useEffect, useState } from 'react';
22
import * as s from './style.css';
33
import { MAX_PRICE } from '@/libs/constants';
44
import { useSearchParams } from 'react-router';
5+
import { useToast } from '@/common/hooks/useToast';
56

67
interface Props {
78
active: boolean;
89
}
910
const CustomPriceInput = ({ active }: Props) => {
11+
const { openToast } = useToast();
1012
const [searchParams, setSearchParams] = useSearchParams();
1113

1214
const defaultStartPrice = searchParams.get('start-price') ? Number(searchParams.get('start-price')) : NaN;
@@ -42,7 +44,7 @@ const CustomPriceInput = ({ active }: Props) => {
4244
const submitPrice = () => {
4345
if (isNaN(startPrice) || isNaN(endPrice)) return;
4446
if (startPrice > endPrice) {
45-
alert('시작 가격이 끝 가격보다 클 수 없습니다.');
47+
openToast({ message: '시작 가격이 끝 가격보다 클 수 없습니다.' });
4648
return;
4749
}
4850
setSearchParams(prev => {

src/features/post/components/StepFunnel/Step5/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ import { ALLOWED_EXTENSIONS, MAX_DESC, MAX_SIZE_BYTES, MAX_SIZE_MB, MAX_TITLE }
1111
import AlertText from '../../AlertText';
1212
import { getFileKeys } from '@/common/utils/getFileKeys';
1313
import getImageUrl from '@/common/utils/getImageUrl';
14+
import { useToast } from '@/common/hooks/useToast';
1415

1516
const Step5 = () => {
17+
const { openToast } = useToast();
1618
const serverFileKeyStore = useStep5Store(state => state.serverFileKeys);
1719
const ServerFileKeySetter = useStep5Store(state => state.setServerFileKeys);
1820

@@ -40,11 +42,11 @@ const Step5 = () => {
4042
const validFiles = fileArray.filter(file => {
4143
const ext = file.name.split('.').pop()?.toLowerCase();
4244
if (!ext || !ALLOWED_EXTENSIONS.includes(ext)) {
43-
alert(`"${file.name}"은(는) 지원하지 않는 확장자입니다.`);
45+
openToast({ message: `"${file.name}"은(는) 지원하지 않는 확장자입니다.` });
4446
return false;
4547
}
4648
if (file.size > MAX_SIZE_BYTES) {
47-
alert(`"${file.name}"은(는) ${MAX_SIZE_MB}MB를 초과합니다.`);
49+
openToast({ message: `"${file.name}"은(는) ${MAX_SIZE_MB}MB를 초과합니다.` });
4850
return false;
4951
}
5052
return true;

0 commit comments

Comments
 (0)