testing layout

This commit is contained in:
Arman committed 2023-05-09 10:25:56 +02:00
1 parent 3a27a00e3d
commit 4466cdd7a6
2 files changed
+66 -57

No files matched your search

@@ -14,6 +14,7 @@
import { baseEmailTemplate, emailTemplate } from './strote';
import { deepEqual } from '$lib/helpers/object';
export let loading = false;
let openResetModal = false;
async function saveEmailTemplate() {
@@ -50,49 +51,63 @@
$: isButtonDisabled = deepEqual($emailTemplate, $baseEmailTemplate);
</script>
<Form onSubmit={saveEmailTemplate}>
<FormList gap={8}>
<InputText
id="senderName"
label="Sender Name"
bind:value={$emailTemplate.senderName}
placeholder={'{{project}}'} />
<InputEmail
bind:value={$emailTemplate.senderEmail}
id="senderEmail"
label="Sender Email"
placeholder="Enter sender email" />
<InputEmail id="replyTo" label="Reply to" placeholder="DoNotReply" />
{#if $$slots.default}
<li style="margin-block: 1rem;">
<p class="text">
Click to copy variables for the fields below. Learn more <a
class="link"
href="#">here</a
>.
</p>
<div class="u-margin-block-start-16 u-flex u-gap-8">
<slot />
</div>
</li>
{/if}
<InputText
bind:value={$emailTemplate.subject}
id="subject"
label="Subject"
placeholder="Enter subject" />
<InputTextarea
bind:value={$emailTemplate.message}
id="message"
label="Message"
placeholder="Enter your message"
tooltip="Set up an SMTP server to edit the message body"
readonly={!$project.smtpEnabled} />
<div class="u-flex u-gap-32 u-main-end">
<Button on:click={() => (openResetModal = true)} text>Reset changes</Button>
<Button submit disabled={isButtonDisabled}>Update</Button>
{#if loading}
<div
class="u-width-full-100 u-flex u-flex-vertical u-main-center u-cross-center u-gap-16 u-margin-block-start-32">
<div class="loader" />
<p class="text">Loading template...</p>
</div>
{/if}
<div class:u-opacity-0={loading} style={loading ? 'pointer-events: none' : ''}>
<Form onSubmit={saveEmailTemplate}>
<div class="box">
<FormList gap={8}>
<InputText
id="senderName"
label="Sender Name"
bind:value={$emailTemplate.senderName}
placeholder={'{{project}}'} />
<InputEmail
bind:value={$emailTemplate.senderEmail}
id="senderEmail"
label="Sender Email"
placeholder="Enter sender email" />
<InputEmail id="replyTo" label="Reply to" placeholder="DoNotReply" />
{#if $$slots.default}
<li style="margin-block: 1rem;">
<p class="text">
Click to copy variables for the fields below. Learn more <a
class="link"
href="#">here</a
>.
</p>
<div class="u-margin-block-start-16 u-flex u-gap-8">
<slot />
</div>
</li>
{/if}
<InputText
bind:value={$emailTemplate.subject}
id="subject"
label="Subject"
placeholder="Enter subject" />
<InputTextarea
bind:value={$emailTemplate.message}
id="message"
label="Message"
placeholder="Enter your message"
tooltip="Set up an SMTP server to edit the message body"
readonly={!$project.smtpEnabled} />
</FormList>
</div>
</FormList>
</Form>
<div class="box">
<div class="u-flex u-gap-32 u-main-end u-margin-block-start-24">
<Button on:click={() => (openResetModal = true)} text>Reset changes</Button>
<Button submit disabled={isButtonDisabled}>Update</Button>
</div>
</div>
</Form>
</div>
<ResetEmail bind:show={openResetModal} />
@@ -31,19 +31,13 @@
}
</script>
<div class="box u-margin-block-start-16" style:--box-border-radius="var(--border-radius-small)">
<LocaleOptions {localeCodes} on:select={onLocaleChange} bind:value={locale} />
{#if loading}
<div
class="u-width-full-100 u-flex u-flex-vertical u-main-center u-cross-center u-gap-16 u-margin-block-start-32">
<div class="loader" />
<p class="text">Loading template...</p>
</div>
{/if}
<div class:u-opacity-0={loading} style={loading ? 'pointer-events: none' : ''}>
<EmailTemplate>
<Id value={'{{name}}'}>{'{{name}}'}</Id>
<Id value={'{{project}}'}>{'{{project}}'}</Id>
</EmailTemplate>
<div class="boxes-wrapper u-margin-block-start-16">
<div class="box" style:--box-border-radius="var(--border-radius-small)">
<LocaleOptions {localeCodes} on:select={onLocaleChange} bind:value={locale} />
</div>
<EmailTemplate bind:loading>
<Id value={'{{name}}'}>{'{{name}}'}</Id>
<Id value={'{{project}}'}>{'{{project}}'}</Id>
</EmailTemplate>
</div>