Skip to content

Commit

Permalink
chore: hiding org merchant dropdown for internal user (#1843)
Browse files Browse the repository at this point in the history
Co-authored-by: Gitanjli Chopra <[email protected]>
  • Loading branch information
gitanjli525 and Gitanjli Chopra authored Dec 3, 2024
1 parent 9c2e48c commit c411e40
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
12 changes: 7 additions & 5 deletions src/entryPoints/HyperSwitchApp.res
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ let make = () => {

let ompDropdowns =
<div className="flex items-center gap-4 mx-4">
<MerchantSwitch />
<p className="text-gray-400 text-fs-14"> {"/"->React.string} </p>
<RenderIf condition={!isInternalUser}>
<MerchantSwitch />
<p className="text-gray-400 text-fs-14"> {"/"->React.string} </p>
</RenderIf>
<ProfileSwitch />
</div>

Expand Down Expand Up @@ -114,9 +116,9 @@ let make = () => {
headerActions={<div className="relative flex space-around gap-4 my-2 ">
<div className="flex gap-4">
<GlobalSearchBar />
// <RenderIf condition={isInternalUser}> // to be removed later
// <SwitchMerchantForInternal />
// </RenderIf>
<RenderIf condition={isInternalUser}>
<SwitchMerchantForInternal />
</RenderIf>
<div
className={`px-4 py-2 rounded whitespace-nowrap text-fs-13 ${modeStyles} font-semibold`}>
{modeText->React.string}
Expand Down
10 changes: 5 additions & 5 deletions src/screens/Sidebar/Sidebar.res
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,8 @@ let make = (
let isMobileView = MatchMedia.useMobileChecker()
let sideBarRef = React.useRef(Nullable.null)
let {email} = useCommonAuthInfo()->Option.getOr(defaultAuthInfo)
// let {userInfo: {roleId}} = React.useContext(UserInfoProvider.defaultContext)
// let isInternalUser = roleId->HyperSwitchUtils.checkIsInternalUser
let {userInfo: {roleId}} = React.useContext(UserInfoProvider.defaultContext)
let isInternalUser = roleId->HyperSwitchUtils.checkIsInternalUser
let (openItem, setOpenItem) = React.useState(_ => "")
let {isSidebarExpanded, setIsSidebarExpanded} = React.useContext(SidebarProvider.defaultContext)

Expand Down Expand Up @@ -546,9 +546,9 @@ let make = (
/>
</div>
</RenderIf>
// <RenderIf condition={!isInternalUser}> // to be removed later
<SidebarSwitch isSidebarExpanded />
// </RenderIf>
<RenderIf condition={!isInternalUser}>
<SidebarSwitch isSidebarExpanded />
</RenderIf>
<div
className="h-full overflow-y-scroll transition-transform duration-1000 overflow-x-hidden sidebar-scrollbar"
style={height: `calc(100vh - ${verticalOffset})`}>
Expand Down

0 comments on commit c411e40

Please sign in to comment.