From 8c69229ab194b910cc8d2b9bab766444daa168a4 Mon Sep 17 00:00:00 2001 From: Rob Levin Date: Thu, 17 Sep 2020 17:31:59 -0700 Subject: [PATCH] React Header --- .../src/__snapshots__/storybook.test.js.snap | 183 ++++++++++++++++++ agnosticui-react/src/stories/Header.js | 15 +- .../src/stories/Header.stories.js | 41 +++- .../src/stories/header.module.css | 12 +- 4 files changed, 241 insertions(+), 10 deletions(-) diff --git a/agnosticui-react/src/__snapshots__/storybook.test.js.snap b/agnosticui-react/src/__snapshots__/storybook.test.js.snap index e2fae8ebd..3a89be306 100644 --- a/agnosticui-react/src/__snapshots__/storybook.test.js.snap +++ b/agnosticui-react/src/__snapshots__/storybook.test.js.snap @@ -668,6 +668,189 @@ Array [ ] `; +exports[`Storyshots Header Header And Nav 1`] = ` +Array [ +
+
+
+ LOGO +
+ +
+
, +
+
+
+ NO-Skinz +
+ +
+
, +
+
+
+ Logo +
+ +
+
, +] +`; + exports[`Storyshots Progress All 1`] = ` Array [ { + let klasses = [ + styles.headerNav, + css ? `${css}` : "", + ]; + klasses = klasses.filter((klass) => klass.length); + klasses = klasses.join(" "); + return ( + + ) +} + const Header = ({ children, css, isSticky, isSkinned }) => { let klasses = [ isSkinned ? styles.header : styles.headerBase, @@ -14,7 +28,6 @@ const Header = ({ children, css, isSticky, isSkinned }) => { return (
- foo bar {children}
diff --git a/agnosticui-react/src/stories/Header.stories.js b/agnosticui-react/src/stories/Header.stories.js index abd6518b9..f34d6925d 100644 --- a/agnosticui-react/src/stories/Header.stories.js +++ b/agnosticui-react/src/stories/Header.stories.js @@ -1,17 +1,48 @@ import React from 'react'; -import Header from './Header.js'; +import Header, { HeaderNav } from './Header.js'; export default { title: 'Header', component: Header, } -export const All = () => ( + +export const HeaderAndNav = () => ( <> -
+
+ <> +
LOGO
+ + {/* Ignore these inline styles -- you can use css-in-js, css modules, or whatever you'd like here :) */} + + + +
+
+ <> +
NO-Skinz
+ + {/* Ignore these inline styles -- you can use css-in-js, css modules, or whatever you'd like here :) */} + + + +
+
<> -
Default
-
Card
+
Logo
+ + {/* Ignore these inline styles -- you can use css-in-js, css modules, or whatever you'd like here :) */} + +
diff --git a/agnosticui-react/src/stories/header.module.css b/agnosticui-react/src/stories/header.module.css index 4a187a4a7..9177a5b99 100644 --- a/agnosticui-react/src/stories/header.module.css +++ b/agnosticui-react/src/stories/header.module.css @@ -1,15 +1,19 @@ .headerBase { - background: blue; + composes: header-base from './header.css'; } .header { - outline: 10px solid hotpink; + composes: header from './header.css'; } .headerContent { - background: red; + composes: header-content from './header.css'; } .sticky { - background: green; + composes: header-sticky from './header.css'; +} + +.headerNav { + composes: header-nav from './header.css'; } \ No newline at end of file