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