-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added method conferance banner * method conference banner, now linted * Banner for the method conf. Ran lint, used --fix, and then solved remaining erros * fixed various small bugs * ran linting * added variable to local storage to prevent rerenders upon browser refresh
- Loading branch information
Showing
4 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,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> | ||
); | ||
} |
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,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; | ||
} | ||
} |
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