Skip to content

Commit

Permalink
Implement ThemeProvider into Root core container
Browse files Browse the repository at this point in the history
To provide the global theme (1), the `ThemeProvider` (2) component has
been implemented into the `Root` core container component (3). The
global theme, placed in `src/styles/themes` is passed to the provider to
make the theme globally available.

References:
  (1) https://www.styled-components.com/docs/advanced#theming
  (2) https://www.styled-components.com/docs/api#themeprovider
  (3) #36

Associated epics: GH-51
GH-53
  • Loading branch information
arcticicestudio committed Dec 2, 2018
1 parent 66db7eb commit eeb4e96
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/containers/core/Root/Root.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

import React, { Fragment } from "react";
import PropTypes from "prop-types";
import { createGlobalStyle } from "styled-components";
import { ThemeProvider, createGlobalStyle } from "styled-components";
import modernNormalize from "styled-modern-normalize";

import { global, normalize } from "styles/theme";
import theme, { global, normalize } from "styles/theme";

/* eslint-disable import/extensions */
import "inter-ui";
Expand Down Expand Up @@ -42,7 +42,7 @@ const GlobalStyle = createGlobalStyle`
const Root = ({ children }) => (
<Fragment>
<GlobalStyle />
<Fragment>{children}</Fragment>
<ThemeProvider theme={theme}>{children}</ThemeProvider>
</Fragment>
);

Expand Down

0 comments on commit eeb4e96

Please sign in to comment.