From d638ed888211159a6a11023abc9fa2ac805c855d Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:08:49 +0530 Subject: [PATCH] choe: icon list sectoin improvement (#4890) --- .../ui/src/emoji/emoji-icon-picker-new.tsx | 2 +- packages/ui/src/emoji/emoji-icon-picker.tsx | 2 +- packages/ui/src/emoji/icons-list.tsx | 138 +++++++++--------- packages/ui/src/emoji/lucide-icons-list.tsx | 138 +++++++++--------- 4 files changed, 142 insertions(+), 138 deletions(-) diff --git a/packages/ui/src/emoji/emoji-icon-picker-new.tsx b/packages/ui/src/emoji/emoji-icon-picker-new.tsx index 557b39658..a8651b349 100644 --- a/packages/ui/src/emoji/emoji-icon-picker-new.tsx +++ b/packages/ui/src/emoji/emoji-icon-picker-new.tsx @@ -112,7 +112,7 @@ export const EmojiIconPicker: React.FC = (props) => { }} /> - + { diff --git a/packages/ui/src/emoji/emoji-icon-picker.tsx b/packages/ui/src/emoji/emoji-icon-picker.tsx index c531dd168..ea3fcf002 100644 --- a/packages/ui/src/emoji/emoji-icon-picker.tsx +++ b/packages/ui/src/emoji/emoji-icon-picker.tsx @@ -112,7 +112,7 @@ export const CustomEmojiIconPicker: React.FC = (props) => { }} /> - + { diff --git a/packages/ui/src/emoji/icons-list.tsx b/packages/ui/src/emoji/icons-list.tsx index 6575ae8f0..e0bb87b37 100644 --- a/packages/ui/src/emoji/icons-list.tsx +++ b/packages/ui/src/emoji/icons-list.tsx @@ -41,80 +41,82 @@ export const IconsList: React.FC = (props) => { return ( <> -
-
setIsInputFocused(true)} - onBlur={() => setIsInputFocused(false)} - > - - setQuery(e.target.value)} - className="text-[1rem] border-none p-0 h-full w-full " - /> -
-
-
- {showHexInput ? ( -
- - HEX - # +
+
+
setIsInputFocused(true)} + onBlur={() => setIsInputFocused(false)} + > + { - const value = e.target.value; - setHexValue(value); - if (/^[0-9A-Fa-f]{6}$/.test(value)) setActiveColor(adjustColorForContrast(`#${value}`)); - }} - className="flex-grow pl-0 text-xs text-custom-text-200" - mode="true-transparent" - autoFocus + placeholder="Search" + value={query} + onChange={(e) => setQuery(e.target.value)} + className="text-[1rem] border-none p-0 h-full w-full " />
- ) : ( - DEFAULT_COLORS.map((curCol) => ( - - )) - )} -
+
{showHexInput ? ( - +
+ + HEX + # + { + const value = e.target.value; + setHexValue(value); + if (/^[0-9A-Fa-f]{6}$/.test(value)) setActiveColor(adjustColorForContrast(`#${value}`)); + }} + className="flex-grow pl-0 text-xs text-custom-text-200" + mode="true-transparent" + autoFocus + /> +
) : ( - # + DEFAULT_COLORS.map((curCol) => ( + + )) )} - -
-
- -

Colors will be adjusted to ensure sufficient contrast.

+ +
+
+ +

Colors will be adjusted to ensure sufficient contrast.

+
{filteredArray.map((icon) => ( diff --git a/packages/ui/src/emoji/lucide-icons-list.tsx b/packages/ui/src/emoji/lucide-icons-list.tsx index 799f0919d..5ffda34e6 100644 --- a/packages/ui/src/emoji/lucide-icons-list.tsx +++ b/packages/ui/src/emoji/lucide-icons-list.tsx @@ -31,80 +31,82 @@ export const LucideIconsList: React.FC = (props) => { return ( <> -
-
setIsInputFocused(true)} - onBlur={() => setIsInputFocused(false)} - > - - setQuery(e.target.value)} - className="text-[1rem] border-none p-0 h-full w-full " - /> -
-
-
- {showHexInput ? ( -
- - HEX - # +
+
+
setIsInputFocused(true)} + onBlur={() => setIsInputFocused(false)} + > + { - const value = e.target.value; - setHexValue(value); - if (/^[0-9A-Fa-f]{6}$/.test(value)) setActiveColor(adjustColorForContrast(`#${value}`)); - }} - className="flex-grow pl-0 text-xs text-custom-text-200" - mode="true-transparent" - autoFocus + placeholder="Search" + value={query} + onChange={(e) => setQuery(e.target.value)} + className="text-[1rem] border-none p-0 h-full w-full " />
- ) : ( - DEFAULT_COLORS.map((curCol) => ( - - )) - )} -
+
{showHexInput ? ( - +
+ + HEX + # + { + const value = e.target.value; + setHexValue(value); + if (/^[0-9A-Fa-f]{6}$/.test(value)) setActiveColor(adjustColorForContrast(`#${value}`)); + }} + className="flex-grow pl-0 text-xs text-custom-text-200" + mode="true-transparent" + autoFocus + /> +
) : ( - # + DEFAULT_COLORS.map((curCol) => ( + + )) )} - -
-
- -

Colors will be adjusted to ensure sufficient contrast.

+ +
+
+ +

Colors will be adjusted to ensure sufficient contrast.

+
{filteredArray.map((icon) => (