-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: APP-204 buy credits #2477
Merged
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
580a54e
feat: add BuyCredits flow wip
blushi 4e1bf35
feat: add more props to ChooseCreditsForm
blushi 5ac0b54
feat: update CreditsAmounts and tests
blushi 778c6c1
feat: useGetProject
blushi d9ffd2e
feat: show correct display denom
blushi 574927e
feat: Update OrderSummaryCard
blushi 5912052
feat: add prev/next buttons ChooseCreditForm
blushi 4b34a68
fix: text input overflow
blushi c30308d
feat: add prev/next btn to PaymentInfo and use stripe key
blushi e04a982
feat: add more props to PaymentInfoForm, payment methods query and s…
blushi 1060b14
feat: add login to PaymentInfoForm
blushi d3fe606
refactor: mv stripe Elements up and get confirmation token
blushi 460dc78
refactor: address review comments and add PaymentInfoFormFiat
blushi f2ec750
fix: ChooseCreditsForm validation
blushi e1dd83a
feat: use initial values on ChooseCreditsForm
blushi 2d20f37
feat: add initialValues to PaymentInfoForm
blushi 2c14976
test: fix CreditsAmount test
blushi b947546
fix: ts error
blushi 77bd2a2
chore: rename to withLocalStorage
blushi 7605f8b
feat: get card details from confirmation token id
blushi bc0c382
feat: get card details from payment method id and some refactor
blushi e348ee2
fix: AgreePurchaseForm validation
blushi a1e82cf
feat: add usePurchase and crypto buy
blushi 29f664a
test: ignore TODO test
blushi b5ec477
feat: fiat buy and few fixes
blushi 87092b1
feat: manually handleCardAction
blushi dd4d7e7
fix: add missing returns
blushi 0aff960
feat: default to fiat if any or redirect to project page if not conne…
blushi a6cafab
feat: logic for buy button on ProjectDetails page
blushi a366c5c
feat: only show wallets
blushi de5e2f6
fix: handle case where sell order id in sanity not available anymore
blushi 9051bbc
fix: redirect to project page if buy disabled
blushi 3cce4b1
feat: show modal when clicking buy with crypto
blushi 66842c1
chore: i18n
blushi 1cf0f48
chore: use find
blushi 16a2255
chore: clean up
blushi 8b2e1a5
fix: validation in ChooseCreditsForm
blushi 94f45f7
fix: filter seller sell orders
blushi f47029a
feat: set amounts when choosing tradable credits
blushi 334e535
chore: use formatted number
blushi d81be5d
feat: add retirement info to /create-payment-intent
blushi 3f582e6
chore: i18n:extract
blushi 235e1c7
fix: update fields on currency/payment option change
blushi 524cdb8
fix: error msg UI
blushi 3475456
feat: set initial credits amount to min(1,available)
blushi 6b2859a
fix: choose credits form initial values
blushi cd96173
chore: remove leading 0 from input
blushi e82943c
fix: initialization and validation choose credits form
blushi d17b40f
fix: update GET_PAYMENT_METHODS_QUERY_KEY
blushi 290e480
chore: address reviewcomments
blushi 596044f
fix: entering decimal values
blushi b24ec41
fix: setting max unneeded microToDenom
blushi 35ed494
fix: error with 0 credits available and paymentOptionCryptoClicked
blushi 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
16 changes: 0 additions & 16 deletions
16
web-components/src/components/DenomIconWithCurrency/DenomIconWithCurrency.constants.ts
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
web-components/src/components/DenomIconWithCurrency/DenomIconWithCurrency.stories.tsx
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
web-components/src/components/DenomIconWithCurrency/DenomIconWithCurrency.test.tsx
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
web-components/src/components/DenomIconWithCurrency/DenomIconWithCurrency.tsx
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
|
@@ -18,4 +18,5 @@ Default.args = { | |
root: '', | ||
label: '', | ||
}, | ||
bodyTexts: { prefinance: 'prefinance' }, | ||
}; |
This file contains 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 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
5 changes: 2 additions & 3 deletions
5
web-components/src/components/SupCurrencyAndAmount/SupCurrencyAndAmount.test.tsx
This file contains 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
2 changes: 0 additions & 2 deletions
2
web-components/src/components/cards/OrderSummaryCard/OrderSummaryCard.constants.tsx
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
web-components/src/components/cards/OrderSummaryCard/OrderSummaryCard.mock.ts
This file was deleted.
Oops, something went wrong.
This file contains 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 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 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 |
---|---|---|
@@ -1,29 +1,24 @@ | ||
/* eslint-disable lingui/no-unlocalized-strings */ | ||
import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; | ||
import React from 'react'; | ||
|
||
interface IconProps extends SvgIconProps {} | ||
|
||
export default function CreditCardIcon({ | ||
sx = [], | ||
...props | ||
}: IconProps): JSX.Element { | ||
export default function CreditCardIcon( | ||
props: React.SVGProps<SVGSVGElement>, | ||
): JSX.Element { | ||
return ( | ||
<SvgIcon | ||
<svg | ||
data-testid="CreditCardIcon" | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 29 16" | ||
sx={[{ fill: 'none' }, ...(Array.isArray(sx) ? sx : [sx])]} | ||
width="16" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
fill="none" | ||
{...props} | ||
> | ||
<g id="icon/card"> | ||
<path | ||
id="Vector" | ||
fill-rule="evenodd" | ||
clip-rule="evenodd" | ||
d="M16 4H0V3.25C0 2.56 0.448 2 1 2H15C15.552 2 16 2.56 16 3.25V4ZM16 6.5V13C16 13.2652 15.8946 13.5196 15.7071 13.7071C15.5196 13.8946 15.2652 14 15 14H1C0.734784 14 0.48043 13.8946 0.292893 13.7071C0.105357 13.5196 0 13.2652 0 13V6.5H16ZM4 10C3.73478 10 3.48043 10.1054 3.29289 10.2929C3.10536 10.4804 3 10.7348 3 11C3 11.2652 3.10536 11.5196 3.29289 11.7071C3.48043 11.8946 3.73478 12 4 12H5C5.26522 12 5.51957 11.8946 5.70711 11.7071C5.89464 11.5196 6 11.2652 6 11C6 10.7348 5.89464 10.4804 5.70711 10.2929C5.51957 10.1054 5.26522 10 5 10H4Z" | ||
fill="#4FB573" | ||
/> | ||
</g> | ||
</SvgIcon> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M16 4H0V3.25C0 2.56 0.448 2 1 2H15C15.552 2 16 2.56 16 3.25V4ZM16 6.5V13C16 13.2652 15.8946 13.5196 15.7071 13.7071C15.5196 13.8946 15.2652 14 15 14H1C0.734784 14 0.48043 13.8946 0.292893 13.7071C0.105357 13.5196 0 13.2652 0 13V6.5H16ZM4 10C3.73478 10 3.48043 10.1054 3.29289 10.2929C3.10536 10.4804 3 10.7348 3 11C3 11.2652 3.10536 11.5196 3.29289 11.7071C3.48043 11.8946 3.73478 12 4 12H5C5.26522 12 5.51957 11.8946 5.70711 11.7071C5.89464 11.5196 6 11.2652 6 11C6 10.7348 5.89464 10.4804 5.70711 10.2929C5.51957 10.1054 5.26522 10 5 10H4Z" | ||
fill="currentColor" | ||
/> | ||
</svg> | ||
); | ||
} |
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.
Couldn't this be
percentComplete !== undefined
instead of usingtypeof
?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.
I usually prefer using
typeof
because this is safer if the variable hasn't already been declared, it won't throw an error, but I agree in this case, we could also usepercentComplete !== undefined
I don't have a strong preference