Skip to content

Commit 701ec43

Browse files
Merge pull request #67 from arcticicestudio/feature/gh-65-core-container-component-page
Core Container Component: Page
2 parents 6b78d69 + f2d779c commit 701ec43

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (C) 2018-present Arctic Ice Studio <[email protected]>
3+
* Copyright (C) 2018-present Sven Greb <[email protected]>
4+
*
5+
* Project: Nord Docs
6+
* Repository: https://github.com/arcticicestudio/nord-docs
7+
* License: MIT
8+
*/
9+
10+
import styled from "styled-components";
11+
12+
import { colors, motion, themedMode, MODE_BRIGHT_SNOW_FLURRY, MODE_DARK_NIGHT_FROST } from "styles/theme";
13+
14+
const backgroundColor = themedMode({
15+
[MODE_BRIGHT_SNOW_FLURRY]: colors.background.base[MODE_BRIGHT_SNOW_FLURRY],
16+
[MODE_DARK_NIGHT_FROST]: colors.background.base[MODE_DARK_NIGHT_FROST]
17+
});
18+
19+
/**
20+
* A basic wrapper component for page content.
21+
*
22+
* @since 0.3.0
23+
*/
24+
const Page = styled.main`
25+
background-color: ${backgroundColor};
26+
transition: background-color ${motion.speed.duration.transition.base.themeModeSwitch}s ease-in-out;
27+
`;
28+
29+
export default Page;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* Copyright (C) 2018-present Arctic Ice Studio <[email protected]>
3+
* Copyright (C) 2018-present Sven Greb <[email protected]>
4+
*
5+
* Project: Nord Docs
6+
* Repository: https://github.com/arcticicestudio/nord-docs
7+
* License: MIT
8+
*/
9+
10+
export { default } from "./Page";
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (C) 2018-present Arctic Ice Studio <[email protected]>
3+
* Copyright (C) 2018-present Sven Greb <[email protected]>
4+
*
5+
* Project: Nord Docs
6+
* Repository: https://github.com/arcticicestudio/nord-docs
7+
* License: MIT
8+
*/
9+
10+
import React from "react";
11+
import { render } from "react-testing-library";
12+
13+
import Page from "containers/core/Page";
14+
15+
test("snapshot", () => {
16+
const { container } = render(<Page />);
17+
expect(container).toMatchSnapshot();
18+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`snapshot 1`] = `
4+
<div>
5+
<main
6+
class="sc-bdVaJa dhBqSf"
7+
/>
8+
</div>
9+
`;

0 commit comments

Comments
 (0)