How to use the react-md/lib/Drawers.defaultProps function in react-md

To help you get started, we’ve selected a few react-md examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mlaursen / react-md / documentation / src / shared / reducers / drawer.js View on Github external
}

  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),
};
github mlaursen / react-md / docs / src / shared / components / ReactMD / navigation-drawers / ControlReactMDDrawer.jsx View on Github external
render() {
    const { mobile, tablet } = this.props;
    const allowedTypes = types.filter(type => !(isPermanent(type) && (mobile || tablet)) && !(isPersistent(type) && mobile));

    return (
      <section>
        
      </section>
    );
  }
}
github mlaursen / react-md / documentation / src / state / media.js View on Github external
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;
  }
github mlaursen / react-md / docs / src / shared / reducers / drawer.js View on Github external
}

  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),
};
github mlaursen / react-md / documentation / src / shared / components / navigation-drawers / ControlReactMDDrawer.jsx View on Github external
render() {
    const { mobile, tablet } = this.props;
    const allowedTypes = types.filter(type =&gt; !(isPermanent(type) &amp;&amp; (mobile || tablet)) &amp;&amp; !(isPersistent(type) &amp;&amp; mobile));

    return (
      <section>
        
      </section>
    );
  }
}