feat: split contexts, providers and hooks

This commit is contained in:
Pihkaal
2024-05-30 15:55:59 +02:00
parent af5fc8cb35
commit 77f3b3ef40
13 changed files with 51 additions and 41 deletions

View File

@@ -0,0 +1,12 @@
import { type ReactNode, useState } from "react";
import { AppContext } from "~/context/AppContext";
export const AppProvider = (props: { children?: ReactNode }) => {
const [activeKitty, setActiveKitty] = useState(":r0:");
return (
<AppContext.Provider value={{ activeKitty, setActiveKitty }}>
{props.children}
</AppContext.Provider>
);
};

View File

@@ -0,0 +1,3 @@
import { KittyContext } from "~/context/KittyContext";
export const KittyProvider = KittyContext.Provider;