From d9c9e30382360bbade8844f7a10813bafbdb1ff5 Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Mon, 7 Oct 2024 14:18:09 +0500 Subject: [PATCH] fix(icon-picker-modal): use icon that auto generated1 --- .../IconPicker/icons.ts | 191 ------------------ .../IconPicker/index.tsx | 8 +- .../BlueprintModal/Body/Editor/index.tsx | 6 +- src/stores/useAppStore/index.ts | 2 +- 4 files changed, 8 insertions(+), 199 deletions(-) delete mode 100644 src/components/ModalsContainer/BlueprintModal/Body/Editor/ColorPickerPopover/ColorPickerPopoverView/IconPicker/icons.ts diff --git a/src/components/ModalsContainer/BlueprintModal/Body/Editor/ColorPickerPopover/ColorPickerPopoverView/IconPicker/icons.ts b/src/components/ModalsContainer/BlueprintModal/Body/Editor/ColorPickerPopover/ColorPickerPopoverView/IconPicker/icons.ts deleted file mode 100644 index e615f0100..000000000 --- a/src/components/ModalsContainer/BlueprintModal/Body/Editor/ColorPickerPopover/ColorPickerPopoverView/IconPicker/icons.ts +++ /dev/null @@ -1,191 +0,0 @@ -import AddCircleIcon from '~/components/Icons/AddCircleIcon' -import AddContentIcon from '~/components/Icons/AddContentIcon' -import AddSourceIcon from '~/components/Icons/AddSourceIcon' -import AiPauseIcon from '~/components/Icons/AiPauseIcon' -import AiPlayIcon from '~/components/Icons/AiPlayIcon' -import AiSummaryIcon from '~/components/Icons/AiSummaryIcon' -import AndroidIcon from '~/components/Icons/AndroidIcon' -import ArrowBackIcon from '~/components/Icons/ArrowBackIcon' -import ArrowForwardIcon from '~/components/Icons/ArrowForwardIcon' -import ArrowRightIcon from '~/components/Icons/ArrowRight' -import AudioIcon from '~/components/Icons/AudioIcon' -import BitcoinIcon from '~/components/Icons/BitcoinIcon' -import BoostIcon from '~/components/Icons/BoostIcon' -import BudgetIcon from '~/components/Icons/BudgetIcon' -import BuildIcon from '~/components/Icons/BuildIcon' -import CameraCenterIcon from '~/components/Icons/CameraCenterIcon' -import CheckedIcon from '~/components/Icons/CheckedIcon' -import CheckIcon from '~/components/Icons/CheckIcon' -import ChevronDownIcon from '~/components/Icons/ChevronDownIcon' -import ChevronLeftIcon from '~/components/Icons/ChevronLeftIcon' -import ChevronRightIcon from '~/components/Icons/ChevronRightIcon' -import ChevronUpIcon from '~/components/Icons/ChevronUpIcon' -import ClearIcon from '~/components/Icons/ClearIcon' -import ColorPickerIcon from '~/components/Icons/ColorPickerIcon' -import CommunitiesIcon from '~/components/Icons/CommunitiesIcon' -import CompassIcon from '~/components/Icons/CompassIcon' -import ConstructionIcon from '~/components/Icons/ConstructionIcon' -import ContentIcon from '~/components/Icons/ContentIcon' -import CopyIcon from '~/components/Icons/CopyIcon' -import CorporationIcon from '~/components/Icons/CorporationIcon' -import DeleteIcon from '~/components/Icons/DeleteIcon' -import DeleteNodeIcon from '~/components/Icons/DeleteNodeIcon' -import DesignServicesIcon from '~/components/Icons/DesignServicesIcon' -import DocumentIcon from '~/components/Icons/DocumentIcon' -import DownloadIcon from '~/components/Icons/DownloadIcon' -import EditIcon from '~/components/Icons/EditIcon' -import EditNodeIcon from '~/components/Icons/EditNodeIcon' -import EditTopicIcon from '~/components/Icons/EditTopicIcon' -import EpisodeIcon from '~/components/Icons/EpisodeIcon' -import EventIcon from '~/components/Icons/EventIcon' -import ExploreIcon from '~/components/Icons/ExploreIcon' -import FamilyHistoryIcon from '~/components/Icons/FamilyHistoryIcon' -import FeedbackIcon from '~/components/Icons/FeedbackIcon' -import FingerprintIcon from '~/components/Icons/FingerprintIcon' -import FlipIcon from '~/components/Icons/FlipIcon' -import FortIcon from '~/components/Icons/FortIcon' -import FunctionIcon from '~/components/Icons/FunctionIcon' -import GlobeIcon from '~/components/Icons/GlobeIcon' -import GrainIcon from '~/components/Icons/GrainIcon' -import HandymanIcon from '~/components/Icons/HandymanIcon' -import HardwareIcon from '~/components/Icons/HardwareIcon' -import HashTagIcon from '~/components/Icons/HashTag' -import HelpIcon from '~/components/Icons/HelpIcon' -import HomeIcon from '~/components/Icons/HomeIcon' -import InfoIcon from '~/components/Icons/InfoIcon' -import JoystickIcon from '~/components/Icons/JoystickIcon' -import LinkIcon from '~/components/Icons/LinkIcon' -import MenuIcon from '~/components/Icons/MenuIcon' -import MergeIcon from '~/components/Icons/MergeIcon' -import MoneyIcon from '~/components/Icons/MoneyIcon' -import NodeCircleIcon from '~/components/Icons/NodeCircleIcon' -import NodesIcon from '~/components/Icons/NodesIcon' -import NotesIcon from '~/components/Icons/NotesIcon' -import OrganizationIcon from '~/components/Icons/OrganizationIcon' -import PauseIcon from '~/components/Icons/PauseIcon' -import PersonAddIcon from '~/components/Icons/PersonAdd' -import PersonIcon from '~/components/Icons/PersonIcon' -import PhoneIcon from '~/components/Icons/PhoneIcon' -import PlaceIcon from '~/components/Icons/PlaceIcon' -import PlayIcon from '~/components/Icons/PlayIcon' -import PlusIcon from '~/components/Icons/PlusIcon' -import PublicIcon from '~/components/Icons/PublicIcon' -import QrCodeIcon from '~/components/Icons/QrCodeIcon' -import ReloadIcon from '~/components/Icons/ReloadIcon' -import RobotIcon from '~/components/Icons/RobotIcon' -import SaveIcon from '~/components/Icons/SaveIcon' -import SchoolIcon from '~/components/Icons/SchoolIcon' -import SearchFilterCloseIcon from '~/components/Icons/SearchFilterCloseIcon' -import SearchFilterIcon from '~/components/Icons/SearchFilterIcon' -import SearchIcon from '~/components/Icons/SearchIcon' -import SensorsIcon from '~/components/Icons/SensorsIcon' -import SettingsIcon from '~/components/Icons/SettingsIcon' -import ShieldPersonIcon from '~/components/Icons/ShieldPersonIcon' -import SortFilterIcon from '~/components/Icons/SortFilterIcon' -import SoundIcon from '~/components/Icons/SoundIcon' -import SourcesIcon from '~/components/Icons/SourcesIcon' -import SourcesTableIcon from '~/components/Icons/SourcesTableIcon' -import SuccessFeedbackIcon from '~/components/Icons/SucessFeedBackIcon' -import SumFunctionIcon from '~/components/Icons/SumFunctionIcon' -import ThreeDotsIcon from '~/components/Icons/ThreeDotsIcons' -import TwitterIcon from '~/components/Icons/TwitterIcon' -import VideoIcon from '~/components/Icons/VideoIcon' -import VisibilityOffIcon from '~/components/Icons/VisibilityOff' -import VisibilityOnIcon from '~/components/Icons/VisibilityOn' - -export const icons = { - AddCircleIcon, - AddContentIcon, - AddSourceIcon, - AiPauseIcon, - AiPlayIcon, - AiSummaryIcon, - AndroidIcon, - ArrowBackIcon, - ArrowForwardIcon, - ArrowRightIcon, - AudioIcon, - BitcoinIcon, - BoostIcon, - BudgetIcon, - BuildIcon, - CameraCenterIcon, - CheckedIcon, - CheckIcon, - ChevronDownIcon, - ChevronLeftIcon, - ChevronRightIcon, - ChevronUpIcon, - ClearIcon, - ColorPickerIcon, - CommunitiesIcon, - CompassIcon, - ConstructionIcon, - ContentIcon, - CopyIcon, - CorporationIcon, - DeleteIcon, - DeleteNodeIcon, - DesignServicesIcon, - DocumentIcon, - DownloadIcon, - EditIcon, - EditNodeIcon, - EditTopicIcon, - EpisodeIcon, - EventIcon, - ExploreIcon, - FamilyHistoryIcon, - FeedbackIcon, - FingerprintIcon, - FlipIcon, - FortIcon, - FunctionIcon, - GlobeIcon, - GrainIcon, - HandymanIcon, - HardwareIcon, - HashTagIcon, - HelpIcon, - HomeIcon, - InfoIcon, - JoystickIcon, - LinkIcon, - MenuIcon, - MergeIcon, - MoneyIcon, - NodeCircleIcon, - NodesIcon, - NotesIcon, - OrganizationIcon, - PauseIcon, - PersonAddIcon, - PersonIcon, - PhoneIcon, - PlaceIcon, - PlayIcon, - PlusIcon, - PublicIcon, - QrCodeIcon, - ReloadIcon, - RobotIcon, - SaveIcon, - SchoolIcon, - SearchFilterCloseIcon, - SearchFilterIcon, - SearchIcon, - SensorsIcon, - SettingsIcon, - ShieldPersonIcon, - SortFilterIcon, - SoundIcon, - SourcesIcon, - SourcesTableIcon, - SuccessFeedbackIcon, - SumFunctionIcon, - ThreeDotsIcon, - TwitterIcon, - VideoIcon, - VisibilityOffIcon, - VisibilityOnIcon, -} diff --git a/src/components/ModalsContainer/BlueprintModal/Body/Editor/ColorPickerPopover/ColorPickerPopoverView/IconPicker/index.tsx b/src/components/ModalsContainer/BlueprintModal/Body/Editor/ColorPickerPopover/ColorPickerPopoverView/IconPicker/index.tsx index 9ae881364..2a198f0bb 100644 --- a/src/components/ModalsContainer/BlueprintModal/Body/Editor/ColorPickerPopover/ColorPickerPopoverView/IconPicker/index.tsx +++ b/src/components/ModalsContainer/BlueprintModal/Body/Editor/ColorPickerPopover/ColorPickerPopoverView/IconPicker/index.tsx @@ -1,6 +1,6 @@ import React from 'react' import styled, { css } from 'styled-components' -import { icons } from './icons' +import { Icons } from '~/components/Icons' import { Flex } from '~/components/common/Flex' import { colors } from '~/utils' import { useAppStore } from '~/stores/useAppStore' @@ -18,8 +18,8 @@ export const IconPicker: React.FC = () => { - {Object.keys(icons).map((iconKey) => { - const IconComponent = icons[iconKey as keyof typeof icons] + {Object.keys(Icons).map((iconKey) => { + const IconComponent = Icons[iconKey as keyof typeof Icons] return ( { isSelected={selectedIcon === iconKey} onClick={() => handleIconChange(iconKey)} > - + {IconComponent && } ) })} diff --git a/src/components/ModalsContainer/BlueprintModal/Body/Editor/index.tsx b/src/components/ModalsContainer/BlueprintModal/Body/Editor/index.tsx index ac0f748a9..b77a7499f 100644 --- a/src/components/ModalsContainer/BlueprintModal/Body/Editor/index.tsx +++ b/src/components/ModalsContainer/BlueprintModal/Body/Editor/index.tsx @@ -18,7 +18,7 @@ import { useModal } from '~/stores/useModalStore' import { colors } from '~/utils' import { CreateCustomNodeAttribute } from './CustomAttributesStep' import MediaOptions from './MediaOptions' -import { icons } from './ColorPickerPopover/ColorPickerPopoverView/IconPicker/icons' +import { Icons } from '~/components/Icons' import { convertAttributes, parsedObjProps, parseJson } from './utils' import { ColorPickerPopover } from './ColorPickerPopover' import { useAppStore } from '~/stores/useAppStore' @@ -480,7 +480,7 @@ export const Editor = ({ return undefined }, [selectedSchema, attributes]) - const IconComponent = icons[selectedIcon as keyof typeof icons] + const IconComponent = Icons[selectedIcon as keyof typeof Icons] return ( @@ -533,7 +533,7 @@ export const Editor = ({ /> - + {IconComponent && } diff --git a/src/stores/useAppStore/index.ts b/src/stores/useAppStore/index.ts index 039089f18..7a68b8e15 100644 --- a/src/stores/useAppStore/index.ts +++ b/src/stores/useAppStore/index.ts @@ -50,7 +50,7 @@ const defaultData = { currentPlayingAudio: null, showCollapseButton: true, selectedColor: '#962777', - selectedIcon: 'ColorPickerIcon', + selectedIcon: 'ConstructionIcon', } export const useAppStore = create((set, get) => ({