-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add profile level views in payment page (#1290)
Co-authored-by: Riddhiagrawal001 <[email protected]>
- Loading branch information
1 parent
968478a
commit ff5d897
Showing
17 changed files
with
206 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
@react.component | ||
let make = () => { | ||
open HSwitchUtils | ||
open HyperswitchAtom | ||
let url = RescriptReactRouter.useUrl() | ||
let userPermissionJson = Recoil.useRecoilValueFromAtom(userPermissionAtom) | ||
let {userInfo: {transactionEntity}} = React.useContext(UserInfoProvider.defaultContext) | ||
let {payOut} = featureFlagAtom->Recoil.useRecoilValueFromAtom | ||
<div key={(transactionEntity :> string)}> | ||
{switch url.path->urlPath { | ||
| list{"payments", ...remainingPath} => | ||
<AccessControl permission=userPermissionJson.operationsView> | ||
<FilterContext key="payments" index="payments"> | ||
<EntityScaffold | ||
entityName="Payments" | ||
remainingPath | ||
access=Access | ||
renderList={() => <Orders />} | ||
renderShow={(id, key) => <ShowOrder id profileId={key} />} | ||
/> | ||
</FilterContext> | ||
</AccessControl> | ||
| list{"payouts", ...remainingPath} => | ||
<AccessControl isEnabled={payOut} permission=userPermissionJson.operationsView> | ||
<FilterContext key="payouts" index="payouts"> | ||
<EntityScaffold | ||
entityName="Payouts" | ||
remainingPath | ||
access=Access | ||
renderList={() => <PayoutsList />} | ||
renderShow={(id, key) => <ShowPayout id profileId={key} />} | ||
/> | ||
</FilterContext> | ||
</AccessControl> | ||
| list{"refunds", ...remainingPath} => | ||
<AccessControl permission=userPermissionJson.operationsView> | ||
<FilterContext key="refunds" index="refunds"> | ||
<EntityScaffold | ||
entityName="Refunds" | ||
remainingPath | ||
access=Access | ||
renderList={() => <Refund />} | ||
renderShow={(id, key) => <ShowRefund id profileId={key} />} | ||
/> | ||
</FilterContext> | ||
</AccessControl> | ||
| list{"disputes", ...remainingPath} => | ||
<AccessControl permission=userPermissionJson.operationsView> | ||
<EntityScaffold | ||
entityName="Disputes" | ||
remainingPath | ||
access=Access | ||
renderList={() => <Disputes />} | ||
renderShow={(id, key) => <ShowDisputes id profileId={key} />} | ||
/> | ||
</AccessControl> | ||
| list{"unauthorized"} => <UnauthorizedPage /> | ||
| _ => <NotFoundPage /> | ||
}} | ||
</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.