Skip to content

Commit c8ebdc3

Browse files
Added suggested changes for global themes for swipeable drawer.
1 parent f2d74e9 commit c8ebdc3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/material-ui/src/SwipeableDrawer/SwipeableDrawer.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import ReactDOM from 'react-dom';
44
import { elementTypeAcceptingRef } from '@material-ui/utils';
5+
import { getThemeProps, useTheme } from '@material-ui/styles';
56
import Drawer, { getAnchor, isHorizontal } from '../Drawer/Drawer';
67
import ownerDocument from '../utils/ownerDocument';
78
import useEventCallback from '../utils/useEventCallback';
@@ -121,7 +122,9 @@ const transitionDurationDefault = { enter: duration.enteringScreen, exit: durati
121122

122123
const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
123124

124-
const SwipeableDrawer = React.forwardRef(function SwipeableDrawer(props, ref) {
125+
const SwipeableDrawer = React.forwardRef(function SwipeableDrawer(inProps, ref) {
126+
const theme = useTheme();
127+
const props = getThemeProps({ name: 'MuiSwipeableDrawer', props: { ...inProps }, theme });
125128
const {
126129
anchor = 'left',
127130
disableBackdropTransition = false,
@@ -620,7 +623,7 @@ SwipeableDrawer.propTypes = {
620623
style: PropTypes.object,
621624
}),
622625
/**
623-
* Props applied to the swipe area element.
626+
* The element is used to intercept the touch events on the edge..
624627
*/
625628
SwipeAreaProps: PropTypes.object,
626629
/**

0 commit comments

Comments
 (0)