Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method banner #157

Merged
merged 6 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/images/icons/exit-cross.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions src/components/Banner/banner.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { useEffect, useState } from 'react';
import styles from './banner.module.scss';

export function Banner() {
const [displayBanner, setDisplayBanner] = useState(null);

useEffect(() => {
const stateCondition = localStorage.getItem('displayBanner');
console.log('localStorage = ' + localStorage.getItem('displayBanner'));
if (stateCondition === 'false') {
setDisplayBanner(false);
} else {
setDisplayBanner(true);
}
console.log('stateCondition =' + stateCondition);
}, []);

const hideBanner = () => {
localStorage.setItem('displayBanner', 'false');
setDisplayBanner(false);
};

const display = displayBanner ? styles.banner : styles.hidden;

return (
<div className={display}>
<div>
<h3 className={styles.textBold}>Method Conference</h3>
</div>
<div className={styles.textArea}>
<p className={styles.textBold}>Join us for a full day of code & learning.</p>
<p className={styles.text}>Saturday, October 12, 2024, @ eFactory</p>
</div>
<div className={styles.container}>
<a href="https://www.methodconf.com/2024/" target="_blank" className={styles.anchor}>
<button className={styles.button}>BUY TICKETS</button>
</a>
<button className={styles.exitButton} onClick={hideBanner}>
{/* eslint-disable */}
<img src="/images/icons/exit-cross.png" className={styles.exit} alt="close banner" />
{/* eslint-enable */}
{/* We disabled this for linting because we don't have an icon
system for this site yet, and this component is temporary. They can
be removed when the icon systems are integrated.*/}
</button>
</div>
</div>
);
}
84 changes: 84 additions & 0 deletions src/components/Banner/banner.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
@import '@/styles/utils/all';

.container{
display: flex;
justify-content: space-between;

width: 12em;
}

.hidden {
display: none;
}

.banner {
display: flex;

height: 120px;
width: 98%;

margin: .5em;
padding: 0em 2em;

border-radius: 1em;
background-color: #E9F5FF;


justify-content: space-between;
align-items: center;

text-align: center;
}

.textArea{
margin: 0em 1em;
}

.textBold{
font-family: sans-serif;
font-size: 1.5em;
font-weight: bold;
color: #0094FF;
}

.text{
font-family: sans-serif;
font-size: 1.5em;
color: #0094FF;
}

.button{
border: none;

padding: 1rem 2rem;

background-color: #0094FF;
color: #FFFFFF;

min-width: 150px;
}

.anchor :hover{
cursor: pointer;
}

.exit{
height: 1em;
}

.exitButton{
border: none;
background-color: #E9F5FF;
}

.exitButton :hover{
cursor: pointer;
}
@media (max-width:600px) {
.banner{
flex-direction: column;
justify-content: space-around;

height: 20vh;
}
}
2 changes: 2 additions & 0 deletions src/components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Banner } from '@/components/Banner/banner.jsx';
import { Footer } from '@/components/Footer/Footer';
import { Navbar } from '@/components/Navbar/Navbar';
import styles from './layout.module.scss';
Expand All @@ -11,6 +12,7 @@ export function Layout({ children }: ILayout): JSX.Element {
<div className={styles.pageContainer}>
<div className={styles.contentWrapper}>
<Navbar />
<Banner />
{children}
</div>
<Footer />
Expand Down
Loading