Skip to content

Commit

Permalink
Add an alert box above the header to advertise CML (#1543)
Browse files Browse the repository at this point in the history
* Add an alert box above the header to advertise CML

Not the most reusable implementation, but it does the job.

* Update index.tsx

* Update styles.module.css

* Update index.tsx

* Update index.tsx

* Update index.tsx

Co-authored-by: Ivan Shcheklein <[email protected]>
  • Loading branch information
rogermparent and shcheklein authored Jul 7, 2020
1 parent f4b4a86 commit 0c8484d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/LayoutHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ const LayoutHeader: React.FC<Required<ILayoutModifiable>> = ({ modifiers }) => {
)}
/>
<div className={styles.header}>
<div className={cn(styles.alert, collapsed && styles.collapsed)}>
<span role="img" aria-label="rocket">
🚀
</span>
Check out the newest tool,
<Link href="https://cml.dev">CML</Link>!
</div>
<LayoutWidthContainer
className={cn(styles.container, collapsed && styles.collapsed)}
wide={includes(modifiers, LayoutModifiers.Wide)}
Expand Down
16 changes: 16 additions & 0 deletions src/components/LayoutHeader/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,19 @@
display: block;
padding-top: 2px;
}

.alert {
height: 35px;
line-height: 35px;
font-size: 18px;
text-align: center;
width: 100%;
background-color: #dee;
transition: 0.5s all;
overflow: hidden;

&.collapsed {
height: 0;
transform: translateY(-100%);
}
}

0 comments on commit 0c8484d

Please sign in to comment.