diff --git a/docs/src/pages/components/drawers/SwipeableTemporaryDrawer.js b/docs/src/pages/components/drawers/SwipeableTemporaryDrawer.js
index 01ede3560ce286..3c82a28f6a4480 100644
--- a/docs/src/pages/components/drawers/SwipeableTemporaryDrawer.js
+++ b/docs/src/pages/components/drawers/SwipeableTemporaryDrawer.js
@@ -92,41 +92,19 @@ export default function SwipeableTemporaryDrawer() {
return (
- Open Left
- Open Right
- Open Top
- Open Bottom
-
- {sideList('left')}
-
-
- {fullList('top')}
-
-
- {fullList('bottom')}
-
-
- {sideList('right')}
-
+ {['left', 'right', 'top', 'bottom'].map(anchor => (
+
+ {anchor}
+
+ {sideList(anchor)}
+
+
+ ))}
);
}
diff --git a/docs/src/pages/components/drawers/SwipeableTemporaryDrawer.tsx b/docs/src/pages/components/drawers/SwipeableTemporaryDrawer.tsx
index 4494b62210ac4e..c9e83d17a9662d 100644
--- a/docs/src/pages/components/drawers/SwipeableTemporaryDrawer.tsx
+++ b/docs/src/pages/components/drawers/SwipeableTemporaryDrawer.tsx
@@ -100,41 +100,19 @@ export default function SwipeableTemporaryDrawer() {
return (
- Open Left
- Open Right
- Open Top
- Open Bottom
-
- {sideList('left')}
-
-
- {fullList('top')}
-
-
- {fullList('bottom')}
-
-
- {sideList('right')}
-
+ {(['left', 'right', 'top', 'bottom'] as DrawerSide[]).map(anchor => (
+
+ {anchor}
+
+ {sideList(anchor)}
+
+
+ ))}
);
}
diff --git a/docs/src/pages/components/drawers/TemporaryDrawer.js b/docs/src/pages/components/drawers/TemporaryDrawer.js
index 790aa1bc0bdc06..245a2afb7f2ac6 100644
--- a/docs/src/pages/components/drawers/TemporaryDrawer.js
+++ b/docs/src/pages/components/drawers/TemporaryDrawer.js
@@ -92,22 +92,14 @@ export default function TemporaryDrawer() {
return (
- Open Left
- Open Right
- Open Top
- Open Bottom
-
- {sideList('left')}
-
-
- {fullList('top')}
-
-
- {fullList('bottom')}
-
-
- {sideList('right')}
-
+ {['left', 'right', 'top', 'bottom'].map(anchor => (
+
+ {anchor}
+
+ {sideList(anchor)}
+
+
+ ))}
);
}
diff --git a/docs/src/pages/components/drawers/TemporaryDrawer.tsx b/docs/src/pages/components/drawers/TemporaryDrawer.tsx
index 515d56d6447d34..5c3230c6d33146 100644
--- a/docs/src/pages/components/drawers/TemporaryDrawer.tsx
+++ b/docs/src/pages/components/drawers/TemporaryDrawer.tsx
@@ -29,6 +29,7 @@ export default function TemporaryDrawer() {
});
type DrawerSide = 'top' | 'left' | 'bottom' | 'right';
+
const toggleDrawer = (side: DrawerSide, open: boolean) => (
event: React.KeyboardEvent | React.MouseEvent,
) => {
@@ -99,22 +100,14 @@ export default function TemporaryDrawer() {
return (
- Open Left
- Open Right
- Open Top
- Open Bottom
-
- {sideList('left')}
-
-
- {fullList('top')}
-
-
- {fullList('bottom')}
-
-
- {sideList('right')}
-
+ {(['left', 'right', 'top', 'bottom'] as DrawerSide[]).map(anchor => (
+
+ {anchor}
+
+ {sideList(anchor)}
+
+
+ ))}
);
}
diff --git a/docs/src/pages/components/drawers/drawers.md b/docs/src/pages/components/drawers/drawers.md
index 13ffac584020ce..af75b1878a25bd 100644
--- a/docs/src/pages/components/drawers/drawers.md
+++ b/docs/src/pages/components/drawers/drawers.md
@@ -20,7 +20,7 @@ It closes when an item is selected, handled by controlling the `open` prop.
{{"demo": "pages/components/drawers/TemporaryDrawer.js"}}
-## Swipeable Temporary drawer
+### Swipeable
You can make the drawer swipeable with the `SwipeableDrawer` component.