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] Migrate Breadcrumbs demos to emotion #25302

Merged

Conversation

vicasas
Copy link
Member

@vicasas vicasas commented Mar 10, 2021

The following demos of the Breadcrumbs component were migrated:

  • Custom separator
  • Breadcrumbs with icons
  • Customized breadcrumbs
  • Integration with react-router

💄 A refactoring was done for the Custom Separator demo, I am left with the example code in view after dividing into different demos.

Related to #16947

@mui-pr-bot
Copy link

mui-pr-bot commented Mar 10, 2021

No bundle size changes

Generated by 🚫 dangerJS against 1753cc6

@vicasas
Copy link
Member Author

vicasas commented Mar 10, 2021

The diferent detected for argos is for refactoring made in Custom Separator demo

Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

While I appreciate the effort to breakdown the demos into 3 to enable the inline previews. I fear it's counterproductive in its application. We can no longer see the 3 differents separators at a slimps. I would propose this instead:

diff --git a/docs/src/pages/components/breadcrumbs/CustomSeparator.tsx b/docs/src/pages/components/breadcrumbs/CustomSeparator.tsx
index 23faf7970d..718c59f051 100644
--- a/docs/src/pages/components/breadcrumbs/CustomSeparator.tsx
+++ b/docs/src/pages/components/breadcrumbs/CustomSeparator.tsx
@@ -23,49 +23,36 @@ function handleClick(event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) {
 export default function CustomSeparator() {
   const classes = useStyles();

+  const breadcrumbs = [
+    <Link key="1" color="inherit" href="/" onClick={handleClick}>
+      Material-UI
+    </Link>,
+    <Link
+      key="2"
+      color="inherit"
+      href="/getting-started/installation/"
+      onClick={handleClick}
+    >
+      Core
+    </Link>,
+    <Typography key="3" color="textPrimary">
+      Breadcrumb
+    </Typography>,
+  ];
+
   return (
     <div className={classes.root}>
       <Breadcrumbs separator="›" aria-label="breadcrumb">
-        <Link color="inherit" href="/" onClick={handleClick}>
-          Material-UI
-        </Link>
-        <Link
-          color="inherit"
-          href="/getting-started/installation/"
-          onClick={handleClick}
-        >
-          Core
-        </Link>
-        <Typography color="textPrimary">Breadcrumb</Typography>
+        {breadcrumbs}
       </Breadcrumbs>
       <Breadcrumbs separator="-" aria-label="breadcrumb">
-        <Link color="inherit" href="/" onClick={handleClick}>
-          Material-UI
-        </Link>
-        <Link
-          color="inherit"
-          href="/getting-started/installation/"
-          onClick={handleClick}
-        >
-          Core
-        </Link>
-        <Typography color="textPrimary">Breadcrumb</Typography>
+        {breadcrumbs}
       </Breadcrumbs>
       <Breadcrumbs
         separator={<NavigateNextIcon fontSize="small" />}
         aria-label="breadcrumb"
       >
-        <Link color="inherit" href="/" onClick={handleClick}>
-          Material-UI
-        </Link>
-        <Link
-          color="inherit"
-          href="/getting-started/installation/"
-          onClick={handleClick}
-        >
+        {breadcrumbs}
       </Breadcrumbs>
       <Breadcrumbs
         separator={<NavigateNextIcon fontSize="small" />}
         aria-label="breadcrumb"
       >
-        <Link color="inherit" href="/" onClick={handleClick}>
-          Material-UI
-        </Link>
-        <Link
-          color="inherit"
-          href="/getting-started/installation/"
-          onClick={handleClick}
-        >
-          Core
-        </Link>
-        <Typography color="textPrimary">Breadcrumb</Typography>
+        {breadcrumbs}
       </Breadcrumbs>
     </div>
   );
diff --git a/docs/src/pages/components/breadcrumbs/breadcrumbs.md b/docs/src/pages/components/breadcrumbs/breadcrumbs.md
index 5c87a84247..efed34cfdd 100644
--- a/docs/src/pages/components/breadcrumbs/breadcrumbs.md
+++ b/docs/src/pages/components/breadcrumbs/breadcrumbs.md
@@ -23,7 +23,7 @@ Keep the last breadcrumb interactive.

 ## Custom separator

-In the following examples, we are using two string separators, and an SVG icon.
+In the following examples, we are using two string separators and an SVG icon.

 {{"demo": "pages/components/breadcrumbs/CustomSeparator.js"}}

Screenshot 2021-03-10 at 23 23 48

@oliviertassinari oliviertassinari added component: breadcrumbs This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation labels Mar 10, 2021
@vicasas
Copy link
Member Author

vicasas commented Mar 10, 2021

I review tomorrow

@vicasas
Copy link
Member Author

vicasas commented Mar 11, 2021

I would propose this instead:

Woooow! look better! 😄

@oliviertassinari oliviertassinari merged commit d781626 into mui:next Mar 13, 2021
@vicasas vicasas changed the title [docs] Migrate Breadcrumbs to emotion [docs] Migrate Breadcrumbs demos to emotion Mar 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: breadcrumbs 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.

3 participants