-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…-component-baselayout Core Layout Component: BaseLayout
- Loading branch information
Showing
6 changed files
with
75 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* 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"; | ||
|
||
import Page from "containers/core/Page"; | ||
import Root from "containers/core/Root"; | ||
|
||
/** | ||
* The base page layout providing the main container that wraps the content. | ||
* | ||
* @since 0.3.0 | ||
*/ | ||
const BaseLayout = ({ children }) => ( | ||
<Root> | ||
<Fragment> | ||
<Page>{children}</Page> | ||
</Fragment> | ||
</Root> | ||
); | ||
|
||
BaseLayout.propTypes = { | ||
children: PropTypes.node.isRequired | ||
}; | ||
|
||
export default BaseLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from "./BaseLayout"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
test/components/layouts/core/BaseLayout/BaseLayout.test.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* 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 { render } from "react-testing-library"; | ||
|
||
import BaseLayout from "layouts/core/BaseLayout"; | ||
|
||
test("snapshot", () => { | ||
const { container } = render( | ||
<BaseLayout> | ||
<Fragment /> | ||
</BaseLayout> | ||
); | ||
expect(container).toMatchSnapshot(); | ||
}); |
9 changes: 9 additions & 0 deletions
9
test/components/layouts/core/BaseLayout/__snapshots__/BaseLayout.test.jsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`snapshot 1`] = ` | ||
<div> | ||
<main | ||
class="sc-bdVaJa eYFyfX" | ||
/> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`snapshot 1`] = `<div />`; | ||
exports[`snapshot 1`] = ` | ||
<div> | ||
<main | ||
class="sc-bdVaJa eYFyfX" | ||
/> | ||
</div> | ||
`; |