-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Showing
11 changed files
with
159 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"title": "AletheiaFact {{date}} Donation Campaign", | ||
"paragraph": "AletheiaFact.org works to combat misinformation and strengthen fact-checking. With your donation, you support the movement against FAKE NEWS, ensuring reliable information reaches you.", | ||
"donateButton": "Donate to aletheia", | ||
"showButton": "Show", | ||
"hideButton": "Hide" | ||
|
||
} |
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,8 @@ | ||
{ | ||
"title": "Campanha doação AletheiaFact {{date}}", | ||
"paragraph": "A AletheiaFact.org trabalha para combater a desinformação e fortalecer a checagem de fatos. Com sua doação, você apoia o movimento contra FAKE NEWS e informações confiáveis cheguem a você.", | ||
"donateButton": "Doe para aletheia", | ||
"showButton": "Mostrar", | ||
"hideButton": "Ocultar" | ||
|
||
} |
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,52 @@ | ||
import styled from "styled-components"; | ||
import colors from "../../styles/colors"; | ||
import { Col } from "antd"; | ||
|
||
const DonationBannerStyle = styled(Col)` | ||
background-color: ${colors.blueQuartiary}; | ||
.show-banner { | ||
color: ${colors.white}; | ||
font-size: 13px; | ||
border: none; | ||
background-color: ${colors.blackTertiary}; | ||
font-weight: 600; | ||
cursor: pointer; | ||
align-self: flex-end; | ||
position: absolute; | ||
right: 10px; | ||
bottom: -25px; | ||
z-index: 1; | ||
} | ||
.banner-content { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
padding: 20px 0px; | ||
} | ||
.banner-content > h1 { | ||
width: 100%; | ||
color: ${colors.blackPrimary}; | ||
font-size: 26px; | ||
line-height: 34px; | ||
font-weight: 800; | ||
text-align: center; | ||
} | ||
.banner-content > p { | ||
color: ${colors.blackTertiary}; | ||
font-size: 16px; | ||
font-weight: 600; | ||
line-height: 24px; | ||
text-align: center; | ||
} | ||
.banner-button { | ||
font-weight: 600; | ||
} | ||
`; | ||
|
||
export default DonationBannerStyle; |
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,28 @@ | ||
import React, { useState } from "react"; | ||
import DonationBannerContent from "./DonationBanner/DonationBannerContent"; | ||
import DonationBannerStyle from "./DonationBanner.style"; | ||
import { Col } from "antd"; | ||
import { useTranslation } from "next-i18next"; | ||
|
||
const DonationBanner = () => { | ||
const { t } = useTranslation(); | ||
const [isBannerVisible, setIsBannerVisible] = useState(true); | ||
const handleToggleBanner = () => { | ||
setIsBannerVisible((prev) => !prev); | ||
} | ||
|
||
return ( | ||
<DonationBannerStyle> | ||
<Col className="banner-container"> | ||
{isBannerVisible && <DonationBannerContent />} | ||
<button | ||
className="show-banner" | ||
onClick={handleToggleBanner}> | ||
{isBannerVisible ? t("donationBanner:hideButton") : t("donationBanner:showButton")} | ||
</button> | ||
</Col> | ||
</DonationBannerStyle > | ||
); | ||
}; | ||
|
||
export default DonationBanner; |
17 changes: 17 additions & 0 deletions
17
src/components/Home/DonationBanner/DonationBannerButton.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,17 @@ | ||
import { useTranslation } from "next-i18next"; | ||
import Button from "../../Button"; | ||
|
||
const DonationBannerButton = ({ type }) => { | ||
const { t } = useTranslation(); | ||
return ( | ||
<Button | ||
type={type} | ||
href={t("home:donateUrlButton")} | ||
className="banner-button" | ||
> | ||
{t("donationBanner:donateButton")} | ||
</Button> | ||
); | ||
}; | ||
|
||
export default DonationBannerButton; |
30 changes: 30 additions & 0 deletions
30
src/components/Home/DonationBanner/DonationBannerContent.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,30 @@ | ||
import React from "react"; | ||
import BannerButton from "./DonationBannerButton"; | ||
import { ButtonType } from "../../Button"; | ||
import { Col } from "antd"; | ||
import { useTranslation } from "next-i18next"; | ||
import DonationBannerStyle from "../DonationBanner.style"; | ||
|
||
function DonationBannerContent() { | ||
const { t } = useTranslation(); | ||
return ( | ||
<DonationBannerStyle > | ||
<Col | ||
className="banner-content" | ||
> | ||
<h1> | ||
{t("donationBanner:title", { | ||
date: new Date().getFullYear(), | ||
})} | ||
</h1> | ||
<p> | ||
{t("donationBanner:paragraph")} | ||
</p> | ||
<BannerButton type={ButtonType.blue} /> | ||
</Col> | ||
</DonationBannerStyle > | ||
|
||
); | ||
} | ||
|
||
export default DonationBannerContent; |
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