Skip to content
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

[Skeleton] Make the demos feel more realistic #38212

Merged

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Jul 29, 2023

A continuation of #37893 (comment). My goal is to make the examples more realistic as well as simpler. It's a quick polish.

Before: https://mui.com/joy-ui/react-skeleton/
After: https://deploy-preview-38212--material-ui.netlify.app/joy-ui/react-skeleton/

@oliviertassinari oliviertassinari added docs Improvements or additions to the documentation component: skeleton This is the name of the generic UI component, not the React module! labels Jul 29, 2023
@oliviertassinari oliviertassinari force-pushed the joy-skeleton-realistic-demo branch 2 times, most recently from d6b29b3 to 88c9b7b Compare July 29, 2023 13:41
Comment on lines -29 to +34
{loading ? 'Stop' : 'Start'} Loading
{loading ? 'Stop' : 'Start'} loading
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Casing convention.

<Box sx={{ display: 'flex', gap: 2 }}>
<Stack spacing={2} useFlexGap>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More idomatic?

src="https://images.unsplash.com/photo-1686548812883-9d3777f4c137?h=400&fit=crop&auto=format&dpr=2"
src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not supposed to have the real data at this point in time.

<Box sx={{ m: 'auto', display: 'flex', alignItems: 'center', gap: 2 }}>
<Skeleton loading={loading} variant="circular" width={48} height={48} />
<Box>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty boxes like this one looks wrong, I'm expanding the thought on this in mui/mui-x#9831.

Comment on lines -1 to 7
<Box sx={{ m: 'auto' }}>
<Avatar src={loading ? '' : '/static/images/avatar/1.jpg'}>
<Skeleton loading={loading} />
</Avatar>
</Box>
<FormControl
orientation="horizontal"
sx={{ gap: 1, justifyContent: 'center' }}
>
<Avatar src={loading ? '' : '/static/images/avatar/1.jpg'}>
<Skeleton loading={loading} />
</Avatar>
<FormControl orientation="horizontal" sx={{ gap: 1 }}>
<Switch
size="sm"
checked={loading}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simpler preview

@mui-bot
Copy link

mui-bot commented Jul 29, 2023

Netlify deploy preview

https://deploy-preview-38212--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 04d66ed

@danilo-leal danilo-leal requested a review from zanivan July 31, 2023 21:28
@oliviertassinari oliviertassinari merged commit c138713 into mui:master Aug 5, 2023
17 checks passed
@oliviertassinari oliviertassinari deleted the joy-skeleton-realistic-demo branch August 5, 2023 16:51
richbustos pushed a commit that referenced this pull request Aug 7, 2023
Co-authored-by: zanivan <victorzanivan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: skeleton This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants