diff --git a/src/components/About/About.tsx b/src/components/About/About.tsx index e7bcf160d..42fe4485e 100644 --- a/src/components/About/About.tsx +++ b/src/components/About/About.tsx @@ -1,22 +1,26 @@ /* eslint-disable jsx-a11y/anchor-has-content */ -import { Row, Typography, Button } from "antd"; -import colors from "../../styles/colors"; -import { Trans, useTranslation } from "next-i18next"; +import React from "react"; +import { Box, Typography, Button } from "@mui/material"; +import { useTranslation, Trans } from "next-i18next"; +import DescriptionIcon from "@mui/icons-material/Description"; import AletheiaAlert from "../AletheiaAlert"; -import { FilePdfOutlined } from "@ant-design/icons"; import AletheiaVideo from "../AletheiaVideo"; +import colors from "../../styles/colors"; const About = () => { const { t } = useTranslation(); const paragraphStyle = { - margin: "10px 0px", + margin: "10px 0", width: "100%", }; + return ( - { padding: "20px", }} > - + - - - {t("about:alertInfo")}{" "} - - https://github.com/AletheiaFact/aletheia - - > - } - action={ - } - href="https://docs.google.com/viewer?url=https://raw.githubusercontent.com/AletheiaFact/miscellaneous/290b19847f0da521963f74e7947d7863bf5d5624/documents/org_legal_register.pdf" + + + {t("about:alertInfo")}{" "} + - {t("about:labelButton")} - - } - /> - - - {t("about:title")} - - - {t("about:intro")} - - - {t("about:visionTitle")} - - - {t("about:visionContent")} - - - {t("about:missionTitle")} - - - {t("about:missionContent")} - - - {t("about:valuesTitle")} - - - + https://github.com/AletheiaFact/aletheia + + > + } + action={ + } + href="https://docs.google.com/viewer?url=https://raw.githubusercontent.com/AletheiaFact/miscellaneous/290b19847f0da521963f74e7947d7863bf5d5624/documents/org_legal_register.pdf" + target="_blank" + rel="noreferrer" + sx={{ + position: "absolute", + bottom: "15px", + right: "15px", + }} + > + {t("about:labelButton")} + + } + /> + + {t("about:title")} + + + {t("about:intro")} + + + {t("about:visionTitle")} + + + {t("about:visionContent")} + + + {t("about:missionTitle")} + + + {t("about:missionContent")} + + + {t("about:valuesTitle")} + + {t("about:valueAccessibility")} {t("about:valueCredibility")} {t("about:valueAutonomy")} - - - - {t("about:fullTextTitle")} - - - + + + {t("about:fullTextTitle")} + + , + />, , + />, ]} /> - - + + , + />, , + />, ]} /> - - + + - + - - + + - + - - + + ); }; diff --git a/src/components/Claim/ClaimView.tsx b/src/components/Claim/ClaimView.tsx index 6b757df6f..ac7f52be1 100644 --- a/src/components/Claim/ClaimView.tsx +++ b/src/components/Claim/ClaimView.tsx @@ -122,14 +122,10 @@ const ClaimView = ({ personality, claim, href, hideDescriptions }) => { { - setShowHighlights(e.target.value); + setShowHighlights(e.target.value); }} - labelTrue={t( - "claim:showHighlightsButton" - )} - labelFalse={t( - "claim:hideHighlightsButton" - )} + labelTrue={t("claim:showHighlightsButton")} + labelFalse={t("claim:hideHighlightsButton")} /> diff --git a/src/components/HideContentButton.tsx b/src/components/HideContentButton.tsx index 19ea7312d..73676ece2 100644 --- a/src/components/HideContentButton.tsx +++ b/src/components/HideContentButton.tsx @@ -1,6 +1,6 @@ import React from "react"; -import { Button } from "@mui/material"; -import { VisibilityOff, Visibility } from "@mui/icons-material"; +import { IconButton } from "@mui/material"; +import { Visibility, VisibilityOff } from "@mui/icons-material"; import colors from "../styles/colors"; import { NameSpaceEnum } from "../types/Namespace"; import { useAtom } from "jotai"; @@ -22,13 +22,13 @@ const HideContentButton = ({ hide, handleHide, handleUnhide, style = {} }) => { return ( {hide ? ( - + - + ) : ( - - - + + + )} ); diff --git a/src/components/ToggleSection.tsx b/src/components/ToggleSection.tsx index 2ef3597c0..5e71a5a9d 100644 --- a/src/components/ToggleSection.tsx +++ b/src/components/ToggleSection.tsx @@ -1,85 +1,84 @@ -import { Radio } from "antd"; +import { ButtonGroup, Button } from "@mui/material"; import styled from "styled-components"; import colors from "../styles/colors"; import { NameSpaceEnum } from "../types/Namespace"; import { useAtom } from "jotai"; import { currentNameSpace } from "../atoms/namespace"; +import { useState } from "react"; -const RadioGroup = styled(Radio.Group)` - .ant-radio-button-wrapper { - &.ant-radio-button-wrapper-checked { - background: ${({ namespace }) => - namespace === NameSpaceEnum.Main - ? colors.primary - : colors.secondary}; - border-color: ${({ namespace }) => - namespace === NameSpaceEnum.Main - ? colors.primary - : colors.secondary}; - color: ${colors.white}; +const StyledButton = styled(Button)<{ namespace: NameSpaceEnum; selected: boolean }>` + background: ${({ namespace, selected }) => + selected + ? namespace === NameSpaceEnum.Main + ? colors.primary + : colors.secondary + : colors.neutralTertiary}; + color: ${({ selected }) => ( selected )}; + border-radius: 30px; - &:not([class*=" ant-radio-button-wrapper-disabled"]) { - &.ant-radio-button-wrapper:first-child { - border-right-color: ${({ namespace }) => - namespace === NameSpaceEnum.Main - ? colors.primary - : colors.secondary}; - } - } + &:hover { + background: ${({ namespace }) => + namespace === NameSpaceEnum.Main ? colors.primary : colors.secondary}; + color: ${colors.white}; + } - &:not(.ant-radio-button-wrapper-disabled)::before { - background: ${({ namespace }) => - namespace === NameSpaceEnum.Main - ? colors.primary - : colors.secondary}; - } - } - } + &:not(:hover) { + background: ${({ namespace, selected }) => + selected + ? namespace === NameSpaceEnum.Main + ? colors.primary + : colors.secondary + : colors.neutralTertiary}; + } `; -const RadioButton = styled(Radio.Button)` - background: ${colors.neutralTertiary}; - color: ${({ nameSpace }) => - nameSpace === NameSpaceEnum.Main - ? colors.primary - : colors.secondary}; +const StyledButtonGroup = styled(ButtonGroup)` + visibility: hidden; + position: relative; + + > * { + visibility: visible; + position: relative; + } `; interface ToggleSectionProps { - defaultValue: boolean; - onChange: (event: any) => void; - labelTrue: string; - labelFalse: string; + defaultValue: boolean; + onChange: (event: any) => void; + labelTrue: string; + labelFalse: string; } const ToggleSection = (props: ToggleSectionProps) => { - const [nameSpace] = useAtom(currentNameSpace); - return ( - (props.defaultValue); + + const handleChange = (value: boolean) => { + setSelectedValue(value); + const event = { target: { value } }; + props.onChange(event as any); + }; + + return ( + + handleChange(true)} + namespace={nameSpace} + style={{ borderRadius: "30px 0px 0px 30px" }} + > + {props.labelTrue} + + handleChange(false)} + namespace={nameSpace} + style={{ borderRadius: "0px 30px 30px 0px" }} > - - {props.labelTrue} - - - {props.labelFalse} - - - ); + {props.labelFalse} + + + ); }; export default ToggleSection;
{t("about:intro")}
{t("about:visionContent")}
{t("about:missionContent")}
, + />, , + />, ]} />
- +