Skip to content

Commit

Permalink
Update message detail to show push preview
Browse files Browse the repository at this point in the history
  • Loading branch information
stnguyen90 committed Dec 4, 2023
1 parent d4f7a8b commit 9979dc3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { message } from './store';
import { ProviderTypes } from '../providerType.svelte';
import SMSPreview from './smsPreview.svelte';
import PushPreview from './pushPreview.svelte';
</script>

<Container>
Expand All @@ -14,6 +15,8 @@
<EmailPreview />
{:else if $message.providerType === ProviderTypes.Sms}
<SMSPreview />
{:else if $message.providerType === ProviderTypes.Push}
<PushPreview />
{/if}
<Delete />
</Container>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<script lang="ts">
import { CardGrid, Heading } from '$lib/components';
import { FormList, InputText, InputTextarea } from '$lib/elements/forms';
import { message } from './store';
import PushPhone from '../pushPhone.svelte';
</script>

<CardGrid>
<div class="grid-1-2-col-1 u-flex-vertical u-cross-start u-gap-16">
<Heading tag="h6" size="7">Preview</Heading>
<PushPhone title={$message.data.title} body={$message.data.body} />
</div>
<svelte:fragment slot="aside">
<FormList>
<InputText id="title" label="Title" disabled={true} bind:value={$message.data.title}>
</InputText>
<InputTextarea
id="message"
label="Message"
disabled={true}
bind:value={$message.data.body}>
</InputTextarea>
</FormList>
</svelte:fragment>

<svelte:fragment slot="actions">
<!-- TODO: Add support for editing draft messages -->
<!-- <Button disabled={$message.status !== 'draft'} on:click={() => console.log('click')}
>Edit message</Button> -->
</svelte:fragment>
</CardGrid>

0 comments on commit 9979dc3

Please sign in to comment.