How to use the grommet-icons.ThemeContext.Provider 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 / es6 / 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 React.createElement(
      ThemeContext.Provider,
      { value: theme },
      React.createElement(
        IconThemeContext.Provider,
        { value: theme.icon },
        React.createElement(
          ResponsiveContext.Provider,
          { value: responsive },
          React.createElement(
            StyledGrommet,
            _extends({}, rest, { theme: theme }),
            children
          )
        )
      )
    );
  };
github grommet / grommet / es6 / components / Layer / LayerContainer.js View on Github external
}

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

    if (modal) {
      content = React.createElement(
        FocusedContainer,
        { hidden: position === 'hidden', restrictScroll: true },
        React.createElement(
          IconThemeContext.Provider,
          { value: theme.icon },
          content
        )
      );
    }

    return content;
  };
github grommet / grommet / es6 / 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 = React.createElement(
          IconThemeContext.Provider,
          { value: stateTheme.icon },
          content
        );
      }
      content = React.createElement(
        ThemeContext.Provider,
        { value: stateTheme },
        content
      );
    }

    return content;
  };