1
0
Fork 0
mirror of synced 2024-09-14 16:27:26 +12:00
budibase/packages/standard-components/src/Navigation.svelte

80 lines
1.5 KiB
Svelte
Raw Normal View History

2020-04-24 00:32:36 +12:00
<script>
import { getContext } from "svelte"
const { authStore, linkable, styleable, builderStore } = getContext("sdk")
const component = getContext("component")
2021-06-02 02:06:58 +12:00
// BB emblem: https://i.imgur.com/Xhdt1YP.png
// Space logo: https://i.imgur.com/Dn7Xt1G.png
2020-04-24 00:32:36 +12:00
export let logoUrl
export let hideLogo
2020-04-24 00:32:36 +12:00
</script>
<div class="nav" use:styleable={$component.styles}>
{#if !hideLogo}
<div class="nav__top">
<a href="/" use:linkable>
<img
class="logo"
alt="logo"
2021-06-02 02:06:58 +12:00
src={logoUrl || "https://i.imgur.com/Xhdt1YP.png"}
height="48"
/>
</a>
</div>
{/if}
<div class="nav__menu">
<slot />
</div>
2020-10-15 05:06:02 +13:00
</div>
2020-04-24 00:32:36 +12:00
<style>
2020-10-15 05:06:02 +13:00
.nav {
2020-04-24 00:32:36 +12:00
display: flex;
2020-10-15 05:06:02 +13:00
flex-direction: column;
justify-content: flex-start;
align-items: stretch;
2020-04-24 00:32:36 +12:00
}
2020-10-15 05:06:02 +13:00
.nav__top {
2020-04-24 00:32:36 +12:00
display: flex;
2020-10-15 05:06:02 +13:00
flex-direction: row;
justify-content: space-between;
2020-04-24 00:32:36 +12:00
align-items: center;
margin-bottom: 40px;
2020-04-24 00:32:36 +12:00
}
2020-10-15 05:06:02 +13:00
.nav__top img {
margin-right: 16px;
2020-04-24 00:32:36 +12:00
}
2020-10-15 05:06:02 +13:00
.nav__controls {
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
gap: 16px;
}
.nav__controls > div:hover {
cursor: pointer;
color: #4285f4;
}
.nav__menu {
2020-04-24 00:32:36 +12:00
display: flex;
2020-10-15 05:06:02 +13:00
flex-direction: row;
justify-content: flex-start;
align-items: center;
2020-04-24 00:32:36 +12:00
}
2021-02-04 21:18:33 +13:00
.nav__menu > * {
margin-right: 16px;
}
:global(.nav__menu > a) {
2020-10-15 05:06:02 +13:00
font-size: 1.5em;
text-decoration: none;
2021-02-04 21:18:33 +13:00
margin-right: 16px;
2020-04-24 00:32:36 +12:00
}
</style>