1
0
Fork 0
mirror of synced 2024-06-02 02:25:17 +12:00

Default logo URL in navigation component and add setting to hide logo

This commit is contained in:
Andrew Kingston 2021-05-25 08:21:28 +01:00
parent 99febbc7dd
commit 1c649bee63
2 changed files with 20 additions and 8 deletions

View file

@ -338,6 +338,12 @@
"type": "text",
"label": "Logo URL",
"key": "logoUrl"
},
{
"type": "boolean",
"label": "Hide logo",
"key": "hideLogo",
"defaultValue": false
}
]
},

View file

@ -5,16 +5,22 @@
const component = getContext("component")
export let logoUrl
export let hideLogo
</script>
<div class="nav" use:styleable={$component.styles}>
<div class="nav__top">
<a href="/" use:linkable>
{#if logoUrl}
<img class="logo" alt="logo" src={logoUrl} height="48" />
{/if}
</a>
</div>
{#if !hideLogo}
<div class="nav__top">
<a href="/" use:linkable>
<img
class="logo"
alt="logo"
src={logoUrl || "https://i.imgur.com/Dn7Xt1G.png"}
height="48"
/>
</a>
</div>
{/if}
<div class="nav__menu">
<slot />
</div>
@ -33,6 +39,7 @@
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 40px;
}
.nav__top img {
margin-right: 16px;
@ -52,7 +59,6 @@
.nav__menu {
display: flex;
margin-top: 40px;
flex-direction: row;
justify-content: flex-start;
align-items: center;