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 3f9bdd9589
commit c91fb7d500
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}>
{#if !hideLogo}
<div class="nav__top">
<a href="/" use:linkable>
{#if logoUrl}
<img class="logo" alt="logo" src={logoUrl} height="48" />
{/if}
<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;