From aeb49279fde5fdf290b5662b6a2a99b322516d81 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <77892330+PritishBudhiraja@users.noreply.github.com> Date: Tue, 26 Dec 2023 11:44:50 +0530 Subject: [PATCH] fix: Removed Sublevel remote link type & Pageloader CSS fixes. (#120) --- src/screens/HyperSwitch/Sidebar/Sidebar.res | 53 +++++-------------- .../HyperSwitch/Sidebar/SidebarTypes.res | 4 +- .../Utils/HSwitchGlobalSearchBar.res | 3 +- .../HyperSwitch/Utils/PageLoaderWrapper.res | 3 +- 4 files changed, 16 insertions(+), 47 deletions(-) diff --git a/src/screens/HyperSwitch/Sidebar/Sidebar.res b/src/screens/HyperSwitch/Sidebar/Sidebar.res index cf2ae62b5..11b063f99 100644 --- a/src/screens/HyperSwitch/Sidebar/Sidebar.res +++ b/src/screens/HyperSwitch/Sidebar/Sidebar.res @@ -216,25 +216,6 @@ module NestedSidebarItem = { } - - | SubLevelRemoteLink(tabOption) => { - let {name, link, access, ?remoteIcon} = tabOption - let (remoteUi, link) = if remoteIcon->Belt.Option.getWithDefault(false) { - (, link) - } else { - (React.null, `${link}${getSearchParamByLink(link)}`) - } - - ReactDOM.Ref.domRef} - href={link} - target="_blank" - className={`${textColor} relative overflow-hidden flex flex-row items-center cursor-pointer ${paddingClass} ${selectedClass} `}> - - remoteUi - - - } }} } @@ -308,23 +289,18 @@ module NestedSectionItem = { - { - let subSectionsArr = - section.links - ->Array.mapWithIndex((subLevelItem, index) => { - let isSelected = subLevelItem->isSubLevelItemSelected - - }) - ->React.array - - subSectionsArr - } + {section.links + ->Array.mapWithIndex((subLevelItem, index) => { + let isSelected = subLevelItem->isSubLevelItemSelected + + }) + ->React.array} } @@ -341,9 +317,7 @@ module SidebarNestedSection = { ) => { let isSubLevelItemSelected = tabInfo => { switch tabInfo { - | SubLevelRemoteLink(item) - | SubLevelLink(item) => - linkSelectionCheck(firstPart, item.link) + | SubLevelLink(item) => linkSelectionCheck(firstPart, item.link) } } @@ -410,7 +384,6 @@ module SidebarNestedSection = { acc && switch subLevelItem { | SubLevelLink({access}) => access === NoAccess - | SubLevelRemoteLink({access}) => access === NoAccess } }) diff --git a/src/screens/HyperSwitch/Sidebar/SidebarTypes.res b/src/screens/HyperSwitch/Sidebar/SidebarTypes.res index 3b8f54486..7433db462 100644 --- a/src/screens/HyperSwitch/Sidebar/SidebarTypes.res +++ b/src/screens/HyperSwitch/Sidebar/SidebarTypes.res @@ -27,9 +27,7 @@ type nestedOption = { iconSize?: int, } -type subLevelItem = - | SubLevelRemoteLink(nestedOption) - | SubLevelLink(nestedOption) +type subLevelItem = SubLevelLink(nestedOption) type sectionType = { name: string, diff --git a/src/screens/HyperSwitch/Utils/HSwitchGlobalSearchBar.res b/src/screens/HyperSwitch/Utils/HSwitchGlobalSearchBar.res index 5e0dbd867..2209ed1d8 100644 --- a/src/screens/HyperSwitch/Utils/HSwitchGlobalSearchBar.res +++ b/src/screens/HyperSwitch/Utils/HSwitchGlobalSearchBar.res @@ -104,8 +104,7 @@ let make = () => { [], (insideAcc, item) => { switch item { - | SubLevelLink(obj) - | SubLevelRemoteLink(obj) => { + | SubLevelLink(obj) => { if ( checkStringStartsWithSubstring(~itemToCheck=sectionObj.name, ~searchText) || checkStringStartsWithSubstring(~itemToCheck=obj.name, ~searchText) diff --git a/src/screens/HyperSwitch/Utils/PageLoaderWrapper.res b/src/screens/HyperSwitch/Utils/PageLoaderWrapper.res index 02cf33e39..ec220919a 100644 --- a/src/screens/HyperSwitch/Utils/PageLoaderWrapper.res +++ b/src/screens/HyperSwitch/Utils/PageLoaderWrapper.res @@ -20,9 +20,8 @@ let make = ( } | Error(_err) =>