Skip to content

Commit

Permalink
Merge pull request #3829 from storybooks/3825-fix-theming
Browse files Browse the repository at this point in the history
Fix non-polyfilled themed UI components
  • Loading branch information
shilman authored Jul 3, 2018
2 parents 7c33f1e + e8fe173 commit c24eea7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ui/src/modules/ui/components/search_box.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import PropTypes from 'prop-types';
import React from 'react';
import styled from 'react-emotion';
import { polyfill } from 'react-lifecycles-compat';

import ReactModal from 'react-modal';
import FuzzySearch from 'react-fuzzy';
Expand Down Expand Up @@ -62,6 +63,7 @@ const suggestionTemplate = (props, state, styles, clickHandler) =>
));

class SearchBox extends React.Component {
state = {};
static getDerivedStateFromProps({ theme }) {
return {
modalClass: css({
Expand Down Expand Up @@ -154,4 +156,5 @@ SearchBox.propTypes = {
};

export { SearchBox };
polyfill(SearchBox);
export default withTheme(SearchBox);
3 changes: 3 additions & 0 deletions lib/ui/src/modules/ui/components/shortcuts_help.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { Component } from 'react';
import styled from 'react-emotion';
import { css } from 'emotion';
import { withTheme } from 'emotion-theming';
import { polyfill } from 'react-lifecycles-compat';

import ReactModal from 'react-modal';

Expand Down Expand Up @@ -136,6 +137,7 @@ Shortcuts.propTypes = {
};

class ShortcutsHelp extends Component {
state = {};
static getDerivedStateFromProps({ theme }) {
return {
modalClass: css({
Expand Down Expand Up @@ -194,4 +196,5 @@ ShortcutsHelp.defaultProps = {
onClose: () => {},
};

polyfill(ShortcutsHelp);
export default withTheme(ShortcutsHelp);

0 comments on commit c24eea7

Please sign in to comment.