Skip to content

Commit

Permalink
More consistency with the top bar. #15
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Feb 5, 2024
1 parent 830c725 commit 661eace
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 16 deletions.
16 changes: 14 additions & 2 deletions web/src/DebugGJ.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,21 @@
</script>

<SplitComponent>
<div slot="sidebar">
<h1>Debug GJ</h1>
<div slot="top">
<nav aria-label="breadcrumb">
<!-- svelte-ignore a11y-invalid-attribute -->
<ul>
<li>
<a href="#" on:click={() => ($mode = { mode: "title" })}
>Choose study area</a
>
</li>
<li>Debug route snapper</li>
</ul>
</nav>
</div>

<div slot="sidebar">
<button on:click={() => ($mode = { mode: "network" })}>Back</button>
</div>

Expand Down
24 changes: 22 additions & 2 deletions web/src/DebugMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,29 @@
</script>

<SplitComponent>
<div slot="sidebar">
<h1>Debug mode</h1>
<div slot="top">
<nav aria-label="breadcrumb">
<!-- svelte-ignore a11y-invalid-attribute -->
<ul>
<li>
<a href="#" on:click={() => ($mode = { mode: "title" })}
>Choose study area</a
>
</li>
<li>
<a href="#" on:click={() => ($mode = { mode: "network" })}
>Pick neighbourhood</a
>
</li>
<li>
<a href="#" on:click={() => ($mode = { mode: "neighbourhood" })}>Editing modal filters</a>
</li>
<li>Debug mode</li>
</ul>
</nav>
</div>

<div slot="sidebar">
<button on:click={() => ($mode = { mode: "neighbourhood" })}
>Back to editing</button
>
Expand Down
4 changes: 2 additions & 2 deletions web/src/NetworkMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
<ul>
<li>
<a href="#" on:click={() => ($mode = { mode: "title" })}
>Change study area</a
>Choose study area</a
>
</li>
<li>Define neighbourhood boundaries</li>
<li>Pick neighbourhood</li>
</ul>
</nav>
<span style="display: flex">
Expand Down
4 changes: 2 additions & 2 deletions web/src/RouteMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
<ul>
<li>
<a href="#" on:click={() => ($mode = { mode: "title" })}
>Change study area</a
>Choose study area</a
>
</li>
<li>
<a href="#" on:click={() => ($mode = { mode: "network" })}
>Change neighbourhood</a
>Pick neighbourhood</a
>
</li>
{#if prevMode == "neighbourhood"}
Expand Down
42 changes: 39 additions & 3 deletions web/src/SetBoundaryMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@
$route_tool!.startArea();
}
// TODO When we click a link and nav away, clear state
function onFailure() {
$mode = {
mode: "network",
};
if (existing) {
$mode = {
mode: "neighbourhood",
};
} else {
$mode = {
mode: "network",
};
}
$route_tool!.clearEventListeners();
}
Expand All @@ -41,6 +49,34 @@
</script>

<SplitComponent>
<div slot="top">
<nav aria-label="breadcrumb">
<!-- svelte-ignore a11y-invalid-attribute -->
<ul>
<li>
<a href="#" on:click={() => ($mode = { mode: "title" })}
>Choose study area</a
>
</li>
<li>
<a href="#" on:click={() => ($mode = { mode: "network" })}
>Pick neighbourhood</a
>
</li>
{#if existing}
<li>
<a href="#" on:click={() => ($mode = { mode: "neighbourhood" })}
>Editing modal filters</a
>
</li>
<li>Changing neighbourhood boundary</li>
{:else}
<li>Creating new neighbourhood boundary</li>
{/if}
</ul>
</nav>
</div>

<div slot="sidebar">
<h1>Draw your neighbourhood boundary for {name}</h1>

Expand Down
4 changes: 2 additions & 2 deletions web/src/ViewShortcutsMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@
<ul>
<li>
<a href="#" on:click={() => ($mode = { mode: "title" })}
>Change study area</a
>Choose study area</a
>
</li>
<li>
<a href="#" on:click={() => ($mode = { mode: "network" })}
>Change neighbourhood</a
>Pick neighbourhood</a
>
</li>
<li>
Expand Down
4 changes: 2 additions & 2 deletions web/src/edit/NeighbourhoodMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@
<ul>
<li>
<a href="#" on:click={() => ($mode = { mode: "title" })}
>Change study area</a
>Choose study area</a
>
</li>
<li>
<a href="#" on:click={() => ($mode = { mode: "network" })}
>Change neighbourhood</a
>Pick neighbourhood</a
>
</li>
<li>
Expand Down
5 changes: 4 additions & 1 deletion web/src/title/TitleMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@

<SplitComponent>
<div slot="top">
<h1>Choose your study area</h1>
<nav aria-label="breadcrumb">
<ul>
<li>Choose study area</li>
</ul></nav>
</div>
<div slot="sidebar">
<About />
Expand Down

0 comments on commit 661eace

Please sign in to comment.