불필요 파일 제거
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
export const DEFAULT_BACKGROUND_COLOR = '#FFFFFF';
|
||||
export const HOME_BACKGROUND_COLOR = '#EEF3F8';
|
||||
@@ -1 +0,0 @@
|
||||
export const glossary = {};
|
||||
@@ -1,16 +0,0 @@
|
||||
export const formatKoreanNumber = (num: number): string => {
|
||||
const units = ['', '만', '억', '조', '경', '해'];
|
||||
let result = '';
|
||||
let unitIndex = 0;
|
||||
|
||||
while (num > 0) {
|
||||
const part = num % 10000;
|
||||
if (part != 0) {
|
||||
result = `${part.toLocaleString()}${units[unitIndex]}${result}`;
|
||||
}
|
||||
num = Math.floor(num / 10000);
|
||||
unitIndex++;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
@@ -3,7 +3,5 @@ export * from './use-device-uid';
|
||||
export * from './use-fix-scroll-view-safari';
|
||||
export * from './use-has-bio-hardware';
|
||||
export * from './use-navigate';
|
||||
export * from './use-location-permission';
|
||||
export * from './use-window-focus-change';
|
||||
export * from './use-router-listener';
|
||||
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/* eslint-disable @cspell/spellchecker */
|
||||
import { useEffect } from 'react';
|
||||
import { PERMISSION_RESULTS, PermissionResultValues, WebViewBridgeResponse } from '@/shared/@types/webview-bridge';
|
||||
|
||||
import { NativeFunction } from '@/shared/constants/native-function';
|
||||
|
||||
interface CheckLocationPermissionResponse extends WebViewBridgeResponse {
|
||||
data: PermissionResultValues;
|
||||
}
|
||||
|
||||
export const useRequestLocationPermission = () => {
|
||||
useEffect(() => {
|
||||
window.webViewBridge.send(NativeFunction.LocationPermission, {
|
||||
success: async () => {
|
||||
// console.log('res', res);
|
||||
},
|
||||
});
|
||||
}, []);
|
||||
};
|
||||
|
||||
export const useCheckLocationPermission = () => {
|
||||
useEffect(() => {
|
||||
window.webViewBridge.send(NativeFunction.CheckLocationPermission, {
|
||||
success: async (res: CheckLocationPermissionResponse) => {
|
||||
// console.log('res', res.data);
|
||||
switch (res.data) {
|
||||
case PERMISSION_RESULTS.UNAVAILABLE:
|
||||
console.log('This feature is not available (on this device / in this context)');
|
||||
break;
|
||||
case PERMISSION_RESULTS.DENIED:
|
||||
console.log('The permission has not been requested / is denied but requestable');
|
||||
break;
|
||||
case PERMISSION_RESULTS.LIMITED:
|
||||
console.log('The permission is limited: some actions are possible');
|
||||
break;
|
||||
case PERMISSION_RESULTS.GRANTED:
|
||||
console.log('The permission is granted');
|
||||
break;
|
||||
case PERMISSION_RESULTS.BLOCKED:
|
||||
console.log('The permission is denied and not requestable anymore');
|
||||
break;
|
||||
}
|
||||
},
|
||||
});
|
||||
}, []);
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
/* eslint-disable react-hooks/exhaustive-deps */
|
||||
import { useEffect } from 'react';
|
||||
|
||||
interface WindowFocusProps {
|
||||
onFocus?: () => void;
|
||||
onBlur?: () => void;
|
||||
args?: any[];
|
||||
}
|
||||
|
||||
export const useWindowFocusChange = ({ onFocus, onBlur, ...args }: WindowFocusProps) => {
|
||||
const dependencies: any[] = [];
|
||||
if (Array.isArray(args)) {
|
||||
dependencies.push(...args);
|
||||
}
|
||||
const handleEvent = () => {
|
||||
if (document.hidden) {
|
||||
// the page is hidden
|
||||
onBlur?.();
|
||||
} else {
|
||||
// the page is visible
|
||||
onFocus?.();
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
window.document.addEventListener('visibilitychange', handleEvent);
|
||||
return () => window.document.removeEventListener('visibilitychange', handleEvent);
|
||||
}, [onFocus, onBlur, ...dependencies]);
|
||||
};
|
||||
@@ -1,4 +1,3 @@
|
||||
export * from './error';
|
||||
export * from './toast';
|
||||
export * from './web-view-bridge';
|
||||
export * from './format-korean-number';
|
||||
export * from './web-view-bridge';
|
||||
Reference in New Issue
Block a user