Skip to content

Commit

Permalink
chore: 토스트 UI 기본 시간 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hwinkr committed Oct 10, 2024
1 parent 9e8b4ec commit ae6f6f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/_common/Toast/ToastContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import Toast from '.';
import type { ToastType } from './Toast.type';

interface ToastContainerProps {
duration: number;
duration?: number;
type: ToastType;
message: string;
}

const TOAST_ANIMATION_DURATION_TIME = 500;

export default function ToastContainer({ duration, type, message }: ToastContainerProps) {
export default function ToastContainer({ type, message, duration = 3000 }: ToastContainerProps) {
const [isOpen, setIsOpen] = useState(true);

useEffect(() => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/contexts/ToastProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { PropsWithChildren } from 'react';
import React, { useState } from 'react';
import { useState } from 'react';
import { createContext } from 'react';

import type { ToastType } from '@components/_common/Toast/Toast.type';
Expand All @@ -9,7 +9,7 @@ interface ToastState {
id: number;
type: ToastType;
message: string;
duration: number;
duration?: number;
}

interface ToastContextType {
Expand Down

0 comments on commit ae6f6f6

Please sign in to comment.