Closed thienlnam closed 1 year ago
Triggered auto assignment to @puneetlath (NewFeature
), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details.
Triggered auto assignment to Design team member for new feature review - @shawnborton (NewFeature
)
Job added to Upwork: https://www.upwork.com/jobs/~01cb19c0e49400d07e
Triggered auto assignment to @tjferriss (External
), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel (External
)
Triggered auto assignment to @puneetlath (External
), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @burczu (External
)
Accidentally added the 'External' label twice, removed the second C+ assignee - sorry for the noise
I'd like to work on this (unsure if this requires a formal proposal).
Add avatar details in the lounge access page
New feature
Use withCurrentUserPersonalDetails
for getting the current user personal details and add session
in withOnyx
to fetch from Onyx if required to show the email as we do the same for InitialSettingsPage
.
https://github.com/Expensify/App/blob/cceb862e4566b10cc5afecf1d016af45f87177d6/src/pages/settings/InitialSettingsPage.js#L379
To make the overlay on the Illustration we need to use linear-gradient with colors(transparent, black or appBg). We can use direct css linear-gradient but it will only works for the web and not for native. So we need to use the lib react-native-linear-gradient
. This lib is already added in this PR.
For that, we can create a prop called shouldShowGradient
in IllustratedHeaderPageLayout
and pass value true from LoungeAccessPage
. For shouldShowGradient
true we need to use LinearGradient
by passing the colors which we also configured later if required.
{shouldShowGradient && <LinearGradient colors={['transparent', themeColors.appBG]} style={[styles.pAbsolute, styles.w100, styles.h100]} />}
Create the flex View
with aligned content in the center which will have the avatar, display name and login consisting of required margins/paddings.
To place the content on the Illustration we need to provide a negative margin for the above View
.
withCurrentUserPersonalDetails
to get the user's details and also the code we have in InitialSettingsPage.js
.{position: 'absolute', top: -120, left: 0, right: 0}
to position it correctly.Compare Changes Link:
@thienlnam do you want to be the CME for this since you're proposing the feature?
Sure I can take it
Cool, I'll still stay on for the BZ-side.
can i work on this as this an feature request so i think no need formal proposal.
@pradeepmdk you should still make a proposal for how you'll implement it if you'd like the job.
Add avatar details to the Lounge Access Page
new feature request
IllustratedHeaderPageLayout.js
from the workspace listView
and Text
Componentreact-native-svg
https://medium.com/@ibrahimozdogan/adding-gradient-in-react-native-f75ddd02aea4
or we can react-native-linear-gradient
recently added to our project.https://github.com/Expensify/App/blob/8d84c23ae3a21130a540794104313b2f7e7e6b6a/src/pages/settings/Profile/LoungeAccessPage.js
for adding user details in the Illustrated we need to set the parent view should toposition: relative
and the user view should be position: absolute
in the IllustratedHeaderPageLayout.js
we add overlayComponent with position: absolute
like footer
<View style={styles.overscrollSpacer(backgroundColor, windowHeight)} />
<View style={[styles.alignItemsCenter, styles.pRelative, styles.justifyContentEnd, StyleUtils.getBackgroundColorStyle(backgroundColor)]}>
<Lottie
source={illustration}
style={styles.w100}
autoPlay
loop
/>
{!_.isNull(overlayComponent) && <View style={[styles.loungeAccess]}>
{overlayComponent}
</View>}
</View>
<View style={[styles.pt5]}>{children}</View>
</ScrollView>
{!_.isNull(footer) && <FixedFooter>{footer}</FixedFooter>}
and we need to create an overlay component with user Details that will pass from https://github.com/Expensify/App/blob/8d84c23ae3a21130a540794104313b2f7e7e6b6a/src/pages/settings/Profile/LoungeAccessPage.js
<IllustratedHeaderPageLayout
title={translate('loungeAccessPage.loungeAccess')}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS)}
illustration={LottieAnimations.ExpensifyLounge}
overlayComponent={<View >
<Text style={{color: 'green'}}>
pradeep
</Text>
</View>}
>
All the proposals have a general outline, But I would like more details specifically on how we are planning to add the user details above the illustration.
Thanks!
@Santhosh-Sellavel proposal updated https://github.com/Expensify/App/issues/24381#issuecomment-1673780098
@Santhosh-Sellavel Updated Proposal with: (https://github.com/Expensify/App/issues/24381#issuecomment-1673650589)
Please give suggestions if needed.
@Santhosh-Sellavel proposal updated https://github.com/Expensify/App/issues/24381#issuecomment-1673650212.
Un-assigning myself as @puneetlath is handling BugZero role.
Sorry for the delay here.
After checking the proposals all proposals should do the job, @pradeepmdk proposal has it all required. And I like the idea of overlayComponent for rendering the Avatar and username. Over negative margin idea from other proposals.
cc: @thienlnam Let me know your thoughts
@Santhosh-Sellavel Just a small request for you, can you review all other proposals and point out the disadvantage they have over the selected proposal
@Santhosh-Sellavel @pradeepmdk We need the user details to show on the Lottie animation part as well outside of it. I doubt how it can be achieved with Overlay component with user details to place after Lottie code as mentioned in the selected proposal.
I do believe that to achieve the above, negative margin for the View
makes sense as we do need a space for the content(making that overflow will overlap with the Lounge access page content and needs adjustment to overcome overlap unnecessarily which doesn't looks correct to me).
@Pujan92 we can do without negative margin
@pradeepmdk I assume you have increased the top margin/padding of the content which starts with "You qualify...". If this is the case then it is the other way around only. So this leads to if we increase more content for the user details you need to adjust or increase more margin/padding as the content is set with the absolute position. Whereas this won't be the situation when we set relative position for the user details content. does this makes sense?
@Pujan92 I am not using margin/padding for content only using flex for rendering the content
style={[styles.flex1, styles.justifyContentEnd, styles.alignItemsCenter]}
Looks like the avatar needs to be a bit bigger too.
@shawnborton this is bigger image in our app same size in the profile screen
avatarSizeLarge: 80,
avatarLarge: {
width: variables.avatarSizeLarge,
height: variables.avatarSizeLarge,
},
Fair point, what if we update those to be 100x100 everywhere?
let me list out where our these changes reflacted
@pradeepmdk can you plz explain when you use absolute View for the user details part, how the below content goes down with flex without setting any margin/padding between Lottie and content? I would appreciate if you can list down all the suggested changes with code as I still have a doubt about it.(Requesting bcoz my thinking is when the View requires space(height/width) separately we should go with Relative instead absolute)
@Pujan92
you don't need to move the content to the bottom
you can use locations
<LinearGradient
locations={[0, 0.73]}
colors={['transparent', themeColors.appBG, ]}
style={[styles.flex1, styles.justifyContentEnd, styles.alignItemsCenter]}
>
{profile()}
</LinearGradient>
this will take fill up the Lottie
space if we need more space in the bottom we can add in relative to the bottom space
<View style={[styles.alignItemsCenter, styles.pRelative, styles.pb8, styles.justifyContentEnd, StyleUtils.getBackgroundColorStyle(backgroundColor)]}>
@Pujan92 you don't need to move the content to the bottom you can use
locations
locations={[0, 0.73]} <View style={[styles.alignItemsCenter, styles.pRelative, styles.pb8, styles.justifyContentEnd,
Exactly, my point here is that we need to adjust locations
and styles.pb8
(which you applied for the space I am mentioning) whenever we have a change in the content size of the user details part. Due to this, I am not considering it as a preferable solution.
In contrast to above, I am suggesting the overlay only on the Lottie animation part and negative margin for the relative user details View. With that, we don't need to use/adjust locations or extra paddings.
I am not sure whether @Santhosh-Sellavel @thienlnam are following what I am trying to highlight.
Thanks, everyone for the active discussion.
Sorry @jeet-dhandha.
I don't see a disadvantage in any of the proposals. We have two similar proposals yours & @Pujan92 only difference is the difference in linear background. I liked the overlay idea In @pradeepmdk's proposal as it comes in handy for other pages too.
Regarding @Pujan92's thoughts
I don't see any negative in using locations.
But setting up the bottom padding seems off to me, Where would this go @pradeepmdk ?
<View style={[styles.alignItemsCenter, styles.pRelative, styles.pb8, styles.justifyContentEnd, StyleUtils.getBackgroundColorStyle(backgroundColor)]}>
I think the fade-out needs to be applied on only Lottie, otherwise it seems to be like a workaround to me as need to adjust as per the content height. For eg. if in the user details we add some more content then location 0.73 may be starts after the animation, so no effect can be seen on Lottie. Considering the mentioned handy part, I think it won't work consistently when it is used at other places where Lottie's height and the content height get changed as 0.73 seems to be worked only for this scenario.
@Santhosh-Sellavel
without styles.pb8
still working
@Pujan92 I am not adding this linear component to the IllustratedHeaderPageLayout
page.
overlayComponent
comes from LoungeAccessPage
and the same for style overlayComponentStyle
comes from LoungeAccessPage
only.
styles.pb8
is still also coming from LoungeAccessPage
in overlayComponentStyle
for adding space at the bottom.
we have already footer
component like this only
<IllustratedHeaderPageLayout
title={translate('loungeAccessPage.loungeAccess')}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS)}
illustration={LottieAnimations.ExpensifyLounge}
overlayComponentStyle={[styles.pb8]}
overlayComponent={
<LinearGradient
locations={[0, 0.73]}
colors={['transparent', themeColors.appBG, ]}
style={[styles.flex1, styles.justifyContentEnd, styles.alignItemsCenter]}
>
{profile()}
</LinearGradient>
}
>
!_.isNull(overlayComponent) && <View style={[styles.pAbsolute, styles.w100, styles.h100]}>{overlayComponent}</View>
That feels like it doesn't quite match the mockup though - the header area with the lounge illustration feels too short.
@shawnborton Yes that's why I added styles.pb8
for adding more space for illustration
@pradeepmdk where overlayComponentStyle
is used?
@Santhosh-Sellavel here
<IllustratedHeaderPageLayout
title={translate('loungeAccessPage.loungeAccess')}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS)}
illustration={LottieAnimations.ExpensifyLounge}
illustrationStyle={[{marginBottom: 60}]}
overlayComponent={
<LinearGradient
locations={[0, 0.8]}
colors={['transparent', themeColors.appBG, ]}
style={[styles.flex1, styles.justifyContentEnd, styles.alignItemsCenter]}
>
{profile()}
</LinearGradient>
}
>
<Lottie
source={illustration}
style={[styles.w100, ...illustrationStyle]}
autoPlay
loop
/>
Thank you @pradeepmdk!
Can you share the latest screenshot of this?
if we need more space we can increase the padding-bottom
and avatarLarge
used those places
https://github.com/Expensify/App/blob/b07cbefe04ab2f7d4d815ffa2cb1a082c6ea4950/src/components/AvatarWithImagePicker.js?#L236
https://github.com/Expensify/App/blob/b07cbefe04ab2f7d4d815ffa2cb1a082c6ea4950/src/components/RoomHeaderAvatars.js?#L47
https://github.com/Expensify/App/blob/b07cbefe04ab2f7d4d815ffa2cb1a082c6ea4950/src/pages/settings/InitialSettingsPage.js?#L352 https://github.com/Expensify/App/blob/b07cbefe04ab2f7d4d815ffa2cb1a082c6ea4950/src/pages/workspace/WorkspaceInitialPage.js?#L210
Yeah, that doesn't quite match up with the mockup. Can you take another look please and see if we can get that illustration area just slightly taller?
Nice, that feels better!
can I create the PR?
@thienlnam you good with @pradeepmdk moving forward? As @Santhosh-Sellavel recommended here.
To help identify customers and address #nocreeps violations, we're going to add the avatar to the lounge access page for when users check in.
Internal issue
Upwork Automation - Do Not Edit