-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[docs] Add demo for a bottom app bar #13030
Conversation
@oliviertassinari can you please tell me, the improvement/changes that I need to do for this? :) |
@adeelibr It comes from my understanding that the pull request isn't finished yet. |
Can you kindly provide me with some feedback, on the missing stuff from this PR. So that I can start working on it right away. I thought I was done 😅 |
Form my understanding the main pain point to solve is around scroll handling, both for top and bottom app bar. We could also have a demo with icons, closer to what the specification demonstrate. |
You could try following this example: https://material.io/design/components/app-bars-bottom.html#anatomy Centered FAB seems to be the defacto (I'm aware we need fix the default color...). |
@@ -38,3 +38,7 @@ A primary searchbar. | |||
## Dense (desktop only) | |||
|
|||
{{"demo": "pages/demos/app-bar/DenseAppBar.js"}} | |||
|
|||
## Appbar Fixed Bottom |
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.
"Bottom App Bar"?
return ( | ||
<div className={classes.container}> | ||
<section className={classes.main}> | ||
<p> |
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.
Typography
(Although I'm not mad on the wall of text for this demo.)
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.
Actually, according to the spec, it isn't even valid usage: https://material.io/design/components/app-bars-bottom.html#usage
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.
Understood! Working on it! I am sorry for the late reply, I have been stuck with office work! I'll have it done by tomorrow. Thank you for your guidance.
Is this better @mbrookes @oliviertassinari ? I tried replicating the example from material design |
@adeelibr Better, but based on the text and choice of icons, that looks like a top app bar moved to the bottom. Better to follow the example from the spec as requested. Also, as mentioned, thebottom app bar isn't valid usage in conjunction with a page of text:
|
@mbrookes did you mean something like this? and on mobile; |
Also while I was looking at the link you shared above, one link let to the other 😄 and I found an issue created on the Would it be okay to add this example using our components in the Appbar documentation, I'd love to create another PR after this is done, .. whenever this is done. 😅 |
Much better. You could lose the "Material-UI" text (that doesn't belong on a bottom AppBar), and set a width on the demo. You could follow: https://material-ui.com/demos/buttons/#floating-action-buttons ( The FAB doesn't appear to stay centered as you resize. The "Inbox" label at the top of the list doesn't look right to me. Do you have a an example of that from the spec? You could make the subheader sticky though. Regarding the MCW inset example, it's a clever hack, but it doesn't meet the spec in a couple of important ways. The cutout is solid white rather than transparent, so content scrolled behind would get cut off. The corners of the cutout aren't rounded. IT doesn't support scrolling the app-bar out of view. Interesting to see that MCW uses CSS variables. (No IE11 or Opera Mini support.) |
I took the example from https://material.io/design/components/app-bars-bottom.html#behavior I have made the subheader sticky.
The examples where not official, it was made by a contributor. But MCW hasn't added it into their official docs. |
Also regarding the implementation I showed earlier, I played with it a bit, and I can see the content behind the fab button. As you can below. Your thoughts? regarding the part
I think we can play with this using vanilla js specifically the |
Interesting. There appeared to be a solid white bar behind the purple bar. I admit I didn't try creating scrollable content. |
Okay, no, it's actually a transparent bar with a drop-shadow, it just looked white due to the white background: This does mean that there's a shadow where there shouldn't be, overlaying the content behind, but nothing you can do about that with pure CSS.
No, that isn't the problem: since the "cut-out" is a transparent div with a border-radius, there's no way to change the shape to reflect the portion of the FAB that intersects with it as it animates out. It's a decent compromise for a fixed app bar with inset FAB, but the whole point of the inset FAB seems to be to support transitions and scrolling, so fixed doesn't make much sense. |
Understood. Regarding this current PR, is this PR okay to be merged? |
Nearly. The sticky subheader shouldn’t have a transparent background, and now that the demo is in better shape, it also needs code review. |
Done sir. Can you please review the code. @mbrookes |
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.
Okay, this is starting to look really good! A couple of typos in the messages, and a couple of nice-to-haves, and we're there!
{ | ||
id: 3, | ||
primary: 'Recipe to try', | ||
secondary: 'I am try out this new BaqBQ recipe, I think this might be amazing', |
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.
-new BaqBQ
+ new BBQ
}, | ||
{ | ||
id: 5, | ||
primary: 'Doctors Appointment', |
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.
-Doctors
+Doctor's
{ | ||
id: 5, | ||
primary: 'Doctors Appointment', | ||
secondary: 'My appointment for the dentist was rescheduled for next Saturday.', |
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.
-dentist
+doctor
Inbox | ||
</Typography> | ||
<List className={classes.list}> | ||
<ListSubheader className={classes.subHeader}>Today</ListSubheader> |
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 might be nice to have a second sub-header for "Yesterday". You could add them conditionally above the ListItem based on the id
, for example 'Today' before. 1
, and 'Yesterday' before 3
.
<ListSubheader className={classes.subHeader}>Today</ListSubheader> | ||
{messages.map(({ id, primary, secondary }) => ( | ||
<ListItem key={id} button> | ||
<Avatar alt="Remy Sharp" src="/static/images/remy.jpg" /> |
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.
Another nice-to-have, but perhaps we could have a couple more avatar images, and add the names to the messages object? Does the recipient only have one friend? 😆
-src="/static/images/remy.jpg"
+src="{`/static/images/${user}.jpg`}"
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 are only 2 images of people remy.jpg
and uxceo-128.jpg
in the images/
folder, Can I add more image assets in their, maybe the profile pictures of members of Material-UI
?
Haha. Sure, why not one more. No need to add the whole team though, just assign those three to the messages at random. Edit: just a thought though, do you have a color version for consistency with the others? |
I have updated the demo, can you kindly review again 😅 |
This is going to seem very pedantic, but could you assign the avatars randomly 🎲 - it will look more natural. |
Sir I have updated the demo, is this better now? @mbrookes |
I was afraid that might happen if I didn't spell it out. My fault. 😅 Please revert to assigning them in the array, but randomly. i.e. not 1, 2, 3, 1, 2, 3... I also notice a couple of other niggles:
|
I have updated the demo;
I have also synced this with the latest |
@adeelibr Nice job! Just compare the end result with the first draft. 👌 |
@mbrookes thank you for being so helpful, with the code reviews. Working on Material-UI has been a great learning experience and with every code review and suggestion that I get from the team members here. I just improve a lot. So thank you for giving me an opportunity to work on this. |
@mui-org/core-contributors Any last comments? |
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.
Some visual distinction between ListSubHeader and ListItem would be nice. Looks bad when text is scrolling below it. I think some divider below is sufficient.
@eps1lon It's how the pinned sub-header behaves in the list demo. List sub-headers don't have a divider in the spec, although I couldn't see an example of pinned sub-headers. Lets park this for now, and keep the examples consistent. Feel free to open an issue if you think we can improve the ListSubheader component. |
🎉 |
Added a demo in the
app-bar
section for bottom app-bar.Related to issue:
#12956 (comment)
Edit from @eps1lon:
preview of the created demo from this PR