feat: implement card section for subscription#42787
feat: implement card section for subscription#42787blimpich merged 17 commits intoExpensify:mainfrom
Conversation
683fbfe to
183e74e
Compare
src/pages/settings/Subscription/CardSection/CardSectionActions/index.tsx
Outdated
Show resolved
Hide resolved
src/pages/settings/Subscription/CardSection/CardSectionActions/index.tsx
Outdated
Show resolved
Hide resolved
src/pages/settings/Subscription/CardSection/CardSectionActions/index.native.tsx
Show resolved
Hide resolved
src/pages/settings/Subscription/CardSection/CardSectionActions/index.native.tsx
Show resolved
Hide resolved
src/pages/settings/Subscription/CardSection/CardSectionActions/index.tsx
Show resolved
Hide resolved
src/pages/settings/Subscription/CardSection/CardSectionDataEmpty/index.native.tsx
Show resolved
Hide resolved
src/pages/settings/Subscription/CardSection/CardSectionDataEmpty/index.tsx
Show resolved
Hide resolved
src/pages/settings/Subscription/ReducedFunctionalityMessage/index.native.tsx
Show resolved
Hide resolved
3b1f397 to
c1eda1b
Compare
src/pages/settings/Subscription/CardSection/CardSectionActions/index.tsx
Outdated
Show resolved
Hide resolved
src/pages/settings/Subscription/CardSection/CardSectionActions/index.tsx
Outdated
Show resolved
Hide resolved
src/pages/settings/Subscription/CardSection/CardSectionDataEmpty/index.tsx
Outdated
Show resolved
Hide resolved
src/styles/index.ts
Outdated
| subscriptionCardIcon: { | ||
| padding: 10, | ||
| backgroundColor: theme.border, | ||
| borderRadius: 10, |
There was a problem hiding this comment.
Where are these values coming from? cc @dannymcclain @dubielzyk-expensify
There was a problem hiding this comment.
It maybe looks like these styles are for this little guy?
And I'm assuming that the 10px padding is coming from the fact that the container is 40px and the icon is 20px, though I would probably just set an explicit width and height on the container and let the icon sit in the center (but maybe that's just me).
The border radius should definitely be using one of our variables—and it should be equal to 8px.
There was a problem hiding this comment.
Nice, I agree that the border radius should be 8 and that we should just vertically/horizontally center the icon within the space if we can.
src/styles/index.ts
Outdated
| color: theme.textSupporting, | ||
| }, | ||
|
|
||
| sectionListMutedInfo: { |
There was a problem hiding this comment.
Can you show a screenshot of what these styles do exactly?
There was a problem hiding this comment.
removed and updated to existing styles
src/pages/settings/Subscription/ReducedFunctionalityMessage/index.native.tsx
Outdated
Show resolved
Hide resolved
src/pages/settings/Subscription/CardSection/CardSectionDataEmpty/index.native.tsx
Outdated
Show resolved
Hide resolved
src/pages/settings/Subscription/CardSection/CardSectionDataEmpty/index.native.tsx
Outdated
Show resolved
Hide resolved
29c8ed9 to
ca63fa4
Compare
|
@s77rt PR updated |
|
Ah snap. I just realized my comment here is incorrect. Super sorry about that. Here are some labels to help out: Let me know if you have any questions, with all the different states things can get a bit confusing! |
|
Lovely! Minor nitpick but the gap between top text and bottom text doesn't seem to match what we're doing for the bank account row, in case we want those to be identical. In the bank account row, looks like we're adding 4px of top margin on the smaller gray label text below (2nd line) |
| [translate], | ||
| ); | ||
|
|
||
| const handleIconPress = useCallback(() => { |
There was a problem hiding this comment.
Function name should explicitly reflect what it does e.g. calculateAndSetThreeDotsMenuPosition
src/pages/settings/Subscription/CardSection/CardSectionActions/index.tsx
Outdated
Show resolved
Hide resolved
|
@pasyukevich I'm referring to the card icon background color and the month format. Also I just noticed that the spacing is different too (between the header text and the card row) |
|
@s77rt Background color, month format and offsets were updated |
|
|
||
| const defaultCard = useMemo(() => Object.values(fundList ?? {}).find((card) => card.isDefault), [fundList]); | ||
|
|
||
| const cardMonth = useMemo(() => DateUtils.getMonthNames(preferredLocale)[(defaultCard?.accountData?.cardMonth ?? 1) - 1], [defaultCard, preferredLocale]); |
There was a problem hiding this comment.
| const cardMonth = useMemo(() => DateUtils.getMonthNames(preferredLocale)[(defaultCard?.accountData?.cardMonth ?? 1) - 1], [defaultCard, preferredLocale]); | |
| const cardMonth = useMemo(() => DateUtils.getMonthNames(preferredLocale)[(defaultCard?.accountData?.cardMonth ?? 1) - 1], [defaultCard?.accountData?.cardMonth, preferredLocale]); |
NAB
|
|
||
| const defaultCard = useMemo(() => Object.values(fundList ?? {}).find((card) => card.isDefault), [fundList]); | ||
|
|
||
| const cardMonth = useMemo(() => DateUtils.getMonthNames(preferredLocale)[(defaultCard?.accountData?.cardMonth ?? 1) - 1], [defaultCard, preferredLocale]); |
There was a problem hiding this comment.
Does accountData.cardMonth start at 1?
There was a problem hiding this comment.
@amyevans Is that screenshot up to date? According to onyx types fundList is an object, it has isDefault field and the objects shown in your screenshot are nested inside accountData
There was a problem hiding this comment.
Talked about this internally, we're not correctly populating the fundList onyx key in the backend. We're working on fixing it. @pasyukevich can you changed this back to what you had before? Then I think we're good to merge.
src/styles/index.ts
Outdated
| height: 40, | ||
| width: 40, |
There was a problem hiding this comment.
| height: 40, | |
| width: 40, | |
| height: variables.iconSizeExtraLarge, | |
| width: variables.iconSizeExtraLarge, |
NAB
src/styles/index.ts
Outdated
| height: 40, | ||
| width: 40, |
Reviewer Checklist
Screenshots/VideosAndroid: mWeb ChromeNetworking issue |
s77rt
left a comment
There was a problem hiding this comment.
Looks good to me. Let's merge after this is confirmed #42787 (comment)
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.4.81-11 🚀
|





















Details
To access this newly created component, paste the following link into the browser
https://dev.new.expensify.com:8082/settings/subscription
or add this effect to InitialSettingsPage.tsx
Fixed Issues
$ #38616
PROPOSAL:
Tests
Offline tests
QA Steps
Same as Tests section above
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop