Browse Source

prevent portal link from navigating in builder preview

gh-pages
Martin McKeaveney 5 years ago
parent
commit
539250899c
  1. 9
      packages/standard-components/src/Layout.svelte

9
packages/standard-components/src/Layout.svelte

@ -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}>
@ -72,7 +77,7 @@
<Icon <Icon
hoverable hoverable
name="Apps" name="Apps"
on:click={() => (window.location.href = "/builder/apps")} on:click={navigateToPortal}
/> />
</div> </div>
</div> </div>

Loading…
Cancel
Save