Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
return state;
}
function updateDrawerType(state, { drawerType }) {
if (state.customDrawerType === drawerType) {
return state;
}
return Object.assign({}, state, { customDrawerType: drawerType });
}
const pathname = (window && window.location && window.location.pathname) || '';
const { mobile, tablet, desktop } = Drawer.getCurrentMedia(Drawer.defaultProps);
let defaultMedia = 'mobile';
if (desktop) {
defaultMedia = 'desktop';
} else if (tablet) {
defaultMedia = 'tablet';
}
const initialState = {
mobile,
tablet,
desktop,
defaultMedia,
toolbarTitle: toPageTitle(pathname),
toolbarProminent: !pathname.match(/minimizing/) && !!pathname.match(/components|customization/),
visibleBoxShadow: isBoxShadowVisible(pathname),
};
render() {
const { mobile, tablet } = this.props;
const allowedTypes = types.filter(type => !(isPermanent(type) && (mobile || tablet)) && !(isPersistent(type) && mobile));
return (
<section>
</section>
);
}
}
import Drawer from 'react-md/lib/Drawers';
export const UPDATE_MEDIA = 'UPDATE_MEDIA';
export function updateMedia(drawerType, media) {
return { type: UPDATE_MEDIA, payload: { drawerType, media } };
}
const { mobile, tablet, desktop } = Drawer.getCurrentMedia(Drawer.defaultProps);
let defaultMedia = 'desktop';
if (mobile) {
defaultMedia = 'mobile';
} else if (tablet) {
defaultMedia = 'tablet';
}
export const INITIAL_STATE = { mobile, tablet, desktop, defaultMedia };
export default function media(state = INITIAL_STATE, action) {
switch (action.type) {
case UPDATE_MEDIA:
return { ...state, ...action.payload.media };
default:
return state;
}
}
return state;
}
function updateDrawerType(state, { drawerType }) {
if (state.customDrawerType === drawerType) {
return state;
}
return Object.assign({}, state, { customDrawerType: drawerType });
}
const pathname = __CLIENT__ ? window.location.pathname : '';
const { mobile, tablet, desktop } = Drawer.getCurrentMedia(Drawer.defaultProps);
let defaultMedia = 'mobile';
if (desktop) {
defaultMedia = 'desktop';
} else if (tablet) {
defaultMedia = 'tablet';
}
const initialState = {
mobile,
tablet,
desktop,
defaultMedia,
toolbarTitle: toPageTitle(pathname),
toolbarProminent: !pathname.match(/minimizing/) && !!pathname.match(/components|customization/),
visibleBoxShadow: isBoxShadowVisible(pathname),
};
render() {
const { mobile, tablet } = this.props;
const allowedTypes = types.filter(type => !(isPermanent(type) && (mobile || tablet)) && !(isPersistent(type) && mobile));
return (
<section>
</section>
);
}
}