This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState, useEffect } from 'react'; | |
export enum DeviceEnum | |
{ | |
Desktop, | |
Tablet, | |
Mobile | |
} | |
export function useDevice() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { useSelector } from 'react-redux'; | |
import { Route, RouteProps, Redirect, useLocation } from 'react-router-dom'; | |
import { useSearchParams } from 'hooks'; | |
import { StatusEnum } from 'reducers/models'; | |
import { Loader } from 'components/elements'; | |
export function AppRoute({ component, secured, ...props }: (RouteProps & { secured?: boolean })) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function useStorage<T>(key: string) | |
{ | |
function getKey() | |
{ | |
const data = localStorage.getItem(key); | |
if (!data) | |
{ | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { createContext, useCallback, useContext, useMemo, useState } from "react"; | |
import { useColorScheme } from "react-native"; | |
import AsyncStorage from "@react-native-async-storage/async-storage" | |
import { dark, light } from "../../utls/layout"; | |
const ThemeContext = createContext(undefined); | |
export default function ThemeContextProvider({ children }) { | |
const systemColorScheme = useColorScheme(); |