Update style of component selection list and improve routing redirects
This commit is contained in:
parent
a063011c47
commit
831f76fb00
|
@ -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;
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue