Browse Source

Improve app list styles

pull/4023/head
Andrew Kingston 5 years ago
parent
commit
6958e860ef
  1. 4
      packages/builder/src/components/start/AppList.svelte
  2. 2
      packages/builder/src/components/start/CreateAppModal.svelte
  3. 14
      packages/builder/src/pages/app/_layout.svelte
  4. 2
      packages/builder/src/pages/app/portal/apps/index.svelte

4
packages/builder/src/components/start/AppList.svelte

@ -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>

2
packages/builder/src/components/start/CreateAppModal.svelte

@ -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)

14
packages/builder/src/pages/app/_layout.svelte

@ -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}

2
packages/builder/src/pages/app/portal/apps/index.svelte

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

Loading…
Cancel
Save