|
|
@ -1,5 +1,5 @@ |
|
|
<script> |
|
|
<script> |
|
|
import { Heading, Layout, Icon } from "@budibase/bbui" |
|
|
import { Heading, Layout, Icon, Body } from "@budibase/bbui" |
|
|
import Spinner from "components/common/Spinner.svelte" |
|
|
import Spinner from "components/common/Spinner.svelte" |
|
|
import api from "builderStore/api" |
|
|
import api from "builderStore/api" |
|
|
|
|
|
|
|
|
@ -7,6 +7,7 @@ |
|
|
|
|
|
|
|
|
async function fetchTemplates() { |
|
|
async function fetchTemplates() { |
|
|
const response = await api.get("/api/templates?type=app") |
|
|
const response = await api.get("/api/templates?type=app") |
|
|
|
|
|
console.log("Responded") |
|
|
return await response.json() |
|
|
return await response.json() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -19,6 +20,11 @@ |
|
|
<Spinner size="30" /> |
|
|
<Spinner size="30" /> |
|
|
</div> |
|
|
</div> |
|
|
{:then templates} |
|
|
{:then templates} |
|
|
|
|
|
{#if templates?.length > 0} |
|
|
|
|
|
<Body size="M">Select a template below, or start from scratch.</Body> |
|
|
|
|
|
{:else} |
|
|
|
|
|
<Body size="M">Start your app from scratch below.</Body> |
|
|
|
|
|
{/if} |
|
|
<div class="templates"> |
|
|
<div class="templates"> |
|
|
{#each templates as template} |
|
|
{#each templates as template} |
|
|
<div class="template" on:click={() => onSelect(template)}> |
|
|
<div class="template" on:click={() => onSelect(template)}> |
|
|
|