Improve app list styles

This commit is contained in:
Andrew Kingston 2021-05-06 22:28:50 +01:00
parent c3ea022f8b
commit 6a90f8cecb
4 changed files with 13 additions and 9 deletions

View File

@ -13,13 +13,13 @@
{/each}
</div>
{:else}
<div>No apps</div>
<div>No apps found.</div>
{/if}
<style>
.appList {
display: grid;
grid-gap: 50px;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
</style>

View File

@ -112,7 +112,7 @@
}
const userResp = await api.post(`/api/users/metadata/self`, user)
await userResp.json()
$goto(`./${appJson._id}`)
$goto(`/app/builder/${appJson._id}/design`)
} catch (error) {
console.error(error)
notifications.error(error)

View File

@ -4,24 +4,28 @@
import { auth } from "stores/backend"
import { admin } from "stores/portal"
let checked = false
let loaded = false
$: hasAdminUser = !!$admin?.checklist?.adminUser
onMount(async () => {
await admin.init()
await auth.checkAuth()
if (!$admin?.checklist?.adminUser) {
loaded = true
// Force creation of an admin user if one doesn't exist
if (!hasAdminUser) {
$goto("./admin")
}
checked = true
})
// Redirect to log in at any time if the user isn't authenticated
$: {
if (checked && !$auth.user) {
if (loaded && hasAdminUser && !$auth.user) {
$goto("./auth/login")
}
}
</script>
{#if checked}
{#if loaded}
<slot />
{/if}

View File

@ -65,7 +65,7 @@
{#if layout === "grid"}
<AppList />
{:else}
Table
Table view.
{/if}
</Layout>
<Modal