Merge pull request #283 from Budibase/navigation-tidy-up

Frontend navigation panel tidy up
This commit is contained in:
Joe 2020-06-01 22:29:08 +01:00 committed by GitHub
commit f3339c51b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 80 additions and 41 deletions

View File

@ -63,7 +63,7 @@
font-weight: 700; font-weight: 700;
color: var(--ink-lighter); color: var(--ink-lighter);
margin-right: 20px; margin-right: 20px;
background-color: var(--white); background: none;
} }
.switcher > .selected { .switcher > .selected {

View File

@ -1,4 +1,4 @@
<script> <script>
import { MoreIcon } from "components/common/Icons" import { MoreIcon } from "components/common/Icons"
import { store } from "builderStore" import { store } from "builderStore"
import { getComponentDefinition } from "builderStore/store" import { getComponentDefinition } from "builderStore/store"
@ -155,16 +155,52 @@
<MoreIcon /> <MoreIcon />
</button> </button>
<ul class="menu" bind:this={dropdownEl} on:click={hideDropdown}> <ul class="menu" bind:this={dropdownEl} on:click={hideDropdown}>
<li class="item" on:click={() => confirmDeleteDialog.show()}><i class="icon ri-delete-bin-2-line"></i>Delete</li> <li class="item" on:click={() => confirmDeleteDialog.show()}>
<li class="item" on:click={moveUpComponent}><i class="icon ri-arrow-up-line"></i>Move up</li> <i class="icon ri-delete-bin-2-line" />
<li class="item" on:click={moveDownComponent}><i class="icon ri-arrow-down-line"></i>Move down</li> Delete
<li class="item" on:click={copyComponent}><i class="icon ri-repeat-one-line"></i>Duplicate</li> </li>
<li class="item" on:click={() => storeComponentForCopy(true)}><i class="icon ri-scissors-cut-line"></i>Cut</li> <li class="item" on:click={moveUpComponent}>
<li class="item" on:click={() => storeComponentForCopy(false)}><i class="icon ri-file-copy-line"></i>Copy</li> <i class="icon ri-arrow-up-line" />
<hr class="hr-style"> Move up
<li class="item" class:disabled={noPaste} on:click={() => pasteComponent('above')}><i class="icon ri-insert-row-top"></i>Paste above</li> </li>
<li class="item" class:disabled={noPaste} on:click={() => pasteComponent('below')}><i class="icon ri-insert-row-bottom"></i>Paste below</li> <li class="item" on:click={moveDownComponent}>
<li class="item" class:disabled={noPaste || noChildrenAllowed} on:click={() => pasteComponent('inside')}><i class="icon ri-insert-column-right"></i>Paste inside</li> <i class="icon ri-arrow-down-line" />
Move down
</li>
<li class="item" on:click={copyComponent}>
<i class="icon ri-repeat-one-line" />
Duplicate
</li>
<li class="item" on:click={() => storeComponentForCopy(true)}>
<i class="icon ri-scissors-cut-line" />
Cut
</li>
<li class="item" on:click={() => storeComponentForCopy(false)}>
<i class="icon ri-file-copy-line" />
Copy
</li>
<hr class="hr-style" />
<li
class="item"
class:disabled={noPaste}
on:click={() => pasteComponent('above')}>
<i class="icon ri-insert-row-top" />
Paste above
</li>
<li
class="item"
class:disabled={noPaste}
on:click={() => pasteComponent('below')}>
<i class="icon ri-insert-row-bottom" />
Paste below
</li>
<li
class="item"
class:disabled={noPaste || noChildrenAllowed}
on:click={() => pasteComponent('inside')}>
<i class="icon ri-insert-column-right" />
Paste inside
</li>
</ul> </ul>
</div> </div>
@ -235,6 +271,6 @@
.hr-style { .hr-style {
margin: 8px 0; margin: 8px 0;
color: var(--grey-dark) color: var(--grey-dark);
} }
</style> </style>

View File

@ -80,7 +80,7 @@
margin-left: 10px; margin-left: 10px;
margin-top: 2px; margin-top: 2px;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 400;
} }
.icon { .icon {

View File

@ -14,7 +14,10 @@
<PagesList /> <PagesList />
<button class="newscreen" on:click={newScreen}>Create New Screen</button> <button class="newscreen" on:click={newScreen}>
<i class="icon ri-add-circle-fill" />
Create New Screen
</button>
<PageLayout layout={$store.pages[$store.currentPageName]} /> <PageLayout layout={$store.pages[$store.currentPageName]} />
@ -31,7 +34,7 @@
border-radius: 3px; border-radius: 3px;
width: 100%; width: 100%;
padding: 8px 16px; padding: 8px 16px;
margin: 12px 0px; margin: 20px 0px 12px 0px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -45,4 +48,10 @@
.newscreen:hover { .newscreen:hover {
background: var(--grey-light); background: var(--grey-light);
} }
.icon {
color: var(--ink);
font-size: 16px;
margin-right: 4px;
}
</style> </style>

View File

@ -40,37 +40,31 @@
} }
</script> </script>
<div class="pagelayoutSection"> <div
<div class="budibase__nav-item root"
class="budibase__nav-item root" class:selected={$store.currentComponentInfo._id === _layout.component.props._id}
class:selected={$store.currentComponentInfo._id === _layout.component.props._id} on:click|stopPropagation={setCurrentScreenToLayout}>
on:click|stopPropagation={setCurrentScreenToLayout}> <span
<span class="icon"
class="icon" class:rotate={$store.currentPreviewItem.name !== _layout.title}>
class:rotate={$store.currentPreviewItem.name !== _layout.title}> <ArrowDownIcon />
<ArrowDownIcon /> </span>
</span> <i class="ri-layout-3-fill icon-big" />
<i class="ri-layout-3-fill icon-big" /> <span class="title">Master Screen</span>
<span class="title">Master Screen</span>
</div>
{#if $store.currentPreviewItem.name === _layout.title && _layout.component.props._children}
<ComponentsHierarchyChildren
thisComponent={_layout.component.props}
components={_layout.component.props._children}
currentComponent={$store.currentComponentInfo} />
{/if}
</div> </div>
<style> {#if $store.currentPreviewItem.name === _layout.title && _layout.component.props._children}
.pagelayoutSection { <ComponentsHierarchyChildren
margin: 20px 0px 0px 0px; thisComponent={_layout.component.props}
} components={_layout.component.props._children}
currentComponent={$store.currentComponentInfo} />
{/if}
<style>
.title { .title {
margin-left: 10px; margin-left: 10px;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 400;
color: var(--ink); color: var(--ink);
} }