-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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-infra] Add the Base UI logo with copy functionality #42446
Conversation
Netlify deploy previewhttps://deploy-preview-42446--material-ui.netlify.app/ Bundle size report |
I created a PR in the Base UI repo that includes the logo: mui/base-ui#444. Seems to be working well (at least locally; there are some issues on CI, though). |
@alexfauquette & @michaldudak can I ask y'all to give me a code-focused review? Let me know if there's anything that can be improved there 👍 |
const handleCopy = (svgSnippet: string) => { | ||
setCopied(true); | ||
copy(svgSnippet).then(() => { | ||
setTimeout(() => setCopied(false), 3500); |
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.
What's the 3500
for?
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.
Could it be a constant (or at least have a comment in code)?
Besides, snackbars can be configured to auto-hide, so we don't need a setTimeout here.
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.
Don't we need the setTimeout
for the copy action, too, though? Like, similar to https://github.com/mui/material-ui/blob/next/docs/src/components/action/NpmCopyButton.tsx
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.
Looks great
Follow up to #42435 — This PR adds the Base UI logo to the navbars, together with the recently added copy SVG functionality. So, if you're visiting the Base UI docs, you should see the Base logo instead of the Material UI/MUI logo.
I generalized the recently created
MuiLogoMenu
component, changing its name toLogoWithCopyMenu
. Then, the specific SVG component, together with the SVG strings of each logo, is passed via the_app.js
file.