disable nav in options

This commit is contained in:
cupcakearmy 2021-11-23 14:49:38 +01:00
parent 4dbfe6f038
commit 28d97ced68
No known key found for this signature in database
GPG Key ID: 3235314B4D31232F
2 changed files with 11 additions and 10 deletions

View File

@ -25,7 +25,7 @@
"scripts": ["./src/background/index.js"] "scripts": ["./src/background/index.js"]
}, },
"options_ui": { "options_ui": {
"page": "./src/dashboard/index.html#/options" "page": "./src/dashboard/index.html#/options?nav=false"
}, },
"content_scripts": [ "content_scripts": [
{ {

View File

@ -1,5 +1,5 @@
<script> <script>
import Router, { link } from 'svelte-spa-router' import Router, { link, querystring } from 'svelte-spa-router'
import Toasts from './components/Toasts.svelte' import Toasts from './components/Toasts.svelte'
import Dev from './components/Dev.svelte' import Dev from './components/Dev.svelte'
@ -15,20 +15,21 @@
'/options': Options, '/options': Options,
'/limits': Limits, '/limits': Limits,
} }
$: nav = new URLSearchParams($querystring).get('nav') !== 'false'
</script> </script>
{#if isDev} {#if isDev}
<Dev /> <Dev />
{/if} {/if}
<main> <main>
<div class="mb-8"> {#if nav}
<!-- svelte-ignore a11y-missing-attribute --> <div class="mb-8">
<a use:link={'/'}><button class="btn">Dashboard</button></a> <a use:link href="/"><button class="btn">Dashboard</button></a>
<!-- svelte-ignore a11y-missing-attribute --> <a use:link href="/limits"><button class="btn">Limits</button></a>
<a use:link={'/limits'}><button class="btn">Limits</button></a> <a use:link href="/options"><button class="btn">Options</button></a>
<!-- svelte-ignore a11y-missing-attribute --> </div>
<a use:link={'/options'}><button class="btn">Options</button></a> {/if}
</div>
<Router {routes} /> <Router {routes} />
<Toasts /> <Toasts />