-
Notifications
You must be signed in to change notification settings - Fork 44
Improve fees display on send #2649
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
leofelix077
wants to merge
26
commits into
master
Choose a base branch
from
feature/improve-resource-fee-display-on-send
base: master
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
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
5303861
add initial version of displaying better minResourceFee
leofelix077 b015fd6
adjust ui and translations for fee details
leofelix077 e379415
Update extension/src/popup/locales/pt/translation.json
leofelix077 407a8d3
adjust ui for feesPane and add e2e tests
leofelix077 eb37241
Merge branch 'feature/improve-resource-fee-display-on-send' of github…
leofelix077 fcaa0be
Potential fix for pull request finding
leofelix077 3642b9d
Potential fix for pull request finding
leofelix077 a77b6f5
fix ui styles and padding
leofelix077 2e3e0a6
extract types to shard and update fees pane padding
leofelix077 a134d03
Merge branch 'master' into feature/improve-resource-fee-display-on-send
leofelix077 0e156b2
move SimulateTxData to shared types and fix FeesPane padding
leofelix077 cc18c3a
fix soroban rpc url for simulate transaction
leofelix077 deb8b32
Merge branch 'feature/improve-resource-fee-display-on-send' of https:…
leofelix077 5ea2d52
add initial version of displaying better minResourceFee
leofelix077 7b9be74
adjust ui and translations for fee details
leofelix077 53f89db
adjust ui for feesPane and add e2e tests
leofelix077 5b55348
Update extension/src/popup/locales/pt/translation.json
leofelix077 38e0253
Potential fix for pull request finding
leofelix077 92c8981
Potential fix for pull request finding
leofelix077 604a420
fix ui styles and padding
leofelix077 50ab260
extract types to shard and update fees pane padding
leofelix077 e433ac0
fix soroban rpc url for simulate transaction
leofelix077 012ea77
move SimulateTxData to shared types and fix FeesPane padding
leofelix077 8ee56e2
Merge branch 'master' into feature/improve-resource-fee-display-on-send
leofelix077 ac05652
Merge branch 'feature/improve-resource-fee-display-on-send' of https:…
leofelix077 32a4eea
fix manually set fee persistence inside flow and add e2e tests
leofelix077 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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
97 changes: 97 additions & 0 deletions
97
extension/src/popup/components/InternalTransaction/FeesPane/index.tsx
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,97 @@ | ||
| import React from "react"; | ||
| import { Icon } from "@stellar/design-system"; | ||
| import { useTranslation } from "react-i18next"; | ||
|
|
||
| import { RequestState, State } from "constants/request"; | ||
| import { SimulateTxData } from "types/transactions"; | ||
|
|
||
| import "./styles.scss"; | ||
|
|
||
| export interface FeesPaneProps { | ||
| fee: string; | ||
| simulationState: State<SimulateTxData, string>; | ||
| isSoroban?: boolean; | ||
| onClose: () => void; | ||
| } | ||
|
|
||
| export const FeesPane = ({ | ||
| fee, | ||
| simulationState, | ||
| isSoroban = false, | ||
| onClose, | ||
| }: FeesPaneProps) => { | ||
| const { t } = useTranslation(); | ||
|
|
||
| const isLoading = | ||
| simulationState.state === RequestState.IDLE || | ||
| simulationState.state === RequestState.LOADING; | ||
|
|
||
| return ( | ||
| <div className="FeesPane" data-testid="review-tx-fees-pane"> | ||
| <div className="FeesPane__Header"> | ||
| <div className="FeesPane__Header__Icon"> | ||
| <Icon.Route /> | ||
| </div> | ||
| <button | ||
| type="button" | ||
| className="FeesPane__Header__Close" | ||
| data-testid="review-tx-fees-close-btn" | ||
| onClick={onClose} | ||
| aria-label={t("Close")} | ||
| > | ||
| <Icon.X /> | ||
| </button> | ||
| </div> | ||
| <div className="FeesPane__Title"> | ||
| <span>{t("Fees")}</span> | ||
| </div> | ||
| <div className="FeesPane__Card"> | ||
| {!isLoading && simulationState.data?.inclusionFee && ( | ||
| <div className="FeesPane__Card__Row"> | ||
| <span className="FeesPane__Card__Row__Label"> | ||
| {t("Inclusion Fee")} | ||
| </span> | ||
| <span | ||
| className="FeesPane__Card__Row__Value" | ||
| data-testid="review-tx-inclusion-fee" | ||
| > | ||
| {simulationState.data.inclusionFee} XLM | ||
| </span> | ||
| </div> | ||
| )} | ||
| {!isLoading && simulationState.data?.resourceFee && ( | ||
| <div className="FeesPane__Card__Row"> | ||
| <span className="FeesPane__Card__Row__Label"> | ||
| {t("Resource Fee")} | ||
| </span> | ||
| <span | ||
| className="FeesPane__Card__Row__Value" | ||
| data-testid="review-tx-resource-fee" | ||
| > | ||
| {simulationState.data.resourceFee} XLM | ||
| </span> | ||
| </div> | ||
| )} | ||
| <div className="FeesPane__Card__Row"> | ||
| <span className="FeesPane__Card__Row__Label FeesPane__Card__Row__Label--total"> | ||
| {t("Total Fee")} | ||
| </span> | ||
| <span | ||
| className="FeesPane__Card__Row__Value FeesPane__Card__Row__Value--total" | ||
| data-testid="review-tx-total-fee" | ||
| > | ||
| {isLoading ? t("Calculating...") : `${fee} XLM`} | ||
| </span> | ||
| </div> | ||
| </div> | ||
| <div | ||
| className="FeesPane__Description" | ||
| data-testid="review-tx-fees-description" | ||
| > | ||
| {isSoroban | ||
| ? t("Fees description soroban") | ||
| : t("Fees description classic")} | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; |
101 changes: 101 additions & 0 deletions
101
extension/src/popup/components/InternalTransaction/FeesPane/styles.scss
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,101 @@ | ||
| @use "../../../styles/utils.scss" as *; | ||
|
|
||
| .FeesPane { | ||
| display: flex; | ||
| flex-direction: column; | ||
| width: 100%; | ||
| padding: 0 0; | ||
| gap: pxToRem(16px); | ||
|
|
||
| .multi-pane-slider & { | ||
| padding: 0; | ||
| } | ||
|
|
||
| &__Header { | ||
| display: flex; | ||
| justify-content: space-between; | ||
| align-items: center; | ||
|
|
||
| &__Icon { | ||
| display: flex; | ||
| width: pxToRem(32px); | ||
| height: pxToRem(32px); | ||
| justify-content: center; | ||
| align-items: center; | ||
| border-radius: pxToRem(8px); | ||
| background: var(--sds-clr-lilac-03); | ||
| border: 1px solid var(--sds-clr-lilac-06); | ||
|
|
||
| svg { | ||
| width: pxToRem(20px); | ||
| height: pxToRem(20px); | ||
| color: var(--sds-clr-lilac-09); | ||
| } | ||
| } | ||
|
|
||
| &__Close { | ||
| display: flex; | ||
| width: pxToRem(32px); | ||
| height: pxToRem(32px); | ||
| justify-content: center; | ||
| align-items: center; | ||
| border-radius: 1000px; | ||
| background: var(--sds-clr-gray-03); | ||
| color: var(--sds-clr-gray-09); | ||
| cursor: pointer; | ||
| } | ||
| } | ||
|
|
||
| &__Title { | ||
| display: flex; | ||
| align-items: center; | ||
| width: 100%; | ||
| font-size: pxToRem(18px); | ||
| font-weight: var(--font-weight-medium); | ||
| } | ||
|
|
||
| &__Card { | ||
| display: flex; | ||
| flex-direction: column; | ||
| border-radius: pxToRem(16px); | ||
| background-color: var(--sds-clr-gray-03); | ||
| padding: pxToRem(4px) pxToRem(16px); | ||
|
|
||
| &__Row { | ||
| display: flex; | ||
| justify-content: space-between; | ||
| align-items: center; | ||
| padding: pxToRem(12px) 0; | ||
|
|
||
| &:not(:last-child) { | ||
| border-bottom: 1px solid var(--sds-clr-gray-06); | ||
| } | ||
|
|
||
| &__Label { | ||
| font-size: pxToRem(14px); | ||
| font-weight: var(--font-weight-medium); | ||
| color: var(--sds-clr-gray-11); | ||
|
|
||
| &--total { | ||
| color: var(--sds-clr-lilac-11); | ||
| } | ||
| } | ||
|
|
||
| &__Value { | ||
| font-size: pxToRem(14px); | ||
| font-weight: var(--font-weight-medium); | ||
| color: var(--sds-clr-gray-12); | ||
|
|
||
| &--total { | ||
| color: var(--sds-clr-lilac-11); | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| &__Description { | ||
| color: var(--sds-clr-gray-11); | ||
| font-size: pxToRem(14px); | ||
| line-height: pxToRem(20px); | ||
| } | ||
| } |
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.
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.
why was this change needed? It's actually only used for Soroswap, which is disabled right now
Uh oh!
There was an error while loading. Please reload this page.
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.
it was throwing an error when trying to submit a collectible, mentioning it's a required field by the backend. on my MP collectibles