replace remix icons in NavItem component

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-23 13:52:34 +02:00
parent 311d4f9d65
commit cd5b617610
7 changed files with 36 additions and 36 deletions

View File

@ -20,10 +20,11 @@
{#each $automationStore.automations as automation, idx} {#each $automationStore.automations as automation, idx}
<NavItem <NavItem
border={idx > 0} border={idx > 0}
icon="ri-stackshare-line" icon="ShareAndroid"
text={automation.name} text={automation.name}
selected={automation._id === selectedAutomationId} selected={automation._id === selectedAutomationId}
on:click={() => selectAutomation(automation)}> on:click={() => selectAutomation(automation)}
>
<EditAutomationPopover {automation} /> <EditAutomationPopover {automation} />
</NavItem> </NavItem>
{/each} {/each}

View File

@ -33,22 +33,25 @@
border={idx > 0} border={idx > 0}
text={datasource.name} text={datasource.name}
selected={$datasources.selected === datasource._id} selected={$datasources.selected === datasource._id}
on:click={() => selectDatasource(datasource)}> on:click={() => selectDatasource(datasource)}
>
<div class="datasource-icon" slot="icon"> <div class="datasource-icon" slot="icon">
<svelte:component <svelte:component
this={ICONS[datasource.source]} this={ICONS[datasource.source]}
height="18" height="18"
width="18" /> width="18"
/>
</div> </div>
<EditDatasourcePopover {datasource} /> <EditDatasourcePopover {datasource} />
</NavItem> </NavItem>
{#each $queries.list.filter(query => query.datasourceId === datasource._id) as query} {#each $queries.list.filter((query) => query.datasourceId === datasource._id) as query}
<NavItem <NavItem
indentLevel={1} indentLevel={1}
icon="ri-eye-line" icon="SQLQuery"
text={query.name} text={query.name}
selected={$queries.selected === query._id} selected={$queries.selected === query._id}
on:click={() => onClickQuery(query)}> on:click={() => onClickQuery(query)}
>
<EditQueryPopover {query} /> <EditQueryPopover {query} />
</NavItem> </NavItem>
{/each} {/each}

View File

@ -34,10 +34,11 @@
{#each $tables.list as table, idx} {#each $tables.list as table, idx}
<NavItem <NavItem
border={idx > 0} border={idx > 0}
icon={`ri-${table._id === TableNames.USERS ? 'user' : 'table'}-line`} icon={table._id === TableNames.USERS ? "UserGroup" : "Table"}
text={table.name} text={table.name}
selected={selectedView === `all_${table._id}`} selected={selectedView === `all_${table._id}`}
on:click={() => selectTable(table)}> on:click={() => selectTable(table)}
>
{#if table._id !== TableNames.USERS} {#if table._id !== TableNames.USERS}
<EditTablePopover {table} /> <EditTablePopover {table} />
{/if} {/if}
@ -48,9 +49,11 @@
icon="ri-eye-line" icon="ri-eye-line"
text={viewName} text={viewName}
selected={selectedView === viewName} selected={selectedView === viewName}
on:click={() => onClickView(table, viewName)}> on:click={() => onClickView(table, viewName)}
>
<EditViewPopover <EditViewPopover
view={{ name: viewName, ...table.views[viewName] }} /> view={{ name: viewName, ...table.views[viewName] }}
/>
</NavItem> </NavItem>
{/each} {/each}
{/each} {/each}

View File

@ -35,7 +35,7 @@
<slot name="icon" /> <slot name="icon" />
{#if icon} {#if icon}
<div class="icon"><i class={icon} /></div> <div class="icon"><Icon s name={icon} /></div>
{/if} {/if}
<div class="text">{text}</div> <div class="text">{text}</div>
{#if withActions} {#if withActions}

View File

@ -35,11 +35,11 @@
route.subpaths[selectedScreen?.routing?.route] !== undefined route.subpaths[selectedScreen?.routing?.route] !== undefined
$: routeOpened = routeManuallyOpened || routeSelected || hasSearchMatch $: routeOpened = routeManuallyOpened || routeSelected || hasSearchMatch
const changeScreen = screenId => { const changeScreen = (screenId) => {
store.actions.screens.select(screenId) store.actions.screens.select(screenId)
} }
const getAllScreens = route => { const getAllScreens = (route) => {
let screens = [] let screens = []
Object.entries(route.subpaths).forEach(([route, subpath]) => { Object.entries(route.subpaths).forEach(([route, subpath]) => {
Object.entries(subpath.screens).forEach(([role, id]) => { Object.entries(subpath.screens).forEach(([role, id]) => {
@ -51,7 +51,7 @@
const getFilteredScreens = (screens, searchString) => { const getFilteredScreens = (screens, searchString) => {
return screens.filter( return screens.filter(
screen => !searchString || screen.route.includes(searchString) (screen) => !searchString || screen.route.includes(searchString)
) )
} }
@ -65,23 +65,25 @@
{#if !noSearchMatch} {#if !noSearchMatch}
<NavItem <NavItem
icon="ri-folder-line" icon="FolderOutline"
text={path} text={path}
on:click={toggleManuallyOpened} on:click={toggleManuallyOpened}
opened={routeOpened} opened={routeOpened}
{border} {border}
withArrow={route.subpaths} /> withArrow={route.subpaths}
/>
{#if routeOpened} {#if routeOpened}
{#each filteredScreens as screen (screen.id)} {#each filteredScreens as screen (screen.id)}
<NavItem <NavItem
icon="ri-artboard-2-line" icon="WebPage"
indentLevel={indent || 1} indentLevel={indent || 1}
selected={$store.selectedScreenId === screen.id} selected={$store.selectedScreenId === screen.id}
opened={$store.selectedScreenId === screen.id} opened={$store.selectedScreenId === screen.id}
text={ROUTE_NAME_MAP[screen.route]?.[screen.role] || screen.route} text={ROUTE_NAME_MAP[screen.route]?.[screen.role] || screen.route}
withArrow={route.subpaths} withArrow={route.subpaths}
on:click={() => changeScreen(screen.id)}> on:click={() => changeScreen(screen.id)}
>
<ScreenDropdownMenu screenId={screen.id} /> <ScreenDropdownMenu screenId={screen.id} />
</NavItem> </NavItem>
{#if selectedScreen?._id === screen.id} {#if selectedScreen?._id === screen.id}
@ -89,7 +91,8 @@
level={1} level={1}
components={selectedScreen.props._children} components={selectedScreen.props._children}
currentComponent={$selectedComponent} currentComponent={$selectedComponent}
{dragDropStore} /> {dragDropStore}
/>
{/if} {/if}
{/each} {/each}
{/if} {/if}

View File

@ -93,11 +93,6 @@
</Tab> </Tab>
<Tab title="Layouts"> <Tab title="Layouts">
<div class="tab-content-padding"> <div class="tab-content-padding">
<i
on:click={modal.show}
data-cy="new-layout"
class="ri-add-circle-fill"
/>
{#each $store.layouts as layout, idx (layout._id)} {#each $store.layouts as layout, idx (layout._id)}
<Layout {layout} border={idx > 0} /> <Layout {layout} border={idx > 0} />
{/each} {/each}

View File

@ -1,20 +1,13 @@
<script> <script>
import { goto } from "@roxi/routify"
import { FrontendTypes } from "constants"
import ComponentTree from "./ComponentNavigationTree/ComponentTree.svelte" import ComponentTree from "./ComponentNavigationTree/ComponentTree.svelte"
import LayoutDropdownMenu from "./ComponentNavigationTree/LayoutDropdownMenu.svelte" import LayoutDropdownMenu from "./ComponentNavigationTree/LayoutDropdownMenu.svelte"
import initDragDropStore from "./ComponentNavigationTree/dragDropStore" import initDragDropStore from "./ComponentNavigationTree/dragDropStore"
import NavItem from "components/common/NavItem.svelte" import NavItem from "components/common/NavItem.svelte"
import { last } from "lodash/fp" import { store, selectedComponent } from "builderStore"
import { store, currentAsset, selectedComponent } from "builderStore"
import { writable } from "svelte/store"
export let layout export let layout
export let border export let border
let confirmDeleteDialog
let componentToDelete = ""
const dragDropStore = initDragDropStore() const dragDropStore = initDragDropStore()
const selectLayout = () => { const selectLayout = () => {
@ -24,12 +17,13 @@
<NavItem <NavItem
{border} {border}
icon="ri-layout-3-line" icon="ClassicGridView"
text={layout.name} text={layout.name}
withArrow withArrow
selected={$store.selectedLayoutId === layout._id} selected={$store.selectedLayoutId === layout._id}
opened={$store.selectedLayoutId === layout._id} opened={$store.selectedLayoutId === layout._id}
on:click={selectLayout}> on:click={selectLayout}
>
<LayoutDropdownMenu {layout} /> <LayoutDropdownMenu {layout} />
</NavItem> </NavItem>
@ -37,5 +31,6 @@
<ComponentTree <ComponentTree
components={layout.props._children} components={layout.props._children}
currentComponent={$selectedComponent} currentComponent={$selectedComponent}
{dragDropStore} /> {dragDropStore}
/>
{/if} {/if}