diff --git a/src/components/containers/core/Page/Page.jsx b/src/components/containers/core/Page/Page.jsx new file mode 100644 index 00000000..586faeeb --- /dev/null +++ b/src/components/containers/core/Page/Page.jsx @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2018-present Arctic Ice Studio + * Copyright (C) 2018-present Sven Greb + * + * Project: Nord Docs + * Repository: https://github.com/arcticicestudio/nord-docs + * License: MIT + */ + +import styled from "styled-components"; + +import { colors, motion, themedMode, MODE_BRIGHT_SNOW_FLURRY, MODE_DARK_NIGHT_FROST } from "styles/theme"; + +const backgroundColor = themedMode({ + [MODE_BRIGHT_SNOW_FLURRY]: colors.background.base[MODE_BRIGHT_SNOW_FLURRY], + [MODE_DARK_NIGHT_FROST]: colors.background.base[MODE_DARK_NIGHT_FROST] +}); + +/** + * A basic wrapper component for page content. + * + * @since 0.3.0 + */ +const Page = styled.main` + background-color: ${backgroundColor}; + transition: background-color ${motion.speed.duration.transition.base.themeModeSwitch}s ease-in-out; +`; + +export default Page; diff --git a/src/components/containers/core/Page/index.js b/src/components/containers/core/Page/index.js new file mode 100644 index 00000000..ded34452 --- /dev/null +++ b/src/components/containers/core/Page/index.js @@ -0,0 +1,10 @@ +/* + * Copyright (C) 2018-present Arctic Ice Studio + * Copyright (C) 2018-present Sven Greb + * + * Project: Nord Docs + * Repository: https://github.com/arcticicestudio/nord-docs + * License: MIT + */ + +export { default } from "./Page"; diff --git a/test/components/containers/core/Page/Page.test.jsx b/test/components/containers/core/Page/Page.test.jsx new file mode 100644 index 00000000..2a07189a --- /dev/null +++ b/test/components/containers/core/Page/Page.test.jsx @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2018-present Arctic Ice Studio + * Copyright (C) 2018-present Sven Greb + * + * Project: Nord Docs + * Repository: https://github.com/arcticicestudio/nord-docs + * License: MIT + */ + +import React from "react"; +import { render } from "react-testing-library"; + +import Page from "containers/core/Page"; + +test("snapshot", () => { + const { container } = render(); + expect(container).toMatchSnapshot(); +}); diff --git a/test/components/containers/core/Page/__snapshots__/Page.test.jsx.snap b/test/components/containers/core/Page/__snapshots__/Page.test.jsx.snap new file mode 100644 index 00000000..f52828ae --- /dev/null +++ b/test/components/containers/core/Page/__snapshots__/Page.test.jsx.snap @@ -0,0 +1,9 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`snapshot 1`] = ` +
+
+
+`;