How to use the grommet-icons.ThemeContext function in grommet-icons

To help you get started, we’ve selected a few grommet-icons 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 grommet / grommet / components / Box / Box.js View on Github external
innerRef: forwardRef,
        directionProp: direction,
        elevationProp: elevation,
        fillProp: fill,
        overflowProp: overflow,
        wrapProp: wrap,
        responsive: responsive,
        theme: theme
      }, rest),
      contents
    );

    if (stateTheme) {
      if (stateTheme.dark !== propsTheme.dark && stateTheme.icon) {
        content = _react2.default.createElement(
          _grommetIcons.ThemeContext.Provider,
          { value: stateTheme.icon },
          content
        );
      }
      content = _react2.default.createElement(
        _contexts.ThemeContext.Provider,
        { value: stateTheme },
        content
      );
    }

    return content;
  };
github grommet / grommet / components / hocs.js View on Github external
var IconThemeComponent = function IconThemeComponent(props) {
    return _react2.default.createElement(
      _grommetIcons.ThemeContext.Consumer,
      null,
      function (iconTheme) {
        return _react2.default.createElement(WrappedComponent, _extends({}, props, { iconTheme: iconTheme }));
      }
    );
  };
github grommet / grommet / components / Layer / LayerContainer.js View on Github external
}

    if (onEsc) {
      content = _react2.default.createElement(
        _Keyboard.Keyboard,
        { target: 'document', onEsc: onEsc },
        content
      );
    }

    if (modal) {
      content = _react2.default.createElement(
        _FocusedContainer2.default,
        { hidden: position === 'hidden', restrictScroll: true },
        _react2.default.createElement(
          _grommetIcons.ThemeContext.Provider,
          { value: theme.icon },
          content
        )
      );
    }

    return content;
  };
github grommet / grommet / components / Grommet / Grommet.js View on Github external
Grommet.prototype.render = function render() {
    var _props = this.props,
        children = _props.children,
        rest = _objectWithoutProperties(_props, ['children']);

    delete rest.theme;
    var _state = this.state,
        responsive = _state.responsive,
        theme = _state.theme;


    return _react2.default.createElement(
      _contexts.ThemeContext.Provider,
      { value: theme },
      _react2.default.createElement(
        _grommetIcons.ThemeContext.Provider,
        { value: theme.icon },
        _react2.default.createElement(
          _contexts.ResponsiveContext.Provider,
          { value: responsive },
          _react2.default.createElement(
            _StyledGrommet2.default,
            _extends({}, rest, { theme: theme }),
            children
          )
        )
      )
    );
  };