This repository was archived by the owner on Sep 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(InstanceDetailedPage): integrate debit wallet + get account
Signed-off-by: reslene <[email protected]>
- Loading branch information
Showing
14 changed files
with
176 additions
and
43 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
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
58 changes: 58 additions & 0 deletions
58
app/src/components/Wrappers/Workflows/histories/activities/DebitWallet/DebitWallet.tsx
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,58 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
|
||
import { Wallet } from '@mui/icons-material'; | ||
import { Box, Typography, useTheme } from '@mui/material'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { Chip } from '@numaryhq/storybook'; | ||
|
||
import NodeTitle from '~/src/components/Wrappers/Workflows/CustomNode/NodeTitle'; | ||
import { DebitWalletProps } from '~/src/components/Wrappers/Workflows/histories/activities/DebitWallet/types'; | ||
import { | ||
chipContainer, | ||
containerSx, | ||
typoSx, | ||
} from '~/src/components/Wrappers/Workflows/stages/utils'; | ||
import { useToggle } from '~/src/hooks/useToggle'; | ||
|
||
const DebitWallet: FunctionComponent<DebitWalletProps> = ({ amount }) => { | ||
const { t } = useTranslation(); | ||
const { palette } = useTheme(); | ||
const [show, toggle] = useToggle(false); | ||
|
||
return ( | ||
<Box | ||
className="react-flow__node-default" | ||
sx={{ | ||
borderRadius: '15px', | ||
border: ({ palette }) => `1px dotted ${palette.blue.bright}`, | ||
width: '100%', | ||
}} | ||
> | ||
<NodeTitle | ||
label={t('pages.flow.activities.debitWallet.title')} | ||
color={palette.blue.light} | ||
onToggle={toggle} | ||
icon={<Wallet />} | ||
/> | ||
{show && ( | ||
<> | ||
<Box component="span" display="block" sx={containerSx} mt={1}> | ||
<Box sx={chipContainer}> | ||
<Typography sx={typoSx} variant="bold"> | ||
{t('pages.flow.activities.debitWallet.amount')} | ||
</Typography> | ||
<Chip | ||
label={`${amount.amount} ${amount.asset}`} | ||
variant="square" | ||
color="red" | ||
/> | ||
</Box> | ||
</Box> | ||
</> | ||
)} | ||
</Box> | ||
); | ||
}; | ||
|
||
export default DebitWallet; |
3 changes: 3 additions & 0 deletions
3
app/src/components/Wrappers/Workflows/histories/activities/DebitWallet/index.ts
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,3 @@ | ||
import DebitWallet from './DebitWallet'; | ||
|
||
export default DebitWallet; |
6 changes: 6 additions & 0 deletions
6
app/src/components/Wrappers/Workflows/histories/activities/DebitWallet/types.ts
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,6 @@ | ||
export type DebitWalletProps = { | ||
amount: { | ||
amount: number; | ||
asset: string; | ||
}; | ||
}; |
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
6 changes: 2 additions & 4 deletions
6
app/src/components/Wrappers/Workflows/histories/activities/GetAccount/types.ts
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import { ObjectOf } from '@numaryhq/storybook'; | ||
import { Account } from '~/src/types/ledger'; | ||
|
||
export type GetAccountProps = { | ||
metadata: ObjectOf<any>; | ||
}; | ||
export type GetAccountProps = Account; |
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
5 changes: 0 additions & 5 deletions
5
app/src/components/Wrappers/Workflows/histories/activities/RevertTransaction/types.ts
This file was deleted.
Oops, something went wrong.
64 changes: 64 additions & 0 deletions
64
app/src/components/Wrappers/Workflows/histories/activities/StripeTransfer/StripeTransfer.tsx
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,64 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
|
||
import { AccountTree } from '@mui/icons-material'; | ||
import { Box, Typography, useTheme } from '@mui/material'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { Chip } from '@numaryhq/storybook'; | ||
|
||
import NodeTitle from '~/src/components/Wrappers/Workflows/CustomNode/NodeTitle'; | ||
import { StripeTransferProps } from '~/src/components/Wrappers/Workflows/histories/activities/StripeTransfer/types'; | ||
import { | ||
chipContainer, | ||
containerSx, | ||
typoSx, | ||
} from '~/src/components/Wrappers/Workflows/stages/utils'; | ||
import { useToggle } from '~/src/hooks/useToggle'; | ||
|
||
const StripeTransfer: FunctionComponent<StripeTransferProps> = ({ | ||
asset, | ||
destination, | ||
amount, | ||
}) => { | ||
const { t } = useTranslation(); | ||
const { palette } = useTheme(); | ||
const [show, toggle] = useToggle(false); | ||
|
||
return ( | ||
<Box | ||
className="react-flow__node-default" | ||
sx={{ | ||
borderRadius: '15px', | ||
border: ({ palette }) => `1px dotted ${palette.green.bright}`, | ||
width: '100%', | ||
}} | ||
> | ||
<NodeTitle | ||
label={t('pages.flow.activities.stripeTransfer.title')} | ||
color={palette.green.light} | ||
onToggle={toggle} | ||
icon={<AccountTree />} | ||
/> | ||
{show && ( | ||
<> | ||
<Box component="span" display="block" sx={containerSx} mt={1}> | ||
<Box sx={chipContainer}> | ||
<Typography sx={typoSx} variant="bold"> | ||
{t('pages.flow.activities.stripeTransfer.destination')} | ||
</Typography> | ||
<Chip label={destination} variant="square" /> | ||
</Box> | ||
<Box sx={chipContainer}> | ||
<Typography sx={typoSx} variant="bold"> | ||
{t('pages.flow.activities.stripeTransfer.amount')} | ||
</Typography> | ||
<Chip label={`${amount} ${asset}`} variant="square" color="red" /> | ||
</Box> | ||
</Box> | ||
</> | ||
)} | ||
</Box> | ||
); | ||
}; | ||
|
||
export default StripeTransfer; |
3 changes: 3 additions & 0 deletions
3
app/src/components/Wrappers/Workflows/histories/activities/StripeTransfer/index.ts
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,3 @@ | ||
import StripeTransfer from './StripeTransfer'; | ||
|
||
export default StripeTransfer; |
5 changes: 5 additions & 0 deletions
5
app/src/components/Wrappers/Workflows/histories/activities/StripeTransfer/types.ts
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,5 @@ | ||
export type StripeTransferProps = { | ||
amount: number; | ||
asset: string; | ||
destination: string; | ||
}; |
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