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

[docs] Fix template page issues #44466

Merged
merged 10 commits into from
Nov 22, 2024

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Nov 18, 2024

Push #44253 forward (so asking a review from the same people).

Preview: https://deploy-preview-44466--material-ui.netlify.app/material-ui/getting-started/templates/

I landed here a bit by chance, I thought I would get a bit in the details 😄

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Nov 18, 2024
@mui-bot
Copy link

mui-bot commented Nov 18, 2024

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 4165747

Comment on lines -1 to -5
module.exports = {
rules: {
'jsx-a11y/anchor-is-valid': 'off',
},
};
Copy link
Member Author

@oliviertassinari oliviertassinari Nov 18, 2024

Choose a reason for hiding this comment

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

Initially, I wanted to do a small PR, wanted to move this to the root per mui/mui-public#213.

import ExpandMoreIcon from '@mui/icons-material/ExpandMore';

export default function FAQ() {
const [expanded, setExpanded] = React.useState<string | false>(false);
Copy link
Member Author

@oliviertassinari oliviertassinari Nov 18, 2024

Choose a reason for hiding this comment

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

I hate this UX so much anytime I land on a website that does this (FAQ accordions close themselves, let me open everything). I think https://tailwindui.com/all-access or https://mui.com/pricing/ does this right.

Comment on lines 12 to 15
import Typography from '@mui/material/Typography';

import { styled } from '@mui/material/styles';

import ForgotPassword from './ForgotPassword';
import { GoogleIcon, FacebookIcon, SitemarkIcon } from './CustomIcons';
Copy link
Member Author

Choose a reason for hiding this comment

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

Weird.

Comment on lines -36 to +44
viewport: { width: 1680, height: 1092 },
viewport: { width: 813 * 2, height: 457 * 2 },
Copy link
Member Author

Choose a reason for hiding this comment

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

To match the layout of the page where those are shown.

export default function Templates() {
export default function MaterialFreeTemplatesCollection() {
Copy link
Member Author

Choose a reason for hiding this comment

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

Should match the filename

@@ -115,7 +116,8 @@ export default function Templates() {
component="img"
// The image source is generated from `pnpm template:screenshot material-ui`, do not modify the image manually.
image={`/static/screenshots${layout.href.replace(/\/$/, '')}.jpg`}
title={layout.title}
alt={layout.title}
fetchPriority={index === 0 ? 'high' : undefined}
Copy link
Member Author

@oliviertassinari oliviertassinari Nov 18, 2024

Choose a reason for hiding this comment

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

I wasn't sure that we wanted to use loading="lazy" so I went for this instead. The goal is to reduce LCP.

SCR-20241119-baix

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, annoying vercel/next.js#65161 only really works with React 19.

Comment on lines -64 to +69
You can reach our customer support team by emailing
<Link> [email protected] </Link>
or calling our toll-free number. We&apos;re here to assist you
You can reach our customer support team by emailing&nbsp;
<Link href="mailto:[email protected]">[email protected]</Link>
&nbsp;or calling our toll-free number. We&apos;re here to assist you
Copy link
Member Author

Choose a reason for hiding this comment

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

This looked broken:

SCR-20241118-uiqa

Comment on lines +103 to +104
<Link
href={layout.href}
Copy link
Member Author

Choose a reason for hiding this comment

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

Make the whole image clickable, reduce the distance the mouse has to travel, so much more enjoyable on my end 😌.

Comment on lines -210 to +188
<symbol id="copied-icon" viewBox="0 0 24 24">
<path d="M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.24 11.28L9.69 11.2c-.38-.39-.38-1.01 0-1.4.39-.39 1.02-.39 1.41 0l1.36 1.37 4.42-4.46c.39-.39 1.02-.39 1.41 0 .38.39.38 1.01 0 1.4l-5.13 5.17c-.37.4-1.01.4-1.4 0zM3 6c-.55 0-1 .45-1 1v13c0 1.1.9 2 2 2h13c.55 0 1-.45 1-1s-.45-1-1-1H5c-.55 0-1-.45-1-1V7c0-.55-.45-1-1-1z" />
</symbol>
</svg>`);
rendered.unshift(`<svg style="display: none;" xmlns="http://www.w3.org/2000/svg">
<symbol id="comment-link-icon" viewBox="0 0 24 24">
<path d="M22.8481 4C22.8481 2.9 21.9481 2 20.8481 2H4.84814C3.74814 2 2.84814 2.9 2.84814 4V16C2.84814 17.1 3.74814 18 4.84814 18H18.8481L22.8481 22V4ZM16.8481 11H13.8481V14C13.8481 14.55 13.3981 15 12.8481 15C12.2981 15 11.8481 14.55 11.8481 14V11H8.84814C8.29814 11 7.84814 10.55 7.84814 10C7.84814 9.45 8.29814 9 8.84814 9H11.8481V6C11.8481 5.45 12.2981 5 12.8481 5C13.3981 5 13.8481 5.45 13.8481 6V9H16.8481C17.3981 9 17.8481 9.45 17.8481 10C17.8481 10.55 17.3981 11 16.8481 11Z" />
</symbol>
</svg>`);
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Did a quick dive, this is a regression from #37664.

Copy link
Member Author

Choose a reason for hiding this comment

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

Did a quick dive, this is a regression from #37664.

@oliviertassinari oliviertassinari added the bug 🐛 Something doesn't work label Nov 19, 2024
Copy link
Contributor

@zanivan zanivan left a comment

Choose a reason for hiding this comment

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

Thanks for the improvement! I still have a couple questions, though

Copy link
Contributor

@zanivan zanivan left a comment

Choose a reason for hiding this comment

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

Cool, great improvement! 👍

@oliviertassinari oliviertassinari merged commit 7d0e66b into mui:master Nov 22, 2024
22 checks passed
@oliviertassinari oliviertassinari deleted the fix-template-page branch November 22, 2024 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants