2019-08-02 15:54:10 +02:00
|
|
|
<script>
|
2020-02-03 10:50:30 +01:00
|
|
|
import { store } from "../builderStore"
|
|
|
|
import getIcon from "../common/icon"
|
2019-08-02 15:54:10 +02:00
|
|
|
|
2020-02-03 10:50:30 +01:00
|
|
|
const getPage = (s, name) => {
|
|
|
|
const props = s.pages[name]
|
|
|
|
return { name, props }
|
|
|
|
}
|
2019-08-02 15:54:10 +02:00
|
|
|
|
2020-02-03 10:50:30 +01:00
|
|
|
const pages = [
|
|
|
|
{
|
|
|
|
title: "Main",
|
|
|
|
id: "main",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: "Login",
|
|
|
|
id: "unauthenticated",
|
|
|
|
},
|
|
|
|
]
|
2020-01-20 16:41:40 +01:00
|
|
|
|
2020-02-03 10:50:30 +01:00
|
|
|
store.setCurrentPage("main")
|
2019-08-02 15:54:10 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="root">
|
2020-02-03 10:50:30 +01:00
|
|
|
<select
|
|
|
|
id="page"
|
|
|
|
name="select"
|
|
|
|
on:change={({ target }) => store.setCurrentPage(target.value)}>
|
2020-01-20 16:41:40 +01:00
|
|
|
|
2020-02-03 10:50:30 +01:00
|
|
|
{#each pages as { title, id }}
|
|
|
|
<option value={id}>Page: {title}</option>
|
2020-01-20 16:41:40 +01:00
|
|
|
{/each}
|
2019-08-02 15:54:10 +02:00
|
|
|
|
2020-02-03 10:50:30 +01:00
|
|
|
</select>
|
|
|
|
<span class="arrow">
|
|
|
|
{@html getIcon('chevron-down', '24')}
|
|
|
|
</span>
|
2019-08-02 15:54:10 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
2020-02-03 10:50:30 +01:00
|
|
|
.root {
|
|
|
|
padding-bottom: 10px;
|
|
|
|
font-size: 0.9rem;
|
|
|
|
color: var(--secondary50);
|
|
|
|
font-weight: bold;
|
|
|
|
position: relative;
|
|
|
|
}
|
2019-08-02 15:54:10 +02:00
|
|
|
|
2020-02-03 10:50:30 +01:00
|
|
|
select {
|
|
|
|
display: block;
|
|
|
|
font-size: 16px;
|
|
|
|
font-family: sans-serif;
|
|
|
|
font-weight: 700;
|
|
|
|
color: #444;
|
|
|
|
line-height: 1.3;
|
|
|
|
padding: 1em 2.6em 0.9em 1.4em;
|
|
|
|
width: 100%;
|
|
|
|
max-width: 100%;
|
|
|
|
box-sizing: border-box;
|
|
|
|
margin: 0;
|
|
|
|
border: none;
|
|
|
|
border-radius: 0.5em;
|
|
|
|
-moz-appearance: none;
|
|
|
|
-webkit-appearance: none;
|
|
|
|
appearance: none;
|
|
|
|
background-color: #fafafa;
|
|
|
|
}
|
2019-08-02 15:54:10 +02:00
|
|
|
|
2020-02-03 10:50:30 +01:00
|
|
|
.arrow {
|
|
|
|
position: absolute;
|
|
|
|
right: 10px;
|
|
|
|
top: 0;
|
|
|
|
bottom: 0;
|
|
|
|
margin: auto;
|
|
|
|
width: 30px;
|
|
|
|
height: 30px;
|
|
|
|
pointer-events: none;
|
|
|
|
color: var(--primary100);
|
|
|
|
}
|
2020-01-20 16:41:40 +01:00
|
|
|
</style>
|