Skip to content

Commit

Permalink
chore: home page changes for profile level users (#1409)
Browse files Browse the repository at this point in the history
  • Loading branch information
Riddhiagrawal001 authored Sep 18, 2024
1 parent 6d7123b commit 877de7f
Showing 1 changed file with 26 additions and 21 deletions.
47 changes: 26 additions & 21 deletions src/screens/Home/HomeUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,16 @@ module ControlCenter = {
let make = () => {
let merchantDetailsValue = useMerchantDetailsValue()
let {isLiveMode} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom
let {checkUserEntity} = React.useContext(UserInfoProvider.defaultContext)

let isLiveModeEnabledStyles = isLiveMode
? "flex flex-col md:flex-row gap-5 w-full"
: "flex flex-col gap-5 md:w-1/2 w-full"

<div className="flex flex-col gap-5 md:flex-row">
<RenderIf condition={!isLiveMode}>
<CheckoutCard />
</RenderIf>
<div className=isLiveModeEnabledStyles>
<CardLayout width="w-full" customStyle={isLiveMode ? "" : "h-3/6"}>
<CardHeader
Expand All @@ -225,29 +229,30 @@ module ControlCenter = {
/>
</CardFooter>
</CardLayout>
<CardLayout width="w-full" customStyle={isLiveMode ? "" : "h-4/6"}>
<CardHeader
heading="Credentials and Keys"
subHeading="Your secret credentials to start integrating"
leftIcon=Some("merchantInfo")
customSubHeadingStyle="w-full max-w-none"
/>
<MerchantAuthInfo merchantDetailsValue />
<CardFooter>
<Button
text="Go to API keys"
buttonType={Secondary}
buttonSize={Small}
onClick={_ => {
RescriptReactRouter.push(GlobalVars.appendDashboardPath(~url="/developer-api-keys"))
}}
<RenderIf condition={!checkUserEntity([#Profile])}>
<CardLayout width="w-full" customStyle={isLiveMode ? "" : "h-4/6"}>
<CardHeader
heading="Credentials and Keys"
subHeading="Your secret credentials to start integrating"
leftIcon=Some("merchantInfo")
customSubHeadingStyle="w-full max-w-none"
/>
</CardFooter>
</CardLayout>
<MerchantAuthInfo merchantDetailsValue />
<CardFooter>
<Button
text="Go to API keys"
buttonType={Secondary}
buttonSize={Small}
onClick={_ => {
RescriptReactRouter.push(
GlobalVars.appendDashboardPath(~url="/developer-api-keys"),
)
}}
/>
</CardFooter>
</CardLayout>
</RenderIf>
</div>
<RenderIf condition={!isLiveMode}>
<CheckoutCard />
</RenderIf>
</div>
}
}
Expand Down

0 comments on commit 877de7f

Please sign in to comment.