Skip to content

Commit

Permalink
Provide clearer message when importing invalid offer (#2393)
Browse files Browse the repository at this point in the history
- Do not show offer expiration when offer is invalid
  • Loading branch information
markelrod committed Jun 13, 2024
1 parent 4bb0404 commit 5d64421
Show file tree
Hide file tree
Showing 41 changed files with 248 additions and 53 deletions.
2 changes: 1 addition & 1 deletion packages/gui/src/components/offers/OfferHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function OfferHeader(props: OfferHeaderProps) {
headerElement = (
<Typography variant="subtitle1" color="error">
<Trans>
{'This offer is no longer valid. To understand why, click '}
{'This offer is no longer valid because it was accepted or cancelled. Click '}
<Link
target="_blank"
href="https://docs.chia.net/getting-started/wallet-guide/#taker-attempts-to-accept-an-invalid-offer"
Expand Down
4 changes: 2 additions & 2 deletions packages/gui/src/components/offers2/OfferBuilderViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function OfferBuilderViewer(props: OfferBuilderViewerProps, ref: any) {
) : showInvalid ? (
<Alert severity="error">
<Trans>
{'This offer is no longer valid. To understand why, click '}
{'This offer is no longer valid because it was accepted or cancelled. Click '}
<Link
target="_blank"
href="https://docs.chia.net/getting-started/wallet-guide/#taker-attempts-to-accept-an-invalid-offer"
Expand Down Expand Up @@ -298,7 +298,7 @@ function OfferBuilderViewer(props: OfferBuilderViewerProps, ref: any) {
<Loading center />
) : (
<Flex flexDirection="column" gap={3}>
{hasExpiration && (
{hasExpiration && !showInvalid && (
<OfferBuilderExpirationSection
isViewing
currentTime={currentTime}
Expand Down
7 changes: 6 additions & 1 deletion packages/gui/src/locales/ar-SA/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5187,9 +5187,14 @@ msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr ""

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
msgstr ""
Expand Down
7 changes: 6 additions & 1 deletion packages/gui/src/locales/be-BY/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5187,9 +5187,14 @@ msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr ""

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
msgstr ""
Expand Down
7 changes: 6 additions & 1 deletion packages/gui/src/locales/bg-BG/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5187,9 +5187,14 @@ msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr ""

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
msgstr ""
Expand Down
7 changes: 6 additions & 1 deletion packages/gui/src/locales/ca-ES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5187,9 +5187,14 @@ msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr ""

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
msgstr ""
Expand Down
7 changes: 6 additions & 1 deletion packages/gui/src/locales/cs-CZ/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5187,9 +5187,14 @@ msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr ""

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
msgstr ""
Expand Down
7 changes: 6 additions & 1 deletion packages/gui/src/locales/da-DK/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5187,9 +5187,14 @@ msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr ""

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
msgstr ""
Expand Down
7 changes: 6 additions & 1 deletion packages/gui/src/locales/de-DE/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5189,9 +5189,14 @@ msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr ""

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
msgstr ""
Expand Down
7 changes: 6 additions & 1 deletion packages/gui/src/locales/el-GR/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5187,9 +5187,14 @@ msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr ""

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
msgstr ""
Expand Down
9 changes: 7 additions & 2 deletions packages/gui/src/locales/en-AU/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5191,8 +5191,13 @@ msgstr "This offer has completed successfully"

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgstr "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr "This offer is no longer valid. To understand why, click <0>here</0> to learn more."

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
Expand Down
9 changes: 7 additions & 2 deletions packages/gui/src/locales/en-NZ/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5191,8 +5191,13 @@ msgstr "This offer has completed successfully"

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgstr "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr "This offer is no longer valid. To understand why, click <0>here</0> to learn more."

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
Expand Down
7 changes: 6 additions & 1 deletion packages/gui/src/locales/en-PT/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5187,9 +5187,14 @@ msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr ""

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
msgstr ""
Expand Down
9 changes: 7 additions & 2 deletions packages/gui/src/locales/en-US/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5191,8 +5191,13 @@ msgstr "This offer has completed successfully"

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgstr "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr "This offer is no longer valid. To understand why, click <0>here</0> to learn more."

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
Expand Down
7 changes: 6 additions & 1 deletion packages/gui/src/locales/es-AR/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5187,9 +5187,14 @@ msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr ""

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
msgstr ""
Expand Down
7 changes: 6 additions & 1 deletion packages/gui/src/locales/es-ES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5187,9 +5187,14 @@ msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr ""

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
msgstr ""
Expand Down
7 changes: 6 additions & 1 deletion packages/gui/src/locales/es-MX/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5187,9 +5187,14 @@ msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr ""

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
msgstr ""
Expand Down
9 changes: 7 additions & 2 deletions packages/gui/src/locales/fa-IR/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5191,8 +5191,13 @@ msgstr "این پیشنهاد با موفقیت به پایان رسید"

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgstr "این پیشنهاد دیگر معتبر نخواهد بود. برای درک دلیل، <0>اینجا</0> را کلیک کنید تا بیشتر بدانید."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr "این پیشنهاد دیگر معتبر نخواهد بود. برای درک دلیل، <0>اینجا</0> را کلیک کنید تا بیشتر بدانید."

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
Expand Down
9 changes: 7 additions & 2 deletions packages/gui/src/locales/fi-FI/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5191,8 +5191,13 @@ msgstr "Tarjous on suljettu onnistuneesti"

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgstr "Tarjous ei ole enää voimassa. Napsauta <0>tästä</0> katsoaksesi miksi."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr "Tarjous ei ole enää voimassa. Napsauta <0>tästä</0> katsoaksesi miksi."

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
Expand Down
9 changes: 7 additions & 2 deletions packages/gui/src/locales/fr-FR/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5191,8 +5191,13 @@ msgstr "Cette offre s'est terminée avec succès"

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgstr "Cette offre n'est plus valide. Pour en savoir plus, cliquez <0>ici</0>."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr "Cette offre n'est plus valide. Pour en savoir plus, cliquez <0>ici</0>."

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
Expand Down
7 changes: 6 additions & 1 deletion packages/gui/src/locales/hr-HR/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5187,9 +5187,14 @@ msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr ""

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
msgstr ""
Expand Down
7 changes: 6 additions & 1 deletion packages/gui/src/locales/hu-HU/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5187,9 +5187,14 @@ msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr ""

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
msgstr ""
Expand Down
7 changes: 6 additions & 1 deletion packages/gui/src/locales/id-ID/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5187,9 +5187,14 @@ msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr ""

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
msgstr ""
Expand Down
7 changes: 6 additions & 1 deletion packages/gui/src/locales/it-IT/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5187,9 +5187,14 @@ msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr ""

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
msgstr ""
Expand Down
7 changes: 6 additions & 1 deletion packages/gui/src/locales/ja-JP/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5190,9 +5190,14 @@ msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
msgid "This offer is no longer valid because it was accepted or cancelled. Click <0>here</0> to learn more."
msgstr ""

#: src/components/offers/OfferHeader.tsx:46
#: src/components/offers2/OfferBuilderViewer.tsx:262
#~ msgid "This offer is no longer valid. To understand why, click <0>here</0> to learn more."
#~ msgstr ""

#: src/components/offers2/OfferBuilderViewer.tsx:279
msgid "This offer was cancelled"
msgstr ""
Expand Down
Loading

0 comments on commit 5d64421

Please sign in to comment.