Update style of component selection list and improve routing redirects

This commit is contained in:
Andrew Kingston 2022-04-26 09:45:16 +01:00
parent 943dcc7afa
commit 70624a4d97
3 changed files with 11 additions and 5 deletions

View File

@ -134,7 +134,9 @@
gap: var(--spacing-s); gap: var(--spacing-s);
padding-top: 4px; padding-top: 4px;
transition: background 130ms ease-out; transition: background 130ms ease-out;
line-height: 1.2; }
.component :global(.spectrum-Body) {
line-height: 1.2 !important;
} }
.component:hover { .component:hover {
cursor: pointer; cursor: pointer;

View File

@ -1,12 +1,14 @@
<script> <script>
import { store } from "builderStore" import { store, selectedScreen } from "builderStore"
import { onMount } from "svelte" import { onMount } from "svelte"
import { redirect } from "@roxi/routify" import { redirect } from "@roxi/routify"
let loaded = false let loaded = false
onMount(() => { onMount(() => {
if ($store.screens?.length) { if ($selectedScreen) {
$redirect(`./${$selectedScreen._id}`)
} else if ($store.screens?.length) {
$redirect(`./${$store.screens[0]._id}`) $redirect(`./${$store.screens[0]._id}`)
} else { } else {
loaded = true loaded = true

View File

@ -1,12 +1,14 @@
<script> <script>
import { store } from "builderStore" import { store, selectedScreen } from "builderStore"
import { onMount } from "svelte" import { onMount } from "svelte"
import { redirect } from "@roxi/routify" import { redirect } from "@roxi/routify"
let loaded = false let loaded = false
onMount(() => { onMount(() => {
if ($store.screens?.length) { if ($selectedScreen) {
$redirect(`./${$selectedScreen._id}`)
} else if ($store.screens?.length) {
$redirect(`./${$store.screens[0]._id}`) $redirect(`./${$store.screens[0]._id}`)
} else { } else {
loaded = true loaded = true