Skip to content

Commit

Permalink
Update banner to summer school info (#277)
Browse files Browse the repository at this point in the history
* Update banner to summer school content

* Generalize banner
  • Loading branch information
slesaad authored Jan 29, 2024
1 parent 33452e4 commit 2c68061
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions overrides/home/ams-banner.tsx → overrides/home/banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import Hug from "$veda-ui-scripts/styles/hug";
import { getString } from 'veda';

const AMS_BANNER_KEY = 'show-ams-banner'
const BANNER_KEY = 'dismissedBannerUrl'

const BannerBox = styled.div`
position: absolute;
Expand Down Expand Up @@ -53,13 +53,14 @@ const BannerContent = styled.div`
`

export default function Banner() {
const showBanner = (localStorage.getItem(AMS_BANNER_KEY) !== 'false') && !!getString('tempBanner')?.other
const bannerUrl = getString('tempBannerUrl')?.other || "";
const showBanner = (localStorage.getItem(BANNER_KEY) !== bannerUrl) && !!getString('tempBanner')?.other
const [ showTempBanner, setShowTempBanner ] = useState(showBanner);

function onClick () {
localStorage.setItem(
AMS_BANNER_KEY,
'false'
BANNER_KEY,
bannerUrl
);
setShowTempBanner(false);
}
Expand All @@ -78,4 +79,4 @@ export default function Banner() {
</BannerContainer>
</BannerBox>
)
}
}
4 changes: 2 additions & 2 deletions overrides/home/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { variableGlsp } from "$veda-ui-scripts/styles/variable-utils";
import Partners from "./partners";
import Keypoints from "./keypoints";
import { ArrowLink } from "./arrow-link";
import AMSBanner from './ams-banner';
import Banner from './banner';

const HomeContent = styled(Hug)`
padding: ${variableGlsp(2.5, 0)};
Expand Down Expand Up @@ -89,7 +89,7 @@ const InfoCalloutHeadline = styled.div`
export default function HomeComponent() {
return (
<>
<AMSBanner />
<Banner />
<HomeContent>
<IntroHeadline>
<VarHeading size="xxlarge">Welcome</VarHeading>
Expand Down
4 changes: 2 additions & 2 deletions veda.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ module.exports = {
"This dashboard is for exploring key datasets that provide insight into greenhouse gas sources, sinks, emissions, fluxes, and events.",
// Temporary Banner Text/URL
tempBanner:
"Attending AMS Annual Meeting in Baltimore? Join the GHG Center / VEDA workshop and learn about Greenhouse Gases using Open Source data and tools. Register Here!",
"Graduate students and early career post-docs are invited to apply for the Summer School for Inverse Modeling of Greenhouse Gases to be held June 11-21, 2024 in Fort Collins, CO. Applications due 1/31/2024.",
tempBannerUrl:
"https://www.ametsoc.org/index.cfm/ams/education-careers/careers/professional-development/short-courses/advancing-open-science-an-interactive-workshop-on-harnessing-veda-for-earth-science-research-at-the-u-s-greenhouse-gas-center/"
"https://www.cira.colostate.edu/conferences/rmtgw/"
},

theme: {
Expand Down

0 comments on commit 2c68061

Please sign in to comment.