thêm zustand để cấu hình global state, hook để lấy platform, thêm polyline và polygon b vào map

This commit is contained in:
Tran Anh Tuan
2025-10-31 19:54:16 +07:00
parent 2fac0b8093
commit 5801992eae
19 changed files with 1202 additions and 89 deletions

23
hooks/use-platform.ts Normal file
View File

@@ -0,0 +1,23 @@
import { Platform } from "react-native";
export type PlatformType = "ios" | "android" | "web";
export const usePlatform = (): PlatformType => {
return Platform.OS as PlatformType;
};
export const useIsIOS = (): boolean => {
return Platform.OS === "ios";
};
export const useIsAndroid = (): boolean => {
return Platform.OS === "android";
};
export const useIsWeb = (): boolean => {
return Platform.OS === "web";
};
export const getPlatform = (): PlatformType => {
return Platform.OS as PlatformType;
};