-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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: About Page #2926
feat: About Page #2926
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
@Julesssss need some clarification / help regarding the best practices and other stuff:
Once these gets resolved I will start writing the tests and then we can go ahead with review and merging. |
I have read the CLA Document and I hereby sign the CLA |
Hi @pranshuchittora, I'd suggest that you join the contributor's Slack channel to ask the more general questions, as you'll likely get faster answers. Details should be in the UpWork message.
That sounds good to me, we can probably replace the shouldShow prop and simply check if an icon is passed. I think the
We shouldn't declare inline styles, but should define objects in styles.js. I'd ask about 3 in the Slack channel, someone should know.
So in this case we want to navigate to the chat with Concierge (our support). If you log into the app you should see a conversation with Concierge -- this is the chat we want to navigate the user to. |
Thanks @Julesssss
To perform the following navigation is there any fixed id/route for this chat? |
The chatReportID will be different for each user, but we should always have this data stored locally in Onyx. You could retrieve all reports from Onyx and filter for the |
Thanks for the heads-up but I am not familiar with Onyx can you pls help me with the query |
A lot of Components within the app have examples of retrieving data from Onyx. Here's some info to get you started.
|
Thanks a lot. |
Is this correct? Simulator.Screen.Recording.-.iPhone.11.-.2021-05-14.at.20.45.36.mp4 |
58c873b
to
5515545
Compare
@Julesssss this PR is up for review Simulator.Screen.Recording.-.iPhone.11.-.2021-05-14.at.21.02.23.mp4 |
src/pages/settings/AboutPage.js
Outdated
<View style={styles.pageWrapper}> | ||
<View style={[styles.settingsPageBody, styles.mb6]}> | ||
<Logo height={100} /> | ||
<Text style={[styles.textLabel, styles.alignSelfCenter, {marginVertical: 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.
You should be able to use a utility style for the margin rather than using an inline style here. So for example, we might already have something like mv-2
or mv-3
. Check them out here: https://github.com/Expensify/Expensify.cash/blob/main/src/styles/utilities/spacing.js It looks like you might need to create the style you need for mv-X
or alternatively, just use mt-2 mb-2
. As a heads up, we do everything as an increment of the unit of 4.
Can you also give this version a muted color? You can simply add styles.colorMuted
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.
Thanks for the review @shawnborton, I have added mv[1,2,3,4,5]
. I think this looks more maintainable and clean.
src/languages/en.js
Outdated
}, | ||
initialSettingsPage: { | ||
settings: 'Settings', | ||
about: 'About', | ||
aboutPage: { | ||
appDownloadLinks: 'App Download Links', |
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 this should be App download links
so it follows the same capitalisation format as the others. @trjExpensify how do you feel about that?
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.
Dome :)
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.
Agreed 👍
That looks correct @pranshuchittora. I will get to the PR on Monday as I am on BST. In the meantime, could you add a screenshot for each platform, thanks. -- I will add this step to the contributor guidelines |
src/pages/settings/AboutPage.js
Outdated
shouldShowRightArrow | ||
/> | ||
))} | ||
<View style={[styles.sidebarFooter, styles.pAbsolute, styles.b0]}> |
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 this would be better off if we used flexbox instead of absolute positioning. For example, what happens when someone's screen height is short?
I think we could accomplish this by using something like alignSelf: flex-end
assuming this child would live within a flexbox parent that has flex-direction: column
or something like that.
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.
Great! It would be helpful to see this layout on web where the browser height is not very tall. Could you test there and let me know how it looks?
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.
Yeah I agree - ideally that page would scroll if it needs to.
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.
Adding ScrollView 👍🏼
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.
Done 🚀
Screen.Recording.2021-05-14.at.11.26.17.PM.mov
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.
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.
Awesome, looks great!
For the "Report a bug" row, this should not be opening a new window and should redirect to the 1:1 chat with Concierge within the Expensify.cash app itself. |
It is redirecting |
Hi @shawnborton @Julesssss |
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.
Please undo all of the automatic (or not) style changes, it makes the PR difficult to review and doesn't comply with this section of our contributing guidelines.
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 please remove all the unnecessary formatting changes? It's adding time to the review. Thanks!
d64977c
to
bbdd6b6
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.
My concerns are resolved. I'll let the other reviewers have the final approve.
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.
@Julesssss looks like there is no inconsistency in the Can you please confirm, what are the possible values for this? I have pushed the comment styling fix :) |
Actually, I think we should use the alternative mentioned here: https://github.com/Expensify/Expensify.cash/pull/2926/files#r634344289 |
I have made all the changes :) cc @Julesssss |
Hi @pranshuchittora, the PR looks good to me, but can you add test steps so that QA knows what to check. Thanks! |
@Julesssss I have add the testing strategy for QA in the PR description |
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.
Tested well on all platforms.
Thanks, @Julesssss for the awesome PR review. Apologies for the auto linting due to some bad configuration of my IDE. |
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.
@pranshuchittora I ran into some questions with some of the propType changes here.
/** Boolean whether to display the ArrowRight icon */ | ||
shouldShowRightArrow: PropTypes.bool, | ||
/** Boolean whether to display the right icon */ | ||
shouldShowRightIcon: PropTypes.bool, |
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.
Why do we need an extra prop for this? Shouldn't the render method just look at iconRight
and if there is no value, then it wouldn't display anything?
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.
The reason for having a boolean because for every usage we need to import the icon and pass that as a prop. I agree that we can do that but the majority of the use cases in the code uses an arrow icon, hence importing it every time might be tedious.
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.
Yeah, my original suggestion was to simply check if the icon prop had a value.
I wouldn't block a suggestion to make this change, but upon seeing the PR it made sense to keep the arrow as default, because overriding the default icon is the exception to the rule here -- every other menu item will display the chevron and it felt redundant to specifically state this on every menu item.
@@ -63,9 +68,9 @@ const MenuItem = ({ | |||
</Text> | |||
</View> | |||
</View> | |||
{shouldShowRightArrow && ( | |||
{shouldShowRightIcon && ( |
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 see several places in the code which passes iconRight
but not shouldShowRightIcon
and so that would mean those places never have the iconRight
displayed?
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.
Pls have a look at the iterator over the data
https://github.com/Expensify/Expensify.cash/blob/bbdd6b6d6b83d7e980dc7f99ffbdab9e6f33100d/src/pages/settings/AppDownloadLinks.js#L58
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.
Hmm, upon review it is a bit confusing that shouldShowRightIcon
is defined outside of the menuItems
array
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.
This is because all these items share the same icon property so it’s better to define it once.
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.
In that case, the argument against repeating the Right Icon import is a bit weaker, because it would also be defined once for each page...
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.
Stepping back, I think there are three cases trying to be handled here:
- There is no right icon
- There is a right icon, and it defaults to an arrow
- There is a right icon, and it is a specific icon
Rather than trying to tackle this in a single component, I think it would be much better to separate this into two components:
<MenuItem>
has no right icon<MenuItemWithRightIcon>
has a right icon that defaults to the arrow<MenuItemWithRightIcon icon={foo}>
has a right icon that is a specific icon
I have not looked at all the places in the code where we currently use <MenuItem>
so I don't know how complex it would be to implement, but I think having the two separate components makes it much easier for someone else to come along and use them without needing to dig into the source to figure out how the props work.
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.
@tgolen I would rather prefer this
<MenuItem>
<MenuItem.RightIcon icon={foo} />
</MenuItem>
or
<MenuItem>
<MenuItem.RightIcon>
<Icon /> // or <SomeComposedComponent />
<MenuItem.RightIcon>
</MenuItem>
I really agree that refactoring of building blocks (components) is required to support long term goals.
If we want to move forward with this or any other API for components then I can pull this off as I have some significant experience in design systems.
I am one of the core maintainer of React Native Elements
cc @Julesssss
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.
@pranshuchittora Ah yes, those would work as well! Can you help me understand why you would prefer that pattern over the one I proposed? Is it just personal preference, or is there a specific reason for it?
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’s a bit opinionated but makes things easy to maintain and also makes the code readable (from consumer end)
Ref -> https://react-bootstrap.github.io/components/cards/#basic-example
|
||
/** A boolean flag that gives the icon a green fill if true */ | ||
success: PropTypes.bool, | ||
|
||
// Overrides the icon for shouldShowRightIcon | ||
iconRight: PropTypes.element, |
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.
I think this should be changed
- iconRight: PropTypes.element
+ iconRight: PropTypes.elementType
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.
@pranshuchittora would you mind holding on until @tgolen is able to reply, then create a new PR with these suggestions? Thanks!
Ah yes, I can see that being valuable in the example of implementing that
into an entire component library. I think since we are not following any of
those patterns in our components, that we don't really want to start now
(without re-thinking about how ALL our components are implemented). Because
of that, I'd prefer the method that I suggested for now. Thanks for the
extra context!
…On Thu, May 20, 2021 at 11:41 PM Pranshu Chittora ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/components/MenuItem.js
<#2926 (comment)>
:
> @@ -63,9 +68,9 @@ const MenuItem = ({
</Text>
</View>
</View>
- {shouldShowRightArrow && (
+ {shouldShowRightIcon && (
It’s a bit opinionated but makes things easy to maintain and also makes
the code readable (from consumer end)
Ref -> https://react-bootstrap.github.io/components/cards/#basic-example
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2926 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJMAB2TIBECD3MYDBBXCI3TOXXBXANCNFSM444MNGKQ>
.
|
Dropping a note that this has caused a 'regression': #12238 |
Details
About Page
Fixed Issues
Closes #2811
TODO
QA Steps / Testing Strategy 🧪
About Page
Concierge
chat.App Download Links Page
Miscellaneous
Tested On
Screenshots
iOS
Simulator.Screen.Recording.-.iPhone.11.-.2021-05-15.at.15.05.34.mp4
Android
Peek.2021-05-15.15-48.mp4
Desktop App
Screen.Recording.2021-05-15.at.3.11.38.PM.mov
Web
Screen.Recording.2021-05-15.at.3.06.51.PM.mov