-
Notifications
You must be signed in to change notification settings - Fork 3k
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: implement card section for subscription #42787
Conversation
683fbfe
to
183e74e
Compare
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.
Left comments.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are these values coming from? cc @dannymcclain @dubielzyk-expensify
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -2791,6 +2795,16 @@ const styles = (theme: ThemeColors) => | |||
color: theme.textSupporting, | |||
}, | |||
|
|||
sectionListMutedInfo: { |
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.
Can you show a screenshot of what these styles do exactly?
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.
removed and updated to existing styles
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function name should explicitly reflect what it does e.g. calculateAndSetThreeDotsMenuPosition
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.
changed
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does accountData.cardMonth start at 1?
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 think so
@amyevans Could you confirm this?
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.
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.
updated
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
@blimpich reverted
src/styles/index.ts
Outdated
height: 40, | ||
width: 40, |
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.
height: 40, | |
width: 40, | |
height: variables.iconSizeExtraLarge, | |
width: variables.iconSizeExtraLarge, |
NAB
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.
updated
src/styles/index.ts
Outdated
height: 40, | ||
width: 40, |
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.
Same ^
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.
updated
Reviewer Checklist
Screenshots/VideosAndroid: mWeb ChromeNetworking issue |
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.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop