Merge pull request #1783 from Budibase/fix/martin-june-fixes

prevent portal link from navigating in builder preview
This commit is contained in:
Martin McKeaveney 2021-06-21 22:55:55 +01:00 committed by GitHub
commit 681d35d915
1 changed files with 7 additions and 6 deletions

View File

@ -2,7 +2,7 @@
import { getContext } from "svelte" import { getContext } from "svelte"
import { Heading, Icon } from "@budibase/bbui" import { Heading, Icon } from "@budibase/bbui"
const { styleable, linkable } = getContext("sdk") const { styleable, linkable, builderStore } = getContext("sdk")
const component = getContext("component") const component = getContext("component")
export let title export let title
@ -41,6 +41,11 @@
const close = () => { const close = () => {
mobileOpen = false mobileOpen = false
} }
const navigateToPortal = () => {
if ($builderStore.inBuilder) return
window.location.href = "/builder/apps"
}
</script> </script>
<div class="layout layout--{typeClass}" use:styleable={$component.styles}> <div class="layout layout--{typeClass}" use:styleable={$component.styles}>
@ -69,11 +74,7 @@
{/if} {/if}
</div> </div>
<div class="portal"> <div class="portal">
<Icon <Icon hoverable name="Apps" on:click={navigateToPortal} />
hoverable
name="Apps"
on:click={() => (window.location.href = "/builder/apps")}
/>
</div> </div>
</div> </div>
<div <div