From 7f5fdb9589c77dcb5e27c53f9891cf2015d435be Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Fri, 19 May 2023 16:35:51 +0530 Subject: [PATCH] fix: icon picker not working (#1080) * fix: icon picker not working * fix: project icon in analytics sidebar --- .../analytics/custom-analytics/sidebar.tsx | 34 +++++++++--- .../components/emoji-icon-picker/index.tsx | 14 ++--- .../components/emoji-icon-picker/types.d.ts | 10 +++- .../project/create-project-modal.tsx | 43 +++++++++++---- .../project/single-project-card.tsx | 13 +++-- .../project/single-sidebar-project.tsx | 13 ++++- apps/app/helpers/analytics.helper.ts | 1 - .../projects/[projectId]/settings/control.tsx | 27 +++++----- .../projects/[projectId]/settings/index.tsx | 53 +++++++++++++------ apps/app/types/projects.d.ts | 21 ++++++-- 10 files changed, 158 insertions(+), 71 deletions(-) diff --git a/apps/app/components/analytics/custom-analytics/sidebar.tsx b/apps/app/components/analytics/custom-analytics/sidebar.tsx index 5988e654d..26eb66d12 100644 --- a/apps/app/components/analytics/custom-analytics/sidebar.tsx +++ b/apps/app/components/analytics/custom-analytics/sidebar.tsx @@ -153,12 +153,21 @@ export const AnalyticsSidebar: React.FC = ({ return (
- {project.icon ? ( + {project.emoji ? ( - {String.fromCodePoint(parseInt(project.icon))} + {String.fromCodePoint(parseInt(project.emoji))} + ) : project.icon_prop ? ( +
+ + {project.icon_prop.name} + +
) : ( - + {project?.name.charAt(0)} )} @@ -254,12 +263,21 @@ export const AnalyticsSidebar: React.FC = ({ ) : (
- {projectDetails?.icon ? ( - - {String.fromCodePoint(parseInt(projectDetails.icon))} - + {projectDetails?.emoji ? ( +
+ {String.fromCodePoint(parseInt(projectDetails.emoji))} +
+ ) : projectDetails?.icon_prop ? ( +
+ + {projectDetails.icon_prop.name} + +
) : ( - + {projectDetails?.name.charAt(0)} )} diff --git a/apps/app/components/emoji-icon-picker/index.tsx b/apps/app/components/emoji-icon-picker/index.tsx index e52335e47..f8f8e54e9 100644 --- a/apps/app/components/emoji-icon-picker/index.tsx +++ b/apps/app/components/emoji-icon-picker/index.tsx @@ -25,13 +25,7 @@ const tabOptions = [ }, ]; -const EmojiIconPicker: React.FC = ({ - label, - value, - onChange, - onIconColorChange, - onIconsClick, -}) => { +const EmojiIconPicker: React.FC = ({ label, value, onChange, onIconColorChange }) => { const ref = useRef(null); const [isOpen, setIsOpen] = useState(false); @@ -181,13 +175,13 @@ const EmojiIconPicker: React.FC = ({

- {icons.material_rounded.map((icon) => ( + {icons.material_rounded.map((icon, index) => (