選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

functions.js 943B

1234567891011121314151617181920212223242526272829303132
  1. /* @flow */
  2. import { ColorSchemeRegistry } from '../color-scheme';
  3. import { toState } from '../redux';
  4. /**
  5. * Checks if a {@code Dialog} with a specific {@code component} is currently
  6. * open.
  7. *
  8. * @param {Function|Object} stateful - The redux store, the redux
  9. * {@code getState} function, or the redux state itself.
  10. * @param {React.Component} component - The {@code component} of a
  11. * {@code Dialog} to be checked.
  12. * @returns {boolean}
  13. */
  14. export function isDialogOpen(stateful: Function | Object, component: Object) {
  15. return toState(stateful)['features/base/dialog'].component === component;
  16. }
  17. /**
  18. * Maps part of the Redux state to the props of any Dialog based component.
  19. *
  20. * @param {Object} state - The Redux state.
  21. * @returns {{
  22. * _dialogStyles: StyleType
  23. * }}
  24. */
  25. export function _abstractMapStateToProps(state: Object): Object {
  26. return {
  27. _dialogStyles: ColorSchemeRegistry.get(state, 'Dialog')
  28. };
  29. }