From 04e172deaca43d31eadb73915ccd21b2b1667b03 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 2 Apr 2024 06:12:45 -0700 Subject: [PATCH] refac: share chat modal styling update --- src/lib/components/chat/ShareChatModal.svelte | 97 +++++++++++++------ src/lib/components/icons/Link.svelte | 16 +++ src/lib/components/layout/Navbar.svelte | 6 +- 3 files changed, 86 insertions(+), 33 deletions(-) create mode 100644 src/lib/components/icons/Link.svelte diff --git a/src/lib/components/chat/ShareChatModal.svelte b/src/lib/components/chat/ShareChatModal.svelte index ac1bfef9f..19f8d7f1e 100644 --- a/src/lib/components/chat/ShareChatModal.svelte +++ b/src/lib/components/chat/ShareChatModal.svelte @@ -1,6 +1,7 @@ - -
- - - - -
-
{$i18n.t('or')}
- + +
+
+
{$i18n.t('Share Chat')}
+
+ +
+
+ Messages you send after creating your link won't be shared. Anyone with the URL will be able + to view the shared chat. +
+ +
+
+
+ + + +
+
+
{$i18n.t('or')}
+ +
+
+
+
diff --git a/src/lib/components/icons/Link.svelte b/src/lib/components/icons/Link.svelte new file mode 100644 index 000000000..9f1a72311 --- /dev/null +++ b/src/lib/components/icons/Link.svelte @@ -0,0 +1,16 @@ + + + + + + diff --git a/src/lib/components/layout/Navbar.svelte b/src/lib/components/layout/Navbar.svelte index 198aa97d4..35ac6bfdd 100644 --- a/src/lib/components/layout/Navbar.svelte +++ b/src/lib/components/layout/Navbar.svelte @@ -70,14 +70,16 @@ console.log('shareLocal', chat); if (chat.share_id) { const shareUrl = `${window.location.origin}/s/${chat.share_id}`; - toast.info( + toast.success( $i18n.t('Chat is already shared at {{shareUrl}}, copied to clipboard', { shareUrl }) ); copyToClipboard(shareUrl); } else { const sharedChat = await shareChatById(localStorage.token, $chatId); const shareUrl = `${window.location.origin}/s/${sharedChat.id}`; - toast.info($i18n.t('Chat is now shared at {{shareUrl}}, copied to clipboard', { shareUrl })); + toast.success( + $i18n.t('Chat is now shared at {{shareUrl}}, copied to clipboard', { shareUrl }) + ); copyToClipboard(shareUrl); } };