Skip to content

Commit

Permalink
fix(messaging): fix user targets modal title and description
Browse files Browse the repository at this point in the history
The title and description should be different depending on whether you're adding a target to a message or a target to a topic.
  • Loading branch information
stnguyen90 authored and TorstenDittmann committed Feb 22, 2024
1 parent 9f6e605 commit e67c7e7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@
dispatch('addTopics', e.detail);
}} />
<UserTargetsModal
title="Select targets"
{providerType}
bind:show={showUserTargets}
bind:targetsById={$targetsById}
on:update={(e) => {
showUserTargets = false;
dispatch('addTargets', e.detail);
}} />
}}>
<svelte:fragment slot="description"
>Select existing targets to which you want to send this message.</svelte:fragment>
</UserTargetsModal>
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,18 @@
{/if}
</Container>

<UserTargetsModal bind:show={showAdd} bind:targetsById={$targetsById} on:update={addTargets} />
<UserTargetsModal
title="Select subscribers"
bind:show={showAdd}
bind:targetsById={$targetsById}
on:update={addTargets}>
<svelte:fragment slot="description">
<p class="text">
Add subscribers to this topic by selecting the targets for directing messages. <a
href="https://appwrite.io/docs/products/messaging/topics"
target="_blank"
rel="noopener noreferrer"
class="link">Learn more about subscribers.</a>
</p>
</svelte:fragment>
</UserTargetsModal>
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
import { createEventDispatcher } from 'svelte';
import ProviderType from './providerType.svelte';
export let title: string;
export let show: boolean;
export let targetsById: Record<string, Models.Target>;
export let providerType: MessagingProviderType = null;
export let title = 'Select subscribers';
const dispatch = createEventDispatcher();
Expand Down Expand Up @@ -118,13 +118,8 @@
</script>

<Modal {title} bind:show onSubmit={submit} on:close={reset} size="big" headerDivider={false}>
<p class="text">
Add subscribers to this topic by selecting the targets for directing messages. <a
href="https://appwrite.io/docs/products/messaging/topics"
target="_blank"
rel="noopener noreferrer"
class="link">Learn more about subscribers.</a>
</p>
<slot name="description" />

<InputSearch
autofocus
disabled={totalResults === 0 && !search}
Expand Down

0 comments on commit e67c7e7

Please sign in to comment.