From eeb4e9611ef94801fcfd9011ca6a8db2530bf5dc Mon Sep 17 00:00:00 2001 From: Arctic Ice Studio Date: Sun, 2 Dec 2018 21:01:16 +0100 Subject: [PATCH] Implement `ThemeProvider` into `Root` core container 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) https://github.com/arcticicestudio/nord-docs/issues/36 Associated epics: GH-51 GH-53 --- src/components/containers/core/Root/Root.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/containers/core/Root/Root.jsx b/src/components/containers/core/Root/Root.jsx index 40b519aa..6fe9a88a 100644 --- a/src/components/containers/core/Root/Root.jsx +++ b/src/components/containers/core/Root/Root.jsx @@ -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"; @@ -42,7 +42,7 @@ const GlobalStyle = createGlobalStyle` const Root = ({ children }) => ( - {children} + {children} );