invalid hook 처리
This commit is contained in:
@@ -14,4 +14,5 @@ export enum StorageKeys {
|
||||
DeviceId = 'DEVICE_ID',
|
||||
AppVersion = 'APP_VERSION',
|
||||
LogOut = 'LOGOUT',
|
||||
i18nextLng = 'i18nextLng',
|
||||
};
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { StorageKeys } from '@/shared/constants/local-storage';
|
||||
import { getLocalStorage } from '@/shared/lib';
|
||||
import { Dialog } from '@/shared/ui/dialogs/dialog';
|
||||
import { overlay } from 'overlay-kit';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export const showAlert = (msg: string, callback?: () => void) => {
|
||||
const { t } = useTranslation();
|
||||
let language = getLocalStorage(StorageKeys.i18nextLng);
|
||||
let btnLable = (language === 'ko')? '확인': 'confirm';
|
||||
const onConfirmClick = () => {
|
||||
if(!!callback && typeof(callback) === 'function'){
|
||||
setTimeout(() => {
|
||||
@@ -22,7 +25,7 @@ export const showAlert = (msg: string, callback?: () => void) => {
|
||||
open={ isOpen }
|
||||
onClose={ close }
|
||||
message={ msg }
|
||||
buttonLabel={ [t('common.confirm')] }
|
||||
buttonLabel={ [btnLable] }
|
||||
onConfirmClick={ onConfirmClick }
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user