-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Payment due @ZhenjaHorbach] [Personal Karma] Add NewDot toggle flow under Save The World #84504
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
326f2e6
Add support for Personal Karma updates and related API parameters
fedirjh 490e101
Add BillingCardDetails component and integrate into CardSection
fedirjh 5cb185c
Add Personal Karma translations for multiple languages
fedirjh faefa73
Add SectionSubtitleHTML component and refactor subtitle rendering
fedirjh 30c7058
Remove donation card title from translations in multiple languages
fedirjh 94197a4
Add Personal Karma feature to SaveTheWorldPage
fedirjh 824cf87
Refactor imports and enhance style
fedirjh 2da801f
Merge remote-tracking branch 'upstream' into personal-karma-new-dot
fedirjh 60c8b69
Enhance BillingCardDetails component and update translations
fedirjh cb1acb3
Merge remote-tracking branch 'upstream' into personal-karma-new-dot
fedirjh d6036ce
Add PaymentCardDetails component and update references in SaveTheWorl…
fedirjh e4dc325
Update personal karma copy
fedirjh 9ab0629
Add new route and screen for adding payment card in Save The World fe…
fedirjh 260ae39
Merge remote-tracking branch 'upstream' into personal-karma-new-dot
fedirjh d61d13a
Fix prettier formatting and ESLint prefer-early-return error
MelvinBot 82bd712
Merge branch 'main' into personal-karma-new-dot
fedirjh d6e9015
Remove unused useCardFeeds import
MelvinBot 68bc3fc
Merge branch 'Expensify:main' into personal-karma-new-dot
fedirjh c3d269d
Merge remote-tracking branch 'upstream' into personal-karma-new-dot
fedirjh f439482
Merge remote-tracking branch 'upstream' into personal-karma-new-dot
fedirjh b64503a
feat: add openSaveTheWorldPage command and corresponding API integration
fedirjh 6739a42
Merge remote-tracking branch 'upstream' into personal-karma-new-dot
fedirjh d933acc
Merge branch 'Expensify:main' into personal-karma-new-dot
fedirjh f2d2b99
Merge branch 'Expensify:main' into personal-karma-new-dot
fedirjh b30b75f
chore: Remove unnecessary useMemo and update SaveTheWorldPage to util…
fedirjh b4dfd83
Merge branch 'Expensify:main' into personal-karma-new-dot
fedirjh 82b996d
chore: Add "PINATM" to cspell.json dictionary
fedirjh be8f82d
feat: Add optimistic UI state for personal karma updates
fedirjh 61d7ea8
feat: Integrate FullPageNotFoundView for enhanced user experience in …
fedirjh dc3adc8
Merge branch 'Expensify:main' into personal-karma-new-dot
fedirjh 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
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,58 @@ | ||
| import type {ReactNode} from 'react'; | ||
| import React, {useMemo} from 'react'; | ||
| import type {StyleProp, ViewStyle} from 'react-native'; | ||
| import {View} from 'react-native'; | ||
| import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useTheme from '@hooks/useTheme'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import DateUtils from '@libs/DateUtils'; | ||
| import {getPaymentMethodDescription} from '@libs/PaymentUtils'; | ||
| import type Fund from '@src/types/onyx/Fund'; | ||
| import {isEmptyObject} from '@src/types/utils/EmptyObject'; | ||
| import Text from './Text'; | ||
| import Icon from './Icon'; | ||
|
|
||
| type BillingCardDetailsProps = { | ||
| /** The billing card data */ | ||
| card?: Fund; | ||
|
|
||
| /** Optional right side content (e.g. action menu) */ | ||
| rightComponent?: ReactNode; | ||
|
|
||
| /** Optional wrapper styles */ | ||
| wrapperStyle?: StyleProp<ViewStyle>; | ||
| }; | ||
|
|
||
| function BillingCardDetails({card, rightComponent, wrapperStyle}: BillingCardDetailsProps) { | ||
| const styles = useThemeStyles(); | ||
| const theme = useTheme(); | ||
| const {translate} = useLocalize(); | ||
| const icons = useMemoizedLazyExpensifyIcons(['CreditCard']); | ||
|
|
||
| const cardMonth = useMemo(() => DateUtils.getMonthNames()[(card?.accountData?.cardMonth ?? 1) - 1], [card?.accountData?.cardMonth]); | ||
|
|
||
| if (!card?.accountData || isEmptyObject(card?.accountData)) { | ||
| return null; | ||
| } | ||
|
|
||
| return ( | ||
| <View style={[styles.flexRow, styles.flex1, styles.gap3, wrapperStyle]}> | ||
| <Icon | ||
| src={icons.CreditCard} | ||
| additionalStyles={styles.subscriptionAddedCardIcon} | ||
| fill={theme.icon} | ||
| medium | ||
| /> | ||
| <View style={styles.flex1}> | ||
| <Text style={styles.textStrong}>{getPaymentMethodDescription(card.accountType, card.accountData, translate)}</Text> | ||
| <Text style={styles.mutedNormalTextLabel}> | ||
| {translate('subscription.cardSection.cardInfo', card.accountData.addressName ?? '', `${cardMonth} ${card.accountData.cardYear ?? ''}`, card.accountData.currency ?? '')} | ||
| </Text> | ||
| </View> | ||
| {rightComponent} | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| export default BillingCardDetails; |
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,37 @@ | ||
| import type {ComponentProps} from 'react'; | ||
| import React from 'react'; | ||
| import type {StyleProp, ViewStyle} from 'react-native'; | ||
| import {View} from 'react-native'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import RenderHTML from './RenderHTML'; | ||
|
|
||
| type SectionSubtitleHTMLProps = { | ||
| /** Subtitle HTML content */ | ||
| html: string; | ||
|
|
||
| /** Whether the subtitle text should be muted */ | ||
| subtitleMuted?: boolean; | ||
|
|
||
| /** Optional link press handler */ | ||
| onLinkPress?: ComponentProps<typeof RenderHTML>['onLinkPress']; | ||
|
|
||
| /** Optional wrapper style */ | ||
| wrapperStyle?: StyleProp<ViewStyle>; | ||
| }; | ||
|
|
||
| function SectionSubtitleHTML({html, subtitleMuted = false, onLinkPress, wrapperStyle}: SectionSubtitleHTMLProps) { | ||
| const styles = useThemeStyles(); | ||
| const shouldWrapWithMutedText = subtitleMuted && !/<\s*muted-text(?:-[a-z]+)?(?:\s|>)/.test(html); | ||
| const subtitleHTML = shouldWrapWithMutedText ? `<muted-text>${html}</muted-text>` : html; | ||
|
|
||
| return ( | ||
| <View style={[styles.flexRow, styles.w100, styles.mt2, styles.renderHTML, wrapperStyle]}> | ||
| <RenderHTML | ||
| html={subtitleHTML} | ||
| onLinkPress={onLinkPress} | ||
| /> | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| export default SectionSubtitleHTML; |
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
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,5 @@ | ||
| type UpdatePersonalKarmaParams = { | ||
| enabled: boolean; | ||
| }; | ||
|
|
||
| export default UpdatePersonalKarmaParams; |
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
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.