diff --git a/public/index.css b/public/index.css index 4fad9311f..54313292a 100644 --- a/public/index.css +++ b/public/index.css @@ -116,7 +116,8 @@ button.primary { color: var(--color-primary); border-color: var(--color-primary); } -button.primary:hover { +button.primary:hover, button.primary.active { + color: var(--color-background); background-color: var(--color-primary); } button.primary[disabled] { diff --git a/src/Form.svelte b/src/Form.svelte new file mode 100644 index 000000000..8f990b799 --- /dev/null +++ b/src/Form.svelte @@ -0,0 +1,71 @@ + + + + + + +
+ {#each fields as field} +
+ {field.label} +
+
+ +
+ {/each} +
diff --git a/src/base/register/Registration.svelte b/src/base/register/Registration.svelte index 676b704e2..fbfa40ac7 100644 --- a/src/base/register/Registration.svelte +++ b/src/base/register/Registration.svelte @@ -6,55 +6,62 @@ import Loading from '@app/Loading.svelte'; import Link from '@app/Link.svelte'; import Modal from '@app/Modal.svelte'; + import Form from '@app/Form.svelte'; + import type { Field } from '@app/Form.svelte'; export let subdomain: string; export let config: Config; + let editable = false; + let fields: Field[] = []; + + const loadRegistration = getRegistration(subdomain, config) + .then(registration => { + if (registration) { + fields = [ + { label: "Address", type: "text", placeholder: "Not set", + value: registration.address, editable: true }, + { label: "Owner", type: "text", placeholder: "", + value: registration.owner, editable: false }, + ]; + } + return registration; + }); + $: isOwner = (registration: Registration): boolean => { return registration.owner === ($session && $session.address); }; -{#await getRegistration(subdomain, config)} +{#await loadRegistration} {:then registration} {#if registration}
-

{subdomain}.{config.registrar.domain}

-
- -
Address
-
- {#if registration.address} - {registration.address} - {:else} - Not set - {/if} -
-
- -
- -
Owner
-
{registration.owner}
-
- -
-
+
+

{subdomain}.{config.registrar.domain}

+ + +
+
{:else}