Skip to content
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

add fill price and remove price form summary and overview pages #988

Draft
wants to merge 7 commits into
base: staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 74 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"vite-plugin-html": "^3.2.0",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.2.0",
"xrpl-client": "^2.1.0"
"xrpl-client": "^2.1.0",
"xrpl-tx-path-parser": "^1.0.5"
},
"devDependencies": {
"@babel/eslint-parser": "^7.22.6",
Expand Down
1 change: 1 addition & 0 deletions public/locales/ca-CA/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@
"indicate_unl": "indica un validador en una UNL",
"transaction_tokens_involved": "<Currency/> i <Currency2/>",
"transaction_tokens_swapped": "<Currency/> per <Currency2/>",
"filled_price": "filled price"
"oracle_document_id": null,
"provider": null,
"last_update_time": null,
Expand Down
1 change: 1 addition & 0 deletions public/locales/en-US/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@
"indicate_unl": "indicates a validator on an UNL",
"transaction_tokens_involved": "<Currency/> and <Currency2/>",
"transaction_tokens_swapped": "<Currency/> for <Currency2/>",
"filled_price": "filled price"
"oracle_document_id": "Oracle Document ID",
"provider": "Provider",
"last_update_time": "Last Update Time",
Expand Down
55 changes: 36 additions & 19 deletions src/containers/shared/components/Transaction/OfferCreate/Simple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,57 @@ import Currency from '../../Currency'
const Simple: TransactionSimpleComponent = (props: TransactionSimpleProps) => {
const { t } = useTranslation()
const { data } = props
const { price, firstCurrency, secondCurrency, pays, gets, cancel } =
const { deliveredPrice, firstCurrency, secondCurrency, pays, gets, cancel } =
data.instructions

const getDeliveredAmount = () => {
let result: string = ''

if (deliveredPrice !== undefined) {
result = (
<SimpleRow label={t('filled_price')}>
<div className="amount" data-test="amount">
{`${Number(deliveredPrice)}`}
<div className="one-line">
<Currency
currency={firstCurrency.currency}
issuer={firstCurrency.issuer}
shortenIssuer
/>
/
<Currency
currency={secondCurrency.currency}
issuer={secondCurrency.issuer}
shortenIssuer
/>
</div>
</div>
</SimpleRow>
)
}
return result
}

const rendetfSell = () => {
const { tfSell } = data.instructions
return tfSell ? <div className="partial-row">tfSell</div> : null
}

return (
<>
<SimpleRow label={t('price')}>
<div className="amount" data-test="amount">
{`${Number(price)}`}
<div className="one-line">
<Currency
currency={firstCurrency.currency}
issuer={firstCurrency.issuer}
shortenIssuer
/>
/
<Currency
currency={secondCurrency.currency}
issuer={secondCurrency.issuer}
shortenIssuer
/>
</div>
</div>
</SimpleRow>
<SimpleRow label={t('buy')} data-test="amount-buy">
<Amount value={pays} />
</SimpleRow>
<SimpleRow label={t('sell')} data-test="amount-sell">
<Amount value={gets} />
{rendetfSell()}
</SimpleRow>
{cancel && (
<SimpleRow label={t('cancel_offer')} data-test="cancel-id">
#{cancel}
</SimpleRow>
)}
{getDeliveredAmount()}
</>
)
}
Expand Down
Loading