From 214f2f73fedfa0418051a4365ad2fb6da5ec45d6 Mon Sep 17 00:00:00 2001 From: Pankaj Chotaliya <34762752+pankajvc@users.noreply.github.com> Date: Tue, 8 Aug 2023 13:28:59 +0530 Subject: [PATCH 1/2] fix :label filter should show something if there is no label #1779 (#1795) --- .../components/ui/multi-level-dropdown.tsx | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/apps/app/components/ui/multi-level-dropdown.tsx b/apps/app/components/ui/multi-level-dropdown.tsx index 9a4ebdbe427..096e32ca894 100644 --- a/apps/app/components/ui/multi-level-dropdown.tsx +++ b/apps/app/components/ui/multi-level-dropdown.tsx @@ -125,27 +125,31 @@ export const MultiLevelDropdown: React.FC = ({ > {option.children ? (
- {option.children.map((child) => { - if (child.element) return child.element; - else - return ( - - ); - })} + {option.children.length === 0 ? ( +

No {option.label} found

//if no children found, show this message. + ) : ( + option.children.map((child) => { + if (child.element) return child.element; + else + return ( + + ); + }) + )}
) : ( From 66ba5f77a4d3035b5d11a98101ac4058c227bfd3 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Tue, 8 Aug 2023 13:31:01 +0530 Subject: [PATCH 2/2] style: children empty state --- apps/app/components/ui/multi-level-dropdown.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/app/components/ui/multi-level-dropdown.tsx b/apps/app/components/ui/multi-level-dropdown.tsx index 096e32ca894..cfdaa72d55c 100644 --- a/apps/app/components/ui/multi-level-dropdown.tsx +++ b/apps/app/components/ui/multi-level-dropdown.tsx @@ -66,7 +66,7 @@ export const MultiLevelDropdown: React.FC = ({ > {options.map((option) => (
@@ -107,7 +107,7 @@ export const MultiLevelDropdown: React.FC = ({ {option.hasChildren && option.id === openChildFor && (
= ({ {option.children ? (
{option.children.length === 0 ? ( -

No {option.label} found

//if no children found, show this message. +

+ No {option.label} found +

//if no children found, show this message. ) : ( option.children.map((child) => { if (child.element) return child.element;