-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Summary Resolves #313 - Moved github button according to design on Figma - Added donation button - Added donation banner component which is shown only once ever - Replaced action button in information modal with donation button as per design ### How to Test Run website and observe the new donate now button in the information modal, and the donate banner across the top. The new banner closes when you press the 'X', the GitHub button is in the bottom now, and the donate button is in the top navbar. --------- Co-authored-by: Yatharth Bhargava <[email protected]>
- Loading branch information
1 parent
b00b78c
commit fc0af9f
Showing
9 changed files
with
149 additions
and
69 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
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
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
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,53 @@ | ||
import React from 'react'; | ||
import useLocalStorageState from 'use-local-storage-state'; | ||
import { faX } from '@fortawesome/free-solid-svg-icons'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
|
||
import Button from '../Button'; | ||
import { DESKTOP_BREAKPOINT } from '../../constants'; | ||
import useScreenWidth from '../../hooks/useScreenWidth'; | ||
|
||
import './stylesheet.scss'; | ||
|
||
const BANNER_LOCAL_STORAGE_KEY = '2024-04-01-spr2024-donate-banner'; | ||
|
||
export default function DonateBanner(): React.ReactElement { | ||
const [hasSeen, setHasSeen] = useLocalStorageState(BANNER_LOCAL_STORAGE_KEY, { | ||
defaultValue: false, | ||
storageSync: true, | ||
}); | ||
const mobile = !useScreenWidth(DESKTOP_BREAKPOINT); | ||
|
||
return ( | ||
<div> | ||
{!hasSeen ? ( | ||
<div className="banner"> | ||
<div className="spacer" /> | ||
<span> | ||
{!mobile | ||
? 'Help keep GT Scheduler and its amazing features running!' | ||
: 'Help us and'} | ||
<Button | ||
className="donateButton" | ||
href="https://donorbox.org/gt-scheduler" | ||
> | ||
<b className="buttonText"> | ||
{!mobile ? 'Donate today.' : 'donate today.'} | ||
</b> | ||
</Button> | ||
</span> | ||
<Button | ||
className="close-button" | ||
onClick={(): void => { | ||
setHasSeen(true); | ||
}} | ||
> | ||
<FontAwesomeIcon fixedWidth icon={faX} size="lg" /> | ||
</Button> | ||
</div> | ||
) : ( | ||
<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,23 @@ | ||
.banner { | ||
width: 100%; | ||
height: fit-content; | ||
color: white; | ||
background-color: #C56E5B; | ||
font-family: "Roboto", sans-serif; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
|
||
.donateButton { | ||
display: inline-block; | ||
padding: 10px 6px; | ||
} | ||
|
||
.donateButton:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
.spacer { | ||
width: 49px; | ||
} | ||
} |
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
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
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