From 3d6ac856ec057127e7cdf920d83ec487c574ac06 Mon Sep 17 00:00:00 2001 From: Piyush Bhatt <2023kuec2027@iiitkota.ac.in> Date: Mon, 6 Jan 2025 01:12:30 +0530 Subject: [PATCH 01/16] enhance Add Link modal --- .../src/views/ChatInput/ChatInput.styles.js | 2 +- .../src/views/ChatInput/InsertLinkToolBox.js | 71 ++++++++++++++----- .../src/views/SurfaceMenu/SurfaceItem.js | 2 +- 3 files changed, 56 insertions(+), 19 deletions(-) diff --git a/packages/react/src/views/ChatInput/ChatInput.styles.js b/packages/react/src/views/ChatInput/ChatInput.styles.js index 7aa85e40f1..9dcbd6ac24 100644 --- a/packages/react/src/views/ChatInput/ChatInput.styles.js +++ b/packages/react/src/views/ChatInput/ChatInput.styles.js @@ -122,7 +122,7 @@ export const getInsertLinkModalStyles = (theme) => { inputWithFormattingBox: css` border: 1px solid ${theme.colors.border}; border-radius: ${theme.radius}; - margin: 0.5rem 1rem; + margin: 0rem 1rem 0.5rem 1rem; &.focused { border: ${`1.5px solid ${theme.colors.ring}`}; } diff --git a/packages/react/src/views/ChatInput/InsertLinkToolBox.js b/packages/react/src/views/ChatInput/InsertLinkToolBox.js index 49e8e0d4ad..8fa8640835 100644 --- a/packages/react/src/views/ChatInput/InsertLinkToolBox.js +++ b/packages/react/src/views/ChatInput/InsertLinkToolBox.js @@ -1,5 +1,13 @@ import React, { useState } from 'react'; -import { Modal, Input, Button, useTheme } from '@embeddedchat/ui-elements'; +import { + Modal, + Input, + Button, + useTheme, + Icon, + Box, +} from '@embeddedchat/ui-elements'; +import { css } from '@emotion/react'; import { getInsertLinkModalStyles } from './ChatInput.styles'; const InsertLinkToolBox = ({ @@ -9,7 +17,7 @@ const InsertLinkToolBox = ({ }) => { const { theme } = useTheme(); const styles = getInsertLinkModalStyles(theme); - const [linkText, setLinkText] = useState(selectedText || 'Text'); + const [linkText, setLinkText] = useState(selectedText); const [linkUrl, setLinkUrl] = useState(null); const handleLinkTextOnChange = (e) => { @@ -21,23 +29,52 @@ const InsertLinkToolBox = ({ return ( - - Add link + + {' '} + Add Link - - - + + + + Link Text + + + + Link URL + + +