move current submenu logic to top level
MODIFY
src/components/docs/mobile-menu/index.svelte
src/components/docs/mobile-menu/index.svelte
// States
import topicsState from "../states/topics-state";
+ import docsCurrentSectionStore from "../../../stores/docs-current-section";
export let MENU;
+
+ $: currentSection = MENU.find(({ path }) =>
+ $docsCurrentSectionStore
+ ? path.indexOf($docsCurrentSectionStore) >= 0
+ : /\/docs\/$/.test(path)
+ );
</script>
<style lang="scss">
{#if $topicsState}
<MobileMenuTopics {MENU} />
{:else}
- <MobileMenuSubMenu {MENU} />
+ <MobileMenuSubMenu {currentSection} />
{/if}
</div>

MODIFY
src/components/docs/mobile-menu/sub-menu.svelte
src/components/docs/mobile-menu/sub-menu.svelte
import topicsState from "../states/topics-state";
import subMenuState from "../states/sub-menu-state";
- import docsCurrentSectionStore from "../../../stores/docs-current-section";
-
- export let MENU;
-
- $: currentSection = MENU.find(({ path }) =>
- $docsCurrentSectionStore
- ? path.indexOf($docsCurrentSectionStore) >= 0
- : /\/docs\/$/.test(path)
- );
+ export let currentSection;
</script>
<style lang="scss">

move current submenu logic to top level