1
0
Fork 0
mirror of synced 2024-10-01 17:47:46 +13:00

Improve app list styles

This commit is contained in:
Andrew Kingston 2021-05-06 22:28:50 +01:00
parent 5a642071d6
commit 6958e860ef
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