invalid hook 처리

This commit is contained in:
focp212@naver.com
2025-11-17 10:54:01 +09:00
parent 4548b374d6
commit b413b6d42d
2 changed files with 6 additions and 2 deletions

View File

@@ -14,4 +14,5 @@ export enum StorageKeys {
DeviceId = 'DEVICE_ID',
AppVersion = 'APP_VERSION',
LogOut = 'LOGOUT',
i18nextLng = 'i18nextLng',
};

View File

@@ -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 }
/>
);