-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a89a968
commit 88ca28b
Showing
13 changed files
with
138 additions
and
61 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
6 changes: 3 additions & 3 deletions
6
react-native-expo/components/PortfolioScreen/BalanceList/Balance/index.stories.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,20 +1,20 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import Balance from '.'; | ||
import balanceFactory from '@/factories/balance'; | ||
import balancesResponseFactory from '@/factories/balancesResponse'; | ||
|
||
const meta: Meta<typeof Balance> = { | ||
component: Balance, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
balance: { control: false }, | ||
balancesResponse: { control: false }, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
export const Basic: StoryObj<typeof Balance> = { | ||
args: { | ||
balance: balanceFactory.build(), | ||
balancesResponse: balancesResponseFactory.build(), | ||
}, | ||
}; |
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
14 changes: 9 additions & 5 deletions
14
react-native-expo/components/PortfolioScreen/BalanceList/index.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import * as Factory from 'factory.ts'; | ||
import { PlainMessage } from '@bufbuild/protobuf'; | ||
import { Amount } from '@penumbra-zone/protobuf/penumbra/core/num/v1/num_pb'; | ||
|
||
const randomBigInt = () => BigInt(Math.round(Math.random() * 10 ** 7)); | ||
|
||
const amountFactory = Factory.makeFactory<PlainMessage<Amount>>({ | ||
hi: 0n, | ||
lo: randomBigInt(), | ||
}); | ||
|
||
export default amountFactory; |
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
import * as Factory from 'factory.ts'; | ||
import { BalancesResponse } from '@penumbra-zone/protobuf/penumbra/view/v1/view_pb'; | ||
import { ChainRegistryClient } from '@penumbra-labs/registry'; | ||
import { PENUMBRA_CHAIN_ID } from '@/utils/constants'; | ||
import { PlainMessage } from '@bufbuild/protobuf'; | ||
import amountFactory from './amount'; | ||
|
||
const METADATAS = new ChainRegistryClient().bundled.get(PENUMBRA_CHAIN_ID).getAllAssets(); | ||
|
||
const balancesResponseFactory = Factory.makeFactory<PlainMessage<BalancesResponse>>({ | ||
balanceView: Factory.each(i => ({ | ||
valueView: { | ||
case: 'knownAssetId', | ||
value: { | ||
amount: amountFactory.build(), | ||
equivalentValues: [], | ||
metadata: METADATAS[i % METADATAS.length], | ||
}, | ||
}, | ||
})), | ||
}); | ||
|
||
export default balancesResponseFactory; |
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