-
Notifications
You must be signed in to change notification settings - Fork 4
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 #78 from donga-it-club/develop
20240324
- Loading branch information
Showing
149 changed files
with
18,933 additions
and
7,664 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run lint-staged |
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,10 @@ | ||
// //인터페이스를 통한 타입 추론 | ||
// interface ImportMeta { | ||
// env: { | ||
// DEV: boolean; | ||
// MODE: string; //개발모드, 운영모드여부 | ||
// SERVER_URL: string; //이런식으로 env 파일에 정의한 내용을 기술~ | ||
// HELLO_URL: number; //이런식으로 env 파일에 정의한 내용을 기술~ | ||
// WORLD_URL: array; //이런식으로 env 파일에 정의한 내용을 기술~ | ||
// }; | ||
// } |
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,51 @@ | ||
import { ReactNode, useMemo } from 'react'; | ||
import { useToast, UseToastOptions } from '@chakra-ui/react'; | ||
import { getErrorMessage } from '@/api/helper'; | ||
|
||
export function useCustomToast() { | ||
const toast = useToast({ | ||
position: 'top', | ||
duration: 4000, | ||
isClosable: true, | ||
containerStyle: { minWidth: 'unset' }, | ||
}); | ||
|
||
return useMemo( | ||
() => ({ | ||
...toast, | ||
|
||
info: (description: string) => { | ||
toast({ | ||
status: 'info', | ||
colorScheme: 'brand', | ||
description, | ||
}); | ||
}, | ||
success: (description: string) => { | ||
toast({ | ||
status: 'success', | ||
colorScheme: 'success', | ||
description, | ||
}); | ||
}, | ||
warning: (description: ReactNode, options?: Omit<UseToastOptions, 'status' | 'colorScheme' | 'description'>) => { | ||
return toast({ | ||
status: 'warning', | ||
colorScheme: 'accent', | ||
description: description, | ||
...options, | ||
}); | ||
}, | ||
error: (e: unknown, options?: Omit<UseToastOptions, 'status' | 'colorScheme' | 'title' | 'description'>) => { | ||
return toast({ | ||
status: 'error', | ||
colorScheme: 'error', | ||
title: 'Error', | ||
description: getErrorMessage(e), | ||
...options, | ||
}); | ||
}, | ||
}), | ||
[toast], | ||
); | ||
} |
Oops, something went wrong.