-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa1461e
commit d698ad5
Showing
5 changed files
with
97 additions
and
20 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
38 changes: 38 additions & 0 deletions
38
src/ui/layouts/common/layouts/AuthenticatedLayout/DashboardBanner/index.tsx
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,38 @@ | ||
import React, { useState } from 'react'; | ||
import styles from './styles.module.scss'; | ||
import { dashboardKey } from './service'; | ||
import { icons } from '../../../../../components'; | ||
|
||
function DashboardBanner() { | ||
const [isDashboardBannerDismissed, setDashboardDismissed] = useState( | ||
!!sessionStorage.getItem(dashboardKey), | ||
); | ||
|
||
if (isDashboardBannerDismissed) return null; | ||
return ( | ||
<aside className={styles.deploymentBanner}> | ||
<p className={styles.deploymentBanner__paragraph}> | ||
This dashboard interface will soon be updated. Click{' '} | ||
<a | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
href="https://www.zenml.io/cloud" | ||
> | ||
here | ||
</a>{' '} | ||
for a preview! | ||
</p> | ||
<button | ||
className={styles.deploymentBanner__close} | ||
onClick={() => { | ||
sessionStorage.setItem(dashboardKey, 'true'); | ||
setDashboardDismissed(true); | ||
}} | ||
> | ||
<icons.close /> | ||
</button> | ||
</aside> | ||
); | ||
} | ||
|
||
export default DashboardBanner; |
1 change: 1 addition & 0 deletions
1
src/ui/layouts/common/layouts/AuthenticatedLayout/DashboardBanner/service.ts
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 const dashboardKey = 'dashboard-banner-dismissed'; |
36 changes: 36 additions & 0 deletions
36
src/ui/layouts/common/layouts/AuthenticatedLayout/DashboardBanner/styles.module.scss
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,36 @@ | ||
@import '../../../../../globalStyles'; | ||
|
||
.deploymentBanner { | ||
width: 100%; | ||
background-color: #f1ebfe; | ||
font-size: 16px; | ||
display: flex; | ||
color: #0d061d; | ||
font-family: Rubik; | ||
padding: 0.5rem 16px; | ||
justify-content: space-between; | ||
align-items: center; | ||
|
||
&__paragraph { | ||
text-align: center; | ||
margin: 0; | ||
flex: 1; | ||
} | ||
&__close { | ||
padding: 0; | ||
margin: 0; | ||
border: none; | ||
background: none; | ||
font: inherit; | ||
color: inherit; | ||
cursor: pointer; | ||
outline: none; | ||
} | ||
} | ||
|
||
@media (max-width: $md-breakpoint) { | ||
.deploymentBanner { | ||
padding: 0.5rem 1rem; | ||
font-size: 14px; | ||
} | ||
} |
36 changes: 17 additions & 19 deletions
36
src/ui/layouts/common/layouts/AuthenticatedLayout/DeploymentBanner/styles.module.scss
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,27 +1,25 @@ | ||
@import '../../../../../globalStyles'; | ||
|
||
.deploymentBanner { | ||
width: 100%; | ||
box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2); | ||
background-color: #FEFACB; | ||
font-size: 16px; | ||
display: flex; | ||
font-family: Rubik; | ||
padding: .5rem 0; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
|
||
&__paragraph { | ||
text-align: center; | ||
margin: 0 | ||
} | ||
width: 100%; | ||
background-color: #fefacb; | ||
font-size: 16px; | ||
display: flex; | ||
font-family: Rubik; | ||
padding: 0.5rem 0; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
|
||
&__paragraph { | ||
text-align: center; | ||
margin: 0; | ||
} | ||
} | ||
|
||
@media (max-width: $md-breakpoint) { | ||
.deploymentBanner { | ||
padding: .5rem 1rem; | ||
font-size: 14px; | ||
} | ||
.deploymentBanner { | ||
padding: 0.5rem 1rem; | ||
font-size: 14px; | ||
} | ||
} |