Skip to content

Commit

Permalink
Implement "Root" core container component
Browse files Browse the repository at this point in the history
It renders the passed `children` within a `React.Fragment`.

The `Root` core container is the first and one of the important main
data provider React components of this project. It represents the base
element and entry point that wraps the all custom application components
and serves as a data provider later on. Some of the tasks in the future
will be to

- provide context props and functions for the global theme through
  styled-components (1) `ThemeProvider` (3) component
- inject global styles through styled-components
  `createglobalstyle` (3) function including typography (GH-2) related
  data like application-wide used fonts
- possibly data stores for state management libraries like MobX (4)

References:
  (1) https://styled-components.com
  (2) https://www.styled-components.com/docs/api#createglobalstyle
  (3) https://www.styled-components.com/docs/api#themeprovider
  (4) https://mobx.js.org

GH-36
  • Loading branch information
arcticicestudio committed Nov 20, 2018
1 parent 4fe5473 commit 2522938
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/components/containers/core/Root/Root.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (C) 2018-present Arctic Ice Studio <[email protected]>
* Copyright (C) 2018-present Sven Greb <[email protected]>
*
* Project: Nord Docs
* Repository: https://github.com/arcticicestudio/nord-docs
* License: MIT
*/

import React, { Fragment } from "react";
import PropTypes from "prop-types";

/**
* The root container.
*
* @author Arctic Ice Studio <[email protected]>
* @author Sven Greb <[email protected]>
* @since 0.1.0
*/
const Root = ({ children }) => <Fragment>{children}</Fragment>;

Root.propTypes = {
children: PropTypes.node.isRequired
};

export default Root;
1 change: 1 addition & 0 deletions src/components/containers/core/Root/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "./Root";

0 comments on commit 2522938

Please sign in to comment.