Added mobile
This commit is contained in:
parent
82a14f65fa
commit
80114d1d66
125 changed files with 8200 additions and 542 deletions
28
apps/mobile/src/context.tsx
Normal file
28
apps/mobile/src/context.tsx
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import { isTauri } from "@tauri-apps/api/core";
|
||||
import { createContext, useEffect } from "react";
|
||||
|
||||
type contextType = {
|
||||
isTauri: boolean;
|
||||
};
|
||||
|
||||
export const context = createContext<contextType | undefined>(undefined);
|
||||
|
||||
export default function Provider({ children }: { children: React.ReactNode }) {
|
||||
const isTauriVar = isTauri();
|
||||
|
||||
useEffect(() => {
|
||||
if (!isTauriVar) return;
|
||||
|
||||
document.body.classList.add("");
|
||||
}, [isTauriVar]);
|
||||
|
||||
return (
|
||||
<context.Provider
|
||||
value={{
|
||||
isTauri: isTauriVar,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</context.Provider>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue