-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create initial pass of v2 send/receive pages #1665
Changes from all commits
c7ef90e
b6d68f2
524223c
3675e56
c154f24
854ff07
46dc416
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@penumbra-zone/getters': major | ||
--- | ||
|
||
Update asset ID getter; it no longer has a hardcoded Optional version |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ import { ReactNode, useCallback, useEffect, useState } from 'react'; | |
import { | ||
getAddressIndex, | ||
getAmount, | ||
getAssetIdFromBalancesResponseOptional, | ||
getAssetIdFromBalancesResponse, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I got rid of the optional one, since we can now just call |
||
} from '@penumbra-zone/getters/balances-response'; | ||
import { ViewService } from '@penumbra-zone/protobuf'; | ||
import { GasPrices } from '@penumbra-zone/protobuf/penumbra/core/component/fee/v1/fee_pb'; | ||
|
@@ -54,7 +54,7 @@ const hasTokenBalance = ({ | |
} | ||
|
||
return gasPrices.some(price => | ||
price.assetId?.equals(getAssetIdFromBalancesResponseOptional(balance)), | ||
price.assetId?.equals(getAssetIdFromBalancesResponse.optional()(balance)), | ||
); | ||
}); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,23 +3,27 @@ import { CharacterTransition } from '@repo/ui/CharacterTransition'; | |
import { Dialog } from '@repo/ui/Dialog'; | ||
import { Text } from '@repo/ui/Text'; | ||
import { Info } from 'lucide-react'; | ||
import { useId } from 'react'; | ||
|
||
export const AssetsCardTitle = () => ( | ||
<div className='flex items-center gap-2'> | ||
<CharacterTransition>Asset Balances</CharacterTransition> | ||
<Dialog> | ||
<Dialog.Trigger asChild> | ||
<Button icon={Info} iconOnly='adornment'> | ||
Info | ||
</Button> | ||
</Dialog.Trigger> | ||
<Dialog.Content title='Asset Balances'> | ||
<Text> | ||
Your balances are shielded, and are known only to you. They are not visible on chain. Each | ||
Penumbra wallet controls many numbered accounts, each with its own balance. Account | ||
information is never revealed on-chain. | ||
</Text> | ||
</Dialog.Content> | ||
</Dialog> | ||
</div> | ||
); | ||
export const AssetsCardTitle = () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may want to review this file with whitespace changes hidden. I just added a |
||
const layoutId = useId(); | ||
return ( | ||
<div className='flex items-center gap-2'> | ||
<CharacterTransition>Asset Balances</CharacterTransition> | ||
<Dialog> | ||
<Dialog.Trigger asChild> | ||
<Button icon={Info} iconOnly='adornment' motion={{ layoutId }}> | ||
Info | ||
</Button> | ||
</Dialog.Trigger> | ||
<Dialog.Content title='Asset Balances' motion={{ layoutId }}> | ||
<Text> | ||
Your balances are shielded, and are known only to you. They are not visible on chain. | ||
Each Penumbra wallet controls many numbered accounts, each with its own balance. Account | ||
information is never revealed on-chain. | ||
</Text> | ||
</Dialog.Content> | ||
</Dialog> | ||
</div> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,22 +3,26 @@ import { CharacterTransition } from '@repo/ui/CharacterTransition'; | |
import { Dialog } from '@repo/ui/Dialog'; | ||
import { Text } from '@repo/ui/Text'; | ||
import { Info } from 'lucide-react'; | ||
import { useId } from 'react'; | ||
|
||
export const TransactionsCardTitle = () => ( | ||
<div className='flex items-center gap-2'> | ||
<CharacterTransition>Transactions List</CharacterTransition> | ||
<Dialog> | ||
<Dialog.Trigger asChild> | ||
<Button icon={Info} iconOnly='adornment'> | ||
Info | ||
</Button> | ||
</Dialog.Trigger> | ||
<Dialog.Content title='Transactions List'> | ||
<Text> | ||
Your wallet scans shielded chain data locally and indexes all relevant transactions it | ||
detects, both incoming and outgoing. | ||
</Text> | ||
</Dialog.Content> | ||
</Dialog> | ||
</div> | ||
); | ||
export const TransactionsCardTitle = () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may want to review this file with whitespace changes hidden. I just added a |
||
const layoutId = useId(); | ||
return ( | ||
<div className='flex items-center gap-2'> | ||
<CharacterTransition>Transactions List</CharacterTransition> | ||
<Dialog> | ||
<Dialog.Trigger asChild> | ||
<Button icon={Info} iconOnly='adornment' motion={{ layoutId }}> | ||
Info | ||
</Button> | ||
</Dialog.Trigger> | ||
<Dialog.Content title='Transactions List' motion={{ layoutId }}> | ||
<Text> | ||
Your wallet scans shielded chain data locally and indexes all relevant transactions it | ||
detects, both incoming and outgoing. | ||
</Text> | ||
</Dialog.Content> | ||
</Dialog> | ||
</div> | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I deleted the
use-refresh-fee.ts
file from the v1 directory, and moved it to the v2 directory. Now, we're "reaching into" the v2 directory from v1 to import its logic.I think this is a good approach for logic-heavy files (like hooks, etc.), since eventually, we'll want to just delete all the v1 code and move the v2 code up into
src
. At that point, if we've already moved all the v1 hooks/etc. into the v2 directory, the migration will be a cinch.And in the meantime, we don't need to maintain two copies of each hook file (i.e., we don't have to have a copy of
use-refresh-fee.ts
in both the v1src
directory, and the v2 directory).