-
Notifications
You must be signed in to change notification settings - Fork 144
Sponsored fees reserves #1335
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
Open
cybele-ripple
wants to merge
12
commits into
main
Choose a base branch
from
sponsored-fees-reserves
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Sponsored fees reserves #1335
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
414d6da
Add Sponsored fees & reserves section to account page
cybele-ripple 60878e1
Simplify SponsoredFeesReserves and match sibling conventions
cybele-ripple e3e27d1
Merge remote-tracking branch 'origin/main' into sponsored-fees-reserves
cybele-ripple a83c853
Support multiple simultaneous fee sponsors on the account page
cybele-ripple cb5a90c
Show full sponsor account address on the account page
cybele-ripple 2750ca4
Merge remote-tracking branch 'origin/main' into sponsored-fees-reserves
cybele-ripple 6766a52
Add SponsorshipSet/SponsorshipTransfer transaction views and generic …
cybele-ripple 4f7f90c
Polish Sponsored Fees & Reserves UI
cybele-ripple 9032e91
Align sponsorship fields with latest XLS-68 spec revision
cybele-ripple 24db7ae
Address remaining PR review comments on sponsorship display
cybele-ripple e5ca919
Fix SponsorshipTransfer/Sponsor field collision with generic co-spons…
cybele-ripple 7f40865
Upgrade xrpl to 5.1.0 and use its official Sponsorship types
cybele-ripple File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,71 @@ | ||
| import { useTranslation } from 'react-i18next' | ||
| import { Account } from '../../shared/components/Account' | ||
| import { CollapsibleSection } from '../../shared/components/CollapsibleSection' | ||
| import { EmptyMessageTableRow } from '../../shared/EmptyMessageTableRow' | ||
| import type { AccountState } from '../../../rippled/accountState' | ||
| import './styles.scss' | ||
|
|
||
| interface Props { | ||
| account: AccountState | ||
| } | ||
|
|
||
| type ScopeKey = | ||
| | 'account_page_sponsored_scope_transaction_fees' | ||
| | 'account_page_sponsored_scope_base_reserve' | ||
|
|
||
| export const SponsoredFeesReserves = ({ account }: Props) => { | ||
| const { t } = useTranslation() | ||
|
|
||
| const rows: { scopeKey: ScopeKey; sponsor: string }[] = [ | ||
| ...(account.sponsorship ?? []) | ||
| .filter(({ feeAmount }) => Number(feeAmount) > 0) | ||
| .map(({ owner }) => ({ | ||
| scopeKey: 'account_page_sponsored_scope_transaction_fees' as ScopeKey, | ||
| sponsor: owner, | ||
| })), | ||
| ...(account.info?.sponsor | ||
| ? [ | ||
| { | ||
| scopeKey: 'account_page_sponsored_scope_base_reserve' as ScopeKey, | ||
| sponsor: account.info.sponsor, | ||
| }, | ||
| ] | ||
| : []), | ||
| ] | ||
|
|
||
| return ( | ||
| <CollapsibleSection | ||
| title={t('account_page_sponsored_fees_reserves_title')} | ||
| ariaLabel="Toggle sponsored fees & reserves section" | ||
| className="sponsored-fees-reserves-section" | ||
| defaultOpen={false} | ||
| > | ||
| <div className="sponsored-fees-reserves-table-wrapper"> | ||
| <table className="sponsored-fees-reserves-table"> | ||
| <thead> | ||
| <tr> | ||
| <th>{t('account_page_sponsored_scope')}</th> | ||
|
kuan121 marked this conversation as resolved.
|
||
| <th>{t('account_page_sponsored_by')}</th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| {rows.length === 0 ? ( | ||
| <EmptyMessageTableRow colSpan={2}> | ||
| {t('account_page_sponsored_none')} | ||
| </EmptyMessageTableRow> | ||
| ) : ( | ||
| rows.map(({ scopeKey, sponsor }) => ( | ||
| <tr key={`${scopeKey}-${sponsor}`}> | ||
| <td>{t(scopeKey)}</td> | ||
| <td> | ||
| <Account account={sponsor} /> | ||
| </td> | ||
| </tr> | ||
| )) | ||
| )} | ||
| </tbody> | ||
| </table> | ||
| </div> | ||
| </CollapsibleSection> | ||
| ) | ||
| } | ||
This file contains hidden or 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,43 @@ | ||
| @use '../../shared/css/variables' as *; | ||
|
|
||
| .sponsored-fees-reserves-section { | ||
| padding: 24px 0; | ||
| } | ||
|
|
||
| .sponsored-fees-reserves-table-wrapper { | ||
| -webkit-overflow-scrolling: touch; | ||
| overflow-x: auto; | ||
| } | ||
|
|
||
| .sponsored-fees-reserves-table { | ||
| width: 100%; | ||
| border-collapse: collapse; | ||
|
|
||
| thead th { | ||
| @include semibold; | ||
|
|
||
| padding: 10px 12px; | ||
| color: $black-50; | ||
| font-size: 12px; | ||
| text-align: left; | ||
| text-transform: uppercase; | ||
| } | ||
|
|
||
| tbody td { | ||
| padding: 10px 12px; | ||
| border-bottom: 1px solid $black-80; | ||
| color: $white; | ||
| font-size: 14px; | ||
|
|
||
| &.empty-message { | ||
| padding: 16px; | ||
| color: $black-40; | ||
| font-size: 16px; | ||
| text-align: center; | ||
| } | ||
| } | ||
|
|
||
| tbody tr:first-child td { | ||
| border-top: 1px solid $black-80; | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.