device switch
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { createSignal } from "solid-js";
|
||||
import { createEffect, createSignal, on } from "solid-js";
|
||||
import { createSimpleContext } from "./helper";
|
||||
import { TABS, TabsCount } from "@/utils/navigation";
|
||||
|
||||
@@ -10,6 +10,13 @@ export const { use: useNavigation, provider: NavigationProvider } =
|
||||
const [activeDepth, setActiveDepth] = createSignal(0);
|
||||
const [inputFocused, setInputFocused] = createSignal(false);
|
||||
|
||||
createEffect(
|
||||
on(
|
||||
() => activeTab,
|
||||
() => setActiveDepth(0),
|
||||
),
|
||||
);
|
||||
|
||||
//conveniences
|
||||
const nextTab = () => {
|
||||
if (activeTab() >= TabsCount) {
|
||||
|
||||
Reference in New Issue
Block a user