Skip to content

Commit

Permalink
Merge pull request #1126 from AletheiaFact/supportive-material-page
Browse files Browse the repository at this point in the history
Supportive material page
  • Loading branch information
thesocialdev authored Feb 7, 2024
2 parents 2c98861 + b8e0214 commit 63955b0
Show file tree
Hide file tree
Showing 23 changed files with 229 additions and 10 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .yarn/install-state.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion public/locales/en/CTARegistration.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"Wanna be a reviewer? Aletheia is currently on Beta Test and we are accepting all journalists and fact-checking professionals to test the platform!",
"footer":
"Our goal is to be open for all users to add and review claims once tests are done. Keep it up with us on social media!",
"button": "Apply to be a reviewer"
"button": "Sign-up to be part of the movement"
}
2 changes: 1 addition & 1 deletion public/locales/en/home.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"statsClaims": "claims",
"statsClaimReviews": "reviews",
"statsFooter": "Contribute to an internet free of disinformation",
"createAccountButton": "Be a reviewer",
"createAccountButton": "Sign-up and be part of the Movement",
"donateButton": "Donate to Aletheia",
"seeMorePersonalitiesButton": "See more Personalities",
"sectionTitle1": "Personalities",
Expand Down
6 changes: 6 additions & 0 deletions public/locales/en/materials.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"title": "Supportive Materials",
"loggedOutMessage": "You need to login to access the supportive materials.",
"disclaimerFirstParagraph": "When you complete your registration, you will have access to all areas of the AletheiaFact.org platform, including complementary materials, up-to-date fact-checking reports and, of course, our complete Fact-Checking Manual. We offer totally free information and guidance so that you can fight disinformation independently and credibly.",
"disclaimerSecondParagraph": "To find out more about how you can become a fact-checker and publish your reports on the platform, contributing to the Movement on a voluntary basis, please contact us at"
}
4 changes: 3 additions & 1 deletion public/locales/en/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
"personalityItem": "Personalities",
"claimItem": "Claims",
"kanbanItem": "Kanban",
"nameSpaceItem": "Namespace"
"nameSpaceItem": "Namespace",
"supportiveMaterials": "Supportive Materials"

}
2 changes: 1 addition & 1 deletion public/locales/pt/CTARegistration.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"Aletheia está atualmente em teste beta e estamos aceitando todos os jornalistas e profissionais de checagem de fatos para testar a plataforma!",
"footer":
"Nosso objetivo é estar aberto para que todos os usuários adicionem e revisem alegações assim que os testes forem concluídos. Acompanhe-nos nas redes sociais!",
"button": "Inscreva-se para ser um revisor"
"button": "Inscreva-se para ser parte do movimento"
}
2 changes: 1 addition & 1 deletion public/locales/pt/home.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"statsClaims": "discursos",
"statsClaimReviews": "checagens",
"statsFooter": "Contribua para uma internet livre de desinformação",
"createAccountButton": "Seja um revisor",
"createAccountButton": "Cadastre-se e faça parte do Movimento",
"donateButton": "Doe para Aletheia",
"seeMorePersonalitiesButton": "Veja mais personalidades",
"sectionTitle1": "Personalidades",
Expand Down
7 changes: 7 additions & 0 deletions public/locales/pt/materials.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"title": "Materiais de Apoio",
"loggedOutMessage": "Para acessar os materias de apoio é preciso ter uma conta na plataforma.",
"disclaimerFirstParagraph": "Ao finalizar o seu cadastro, você terá acesso a todas as áreas da plataforma AletheiaFact.org, incluindo materiais complementares, relatórios de checagem atualizados e, é claro, ao nosso Manual de Checagem completo. Oferecemos informações e orientações totalmente gratuitas para que você combata a desinformação de forma autônoma e com credibilidade.",
"disclaimerSecondParagraph": "Para saber mais sobre como você pode se tornar um checador de fatos e publicar seus relatórios na plataforma, contribuindo para o Movimento de forma voluntária, entre em contato conosco pelo e-mail:"

}
3 changes: 2 additions & 1 deletion public/locales/pt/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"personalityItem": "Personalidades",
"claimItem": "Afirmações",
"kanbanItem": "Kanban",
"nameSpaceItem": "Namespace"
"nameSpaceItem": "Namespace",
"supportiveMaterials": "Materiais de Apoio"
}
Binary file added public/manual-thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/timeline-thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions server/view/view.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,26 @@ export class ViewController {
);
}

@IsPublic()
@ApiTags("pages")
@Get("supportive-materials")
@Header("Cache-Control", "max-age=86400")
public async supportiveMaterialsPage(
@Req() req: Request,
@Res() res: Response
) {
const parsedUrl = parse(req.url, true);

await this.viewService
.getNextServer()
.render(
req,
res,
"/supportive-materials",
Object.assign(parsedUrl.query, {})
);
}

@IsPublic()
@ApiTags("pages")
@Get("privacy-policy")
Expand Down
7 changes: 7 additions & 0 deletions src/components/AletheiaMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ const AletheiaMenu = () => {
>
{t("menu:codeOfConductItem")}
</Menu.Item>
<Menu.Item
key="/supportive-materials"
data-cy={"testSupportiveMaterialsItem"}
onClick={handleClick}
>
{t("menu:supportiveMaterials")}
</Menu.Item>

<Menu.Item key="/donate" onClick={handleClick}>
{t("header:donateButton")}
Expand Down
1 change: 1 addition & 0 deletions src/components/ContentWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const ContentWrapper = ({ children }) => {
"admin-badges",
"admin-namespaces",
"profile",
"supportive-materials",
"search-page",
];

Expand Down
5 changes: 4 additions & 1 deletion src/components/Home/CTASection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ const CTASection = () => {
href={"/sign-up"}
type={ButtonType.white}
style={{
height: "40px",
height: "auto",
minHeight: "40px",
lineHeight: "inherit",
textWrap: "wrap",
display: "flex",
justifyContent: "center",
alignItems: "center",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Home/HomeHeader.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const HomeHeaderStyle = styled.div`
}
.video-container {
height: clamp(149px, 28vw, 317px);
height: auto;
aspect-ratio: 16 / 9;
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Home/HomeHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const HomeHeader = () => {
>
<Col
sm={18}
md={8}
md={10}
style={{
display: "flex",
flexDirection: "column",
Expand Down Expand Up @@ -62,7 +62,7 @@ const HomeHeader = () => {
<CTASection />
</Col>

<Col sm={18} md={10}>
<Col sm={18} md={8}>
<div className="video-container">
<AletheiaVideo />
</div>
Expand Down
15 changes: 15 additions & 0 deletions src/components/Login/SignUpForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Form } from "antd";
import { useTranslation } from "next-i18next";
import React from "react";

import AletheiaAlert from "../AletheiaAlert";
import Input from "../AletheiaInput";
import Button, { ButtonType } from "../Button";
import InputPassword from "../InputPassword";
Expand All @@ -11,6 +12,20 @@ const SignUpForm = ({ onFinish, onFinishFailed, isLoading }) => {

return (
<div>
<AletheiaAlert
type="info"
message={
<>
{t("materials:disclaimerFirstParagraph")} <br />
<br />
{t("materials:disclaimerSecondParagraph")}{" "}
<a href="email:[email protected]">
[email protected]
</a>
.
</>
}
/>
<h2>{t("login:signupFormHeader")}</h2>
<Form
name="signUp"
Expand Down
157 changes: 157 additions & 0 deletions src/pages/supportive-materials.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
import { NextPage } from "next";
import { useTranslation } from "next-i18next";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import React from "react";
import {
Card,
CardContent,
CardActions,
Typography,
Button,
} from "@mui/material";
import { useAtom } from "jotai";
import { Row, Typography as AntdTypography } from "antd";
import { isUserLoggedIn } from "../atoms/currentUser";
import Seo from "../components/Seo";
import { GetLocale } from "../utils/GetLocale";
import Image from "next/image";

const staticLinks = [
{
title: "Manual de Checagem",
description:
"Detalhes sobre como realizar checagens dentro das diretrizes do Movimento Aletheia Fact.",
link: "https://aletheiafact-supportive-materials.s3.amazonaws.com/Manual+de+Checagem.pdf",
image: "/manual-thumb.png",
},
{
title: "Linha do tempo da checagem de fatos",
description:
"Infográfico com detalhes da historia da checagem de fatos.",
link: "https://aletheiafact-supportive-materials.s3.amazonaws.com/Poster+Timeline.pdf",
image: "/timeline-thumb.png",
},
// Add more links as needed
];

const SupportiveMaterialsPage: NextPage<{ data: string }> = () => {
const { t } = useTranslation();
const [isLoggedIn] = useAtom(isUserLoggedIn);

return (
<>
<Seo title={t("materials:title")} />
<Row style={{ width: "100%", textAlign: "center" }}>
<AntdTypography.Title style={{ width: "100%" }}>
{t("materials:title")}
</AntdTypography.Title>
</Row>
<div
style={{
display: "flex",
flexDirection: "row",
flexWrap: "wrap",
gap: "20px",
justifyContent: "center",
margin: "auto",
maxWidth: "1024px",
padding: "20px",
}}
>
{!isLoggedIn ? (
<div style={{ marginBottom: "20px" }}>
<Typography variant="h6" gutterBottom>
{t("materials:loggedOutMessage")}
</Typography>
<Button
variant="contained"
color="primary"
href="/login"
style={{ marginRight: "10px" }}
>
{t("menu:loginItem")}
</Button>
<Button
variant="outlined"
color="primary"
href="/sign-up"
>
{t("login:signup")}
</Button>
</div>
) : (
staticLinks.map(
({ title, description, link, image }, index) => (
<Card
key={title}
sx={{
width: {
xs: "100%",
sm: "calc(50% - 20px)",
md: "calc(33.333% - 20px)",
lg: "calc(25% - 20px)",
},
mb: 5,
}}
>
<div
style={{
position: "relative",
width: "100%",
height: "140px",
backgroundColor: "#11273a",
}}
>
<Image
src={image}
alt={title}
width={345} // Adjust based on your design needs
height={140} // Adjust based on your design needs
layout="fill"
objectFit="contain"
/>
</div>
<CardContent>
<Typography
gutterBottom
variant="h5"
component="div"
>
{title}
</Typography>
<Typography
variant="body2"
color="text.secondary"
>
{description}
</Typography>
</CardContent>
<CardActions>
<Button
size="small"
href={link}
target="_blank"
>
Download
</Button>
</CardActions>
</Card>
)
)
)}
</div>
</>
);
};

export async function getServerSideProps({ query, locale, locales, req }) {
locale = GetLocale(req, locale, locales);
return {
props: {
...(await serverSideTranslations(locale)),
href: req.protocol + "://" + req.get("host") + req.originalUrl,
},
};
}

export default SupportiveMaterialsPage;

0 comments on commit 63955b0

Please sign in to comment.