budibase/packages/builder/src/components/userInterface/FrontendNavigatePane.svelte

56 lines
1.3 KiB
Svelte
Raw Normal View History

<script>
import { onMount } from "svelte"
import { store, currentAsset } from "builderStore"
import api from "builderStore/api"
2020-11-19 17:41:29 +01:00
import ComponentNavigationTree from "components/userInterface/ComponentNavigationTree/index.svelte"
import Layout from "components/userInterface/Layout.svelte"
import LayoutsList from "components/userInterface/LayoutsList.svelte"
2020-10-08 10:35:11 +02:00
import NewScreenModal from "components/userInterface/NewScreenModal.svelte"
import { Modal } from "@budibase/bbui"
2020-05-29 19:32:52 +02:00
2020-10-08 10:35:11 +02:00
let modal
let routes = {}
onMount(() => {
2020-11-19 22:07:25 +01:00
store.actions.routing.fetch()
})
</script>
<div class="title">
<h1>Screens</h1>
2020-10-27 16:26:07 +01:00
<i on:click={modal.show} data-cy="new-screen" class="ri-add-circle-fill" />
</div>
<LayoutsList />
{#if $store.currentFrontEndType === "layout" && $currentAsset}
<div class="nav-items-container">
<Layout layout={$currentAsset} />
2020-11-19 22:07:25 +01:00
<ComponentNavigationTree />
</div>
2020-10-08 10:35:11 +02:00
<Modal bind:this={modal}>
<NewScreenModal />
</Modal>
{/if}
<style>
.title {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.title h1 {
font-size: var(--font-size-m);
font-weight: 500;
margin: 0;
}
.title i {
font-size: 20px;
}
.title i:hover {
cursor: pointer;
color: var(--blue);
}
</style>