diff --git a/src/components/AffixButton/AffixCTAButton.tsx b/src/components/AffixButton/AffixCTAButton.tsx index 99ef12f6e..c957bd67c 100644 --- a/src/components/AffixButton/AffixCTAButton.tsx +++ b/src/components/AffixButton/AffixCTAButton.tsx @@ -6,7 +6,7 @@ import Banner from "../SentenceReport/Banner"; import { useTranslation } from "next-i18next"; import Cookies from "js-cookie"; import CtaAnimation from "../CtaAnimation"; -import { Tooltip } from "antd"; +import InfoTooltip from "../Claim/InfoTooltip"; import colors from "../../styles/colors"; import { trackUmamiEvent } from "../../lib/umami"; import { useAppSelector } from "../../store/store"; @@ -14,15 +14,16 @@ import { useAppSelector } from "../../store/store"; const CloseIcon = () => { const { t } = useTranslation(); return ( - - - + + } + content={ + + {t("affix:AffixCloseTooltip")} + + } + /> ); }; diff --git a/src/components/AffixButton/Fab.tsx b/src/components/AffixButton/Fab.tsx index 5dea1fd30..b3ac1279c 100644 --- a/src/components/AffixButton/Fab.tsx +++ b/src/components/AffixButton/Fab.tsx @@ -1,4 +1,5 @@ -import { Button, ButtonProps, Tooltip } from "antd"; +import { ButtonProps, IconButton } from "@mui/material"; +import InfoTooltip from "../Claim/InfoTooltip"; import React, { useLayoutEffect, useState } from "react"; import colors from "../../styles/colors"; import { NameSpaceEnum } from "../../types/Namespace"; @@ -18,28 +19,35 @@ const Fab = ({ tooltipText, style, icon, size, ...rest }: FabProps) => { useLayoutEffect(() => { setNameSpaceProp(nameSpace); }, [nameSpace]); + + const TooltipBanner = ( + + {icon} + + ); + return ( - - + + ); + return ( - + {!isArchive && ( - - - + )} - + ); }; diff --git a/src/components/Copilot/CopilotConversationCard.tsx b/src/components/Copilot/CopilotConversationCard.tsx index f4a4157e0..36d5094d1 100644 --- a/src/components/Copilot/CopilotConversationCard.tsx +++ b/src/components/Copilot/CopilotConversationCard.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Avatar } from "antd"; +import { Avatar } from "@mui/material"; import colors from "../../styles/colors"; import CopilotConversationCardStyle from "./CopilotConversationCard.style"; import { SenderEnum } from "../../types/enums"; @@ -20,7 +20,7 @@ const CopilotConversationCard = ({ message }) => { style={{ borderRadius: 16 }} /> ) : ( - + {SenderEnum.User.slice(0, 1).toUpperCase()} )} diff --git a/src/components/Kanban/UserTag.tsx b/src/components/Kanban/UserTag.tsx index f86d3fd7e..fa0d86398 100644 --- a/src/components/Kanban/UserTag.tsx +++ b/src/components/Kanban/UserTag.tsx @@ -1,4 +1,5 @@ -import { Avatar, Tooltip } from "antd"; +import { Avatar } from "@mui/material"; +import InfoTooltip from "../Claim/InfoTooltip"; import { useTranslation } from "next-i18next"; import React from "react"; import { useAtom } from "jotai"; @@ -16,17 +17,23 @@ const UserTag = ({ user }) => { : t("userTag:anonymousFactChecker"); const firstLetter = userName[0]; return ( - - - {firstLetter} - - + + {firstLetter} + + } + /> ); }; diff --git a/src/components/Personality/PersonalityCard.tsx b/src/components/Personality/PersonalityCard.tsx index dcc0d25b8..1836c8615 100644 --- a/src/components/Personality/PersonalityCard.tsx +++ b/src/components/Personality/PersonalityCard.tsx @@ -1,4 +1,4 @@ -import { Col, Row } from "antd"; +import { Grid } from "@mui/material"; import { useTranslation } from "next-i18next"; import React, { CSSProperties } from "react"; @@ -29,7 +29,7 @@ interface PersonalityCardProps { selectPersonality?: any; isFormSubmitted?: boolean; onClick?: any; - titleLevel?: 1 | 2 | 3 | 4 | 5; + titleLevel?: "h1" | "h2" | "h3" | "h4" | "h5"; centralizedInfo?: boolean; } @@ -44,7 +44,7 @@ const PersonalityCard = ({ hoistAvatar = false, style, onClick, - titleLevel = 1, + titleLevel = "h1", selectPersonality = null, isFormSubmitted, centralizedInfo = false, @@ -82,21 +82,21 @@ const PersonalityCard = ({ const hasReview = personality?.stats?.reviews?.length > 0; const { t } = useTranslation(); const componentStyle = { - titleSpan: !fullWidth ? 14 : 24, - avatarSpan: !fullWidth ? 8 : 24, - buttonSpan: !fullWidth ? 5 : 24, + titleSpan: !fullWidth ? 7 : 12, + avatarSpan: !fullWidth ? 4 : 12, + buttonSpan: !fullWidth ? 2.5 : 12, avatarSize: 90, hiddenIconSize: 12, }; if (summarized) { - componentStyle.titleSpan = 10; - componentStyle.avatarSpan = 5; - componentStyle.buttonSpan = 9; + componentStyle.titleSpan = 5; + componentStyle.avatarSpan = 2.5; + componentStyle.buttonSpan = 4.5; componentStyle.avatarSize = 43; } if (header) { componentStyle.avatarSize = 144; - componentStyle.hiddenIconSize = 18; + componentStyle.hiddenIconSize = 22; } let cardStyle; @@ -113,7 +113,7 @@ const PersonalityCard = ({ if (personality) { return ( - )} - - {((hoistAvatar && (!vw?.sm || !vw?.xs)) || @@ -167,11 +165,12 @@ const PersonalityCard = ({ )} {summarized && ( - - + )} - - + + {!smallDevice && enableStats && hasReview && ( - - - - + + )} - + ); } else { return ; diff --git a/src/components/Personality/PersonalityCardAvatar.tsx b/src/components/Personality/PersonalityCardAvatar.tsx index 039134e85..db5df1c84 100644 --- a/src/components/Personality/PersonalityCardAvatar.tsx +++ b/src/components/Personality/PersonalityCardAvatar.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Col } from "antd"; +import { Grid } from "@mui/material"; import AletheiaAvatar from "../AletheiaAvatar"; import { useTranslation } from "next-i18next"; import PersonalityCardAvatarTooltip from "./PersonalityCardAvatarTooltip"; @@ -8,16 +8,14 @@ const PersonalityCardAvatar = ({ hoistAvatar, personality, componentStyle, - header, - offset = null, }) => { const { t } = useTranslation(); - const tooltipOffset = offset || (header ? [-24, 24] : [-4, 4]); return ( - @@ -43,7 +39,7 @@ const PersonalityCardAvatar = ({ /> )} - + ); }; export default PersonalityCardAvatar; diff --git a/src/components/Personality/PersonalityCardAvatarTooltip.tsx b/src/components/Personality/PersonalityCardAvatarTooltip.tsx index 9109fa7b1..ebc600d20 100644 --- a/src/components/Personality/PersonalityCardAvatarTooltip.tsx +++ b/src/components/Personality/PersonalityCardAvatarTooltip.tsx @@ -1,47 +1,65 @@ import React from "react"; -import { Badge, Popover } from "antd"; +import { VisibilityOff, InfoOutlined } from "@mui/icons-material"; +import { Badge, IconButton } from "@mui/material"; +import InfoTooltip from "../Claim/InfoTooltip"; import { useTranslation } from "next-i18next"; import colors from "../../styles/colors"; -import { EyeInvisibleFilled, InfoCircleOutlined } from "@ant-design/icons"; const PersonalityCardAvatarTooltip = ({ children, isHidden, style, - offset, }) => { const { t } = useTranslation(); + const InfoBadge = ( + + { + isHidden ? ( + + ) : ( + + ) + } + + } + > + {children} + + ); + return ( - + {isHidden + ? t("personality:hiddenPersonalityAvatarTooltip") + : t("personality:personalityCardWikidataTooltip") + } +

} - trigger="hover" - > - - ) : ( - - ) - } - style={{ - borderRadius: "100%", - color: colors.primary, - background: colors.white, - boxShadow: `1px 1px 2px ${colors.secondary}`, - ...style, - }} - offset={offset} - > - {children} - -
+ /> ); }; diff --git a/src/components/Personality/PersonalityInfo.tsx b/src/components/Personality/PersonalityInfo.tsx index 963266294..a3f36d8f0 100644 --- a/src/components/Personality/PersonalityInfo.tsx +++ b/src/components/Personality/PersonalityInfo.tsx @@ -1,17 +1,15 @@ import React from "react"; -import { Col, Divider, Row, Typography } from "antd"; +import { Grid, Typography, Divider } from "@mui/material"; import colors from "../../styles/colors"; import { useTranslation } from "next-i18next"; -const { Title, Paragraph } = Typography; - interface PersonalityInfo { summarized: boolean; enableStats: boolean; personality: any; componentStyle: any; //adicionar tipo do componente style centralized: boolean; - titleLevel: 1 | 2 | 3 | 4 | 5; + titleLevel: "h1" | "h2" | "h3" | "h4" | "h5"; } export const PersonalityInfo = (props: PersonalityInfo) => { @@ -19,8 +17,8 @@ export const PersonalityInfo = (props: PersonalityInfo) => { const { componentStyle, summarized, personality, titleLevel, enableStats, centralized } = props; return ( - { }} > {summarized && ( - { }} > {personality.name} - + )} {!summarized && ( - { }} > {personality.name} - + )} - { }} > {personality.description} - + {summarized && enableStats && personality.stats?.total !== undefined && ( - @@ -81,7 +80,7 @@ export const PersonalityInfo = (props: PersonalityInfo) => { totalReviews: personality.stats?.total, })} - + )} {!summarized && personality.wikipedia && ( { {t("personality:wikipediaPage")} )} - {!summarized && } + {!summarized && } {enableStats && ( - + {!summarized && ( - { })} )} - + )} - + )} - + ); }; diff --git a/src/components/Personality/PersonalityMinimalCard.style.tsx b/src/components/Personality/PersonalityMinimalCard.style.tsx index 8c61ae05a..174d8e38c 100644 --- a/src/components/Personality/PersonalityMinimalCard.style.tsx +++ b/src/components/Personality/PersonalityMinimalCard.style.tsx @@ -1,9 +1,9 @@ -import { Row } from "antd"; +import { Grid } from "@mui/material"; import styled from "styled-components"; import colors from "../../styles/colors"; import { queries } from "../../styles/mediaQueries"; -const PersonalityMinimalCardStyle = styled(Row)` +const PersonalityMinimalCardStyle = styled(Grid)` text-align: center; display: flex; justify-content: center; diff --git a/src/components/Personality/PersonalityMinimalCard.tsx b/src/components/Personality/PersonalityMinimalCard.tsx index f8c5b21aa..4a42cf4c9 100644 --- a/src/components/Personality/PersonalityMinimalCard.tsx +++ b/src/components/Personality/PersonalityMinimalCard.tsx @@ -1,5 +1,4 @@ -import { Col } from "antd"; -import Title from "antd/lib/typography/Title"; +import { Grid, Typography } from "@mui/material"; import { useTranslation } from "next-i18next"; import React from "react"; import PersonalityMinimalCardStyle from "./PersonalityMinimalCard.style"; @@ -12,24 +11,22 @@ const PersonalityMinimalCard = ({ personality, avatarSize = 117 }) => { const { t } = useTranslation(); const [nameSpace] = useAtom(currentNameSpace); return ( - - + + - - - + </Grid> + <Grid item className="personality"> + <Typography variant="h2" className="personality-name"> {personality.name} - +

{personality.description} @@ -45,7 +42,7 @@ const PersonalityMinimalCard = ({ personality, avatarSize = 117 }) => { {t("personality:profile_button")}

- +
); }; diff --git a/src/components/Search/SearchCard.tsx b/src/components/Search/SearchCard.tsx index fc189d823..f7df8b983 100644 --- a/src/components/Search/SearchCard.tsx +++ b/src/components/Search/SearchCard.tsx @@ -2,7 +2,7 @@ import React from "react"; import AletheiaAvatar from "../AletheiaAvatar"; import SearchResult from "./SearchResult"; import colors from "../../styles/colors"; -import { Col, Row } from "antd"; +import { Grid } from "@mui/material"; import { useTranslation } from "next-i18next"; import SearchDescription from "./SearchDescription"; @@ -35,17 +35,17 @@ const SearchCard = ({ }; return ( - {content && Array.isArray(content) && content.length > 0 && ( - ) )} - + )} - + ); }; diff --git a/src/components/Search/SearchDescription.tsx b/src/components/Search/SearchDescription.tsx index ffc9399e5..87932844e 100644 --- a/src/components/Search/SearchDescription.tsx +++ b/src/components/Search/SearchDescription.tsx @@ -1,16 +1,14 @@ import React from "react"; import { useTranslation } from "next-i18next"; -import { Typography } from "antd"; +import { Typography } from "@mui/material"; import LocalizedDate from "../LocalizedDate"; import ReviewClassification from "../ClaimReview/ReviewClassification"; -const { Paragraph } = Typography; - const SearchDescription = ({ personalityName, claimDate, sentence = null }) => { const { t } = useTranslation(); return ( - + {personalityName}   @@ -27,7 +25,7 @@ const SearchDescription = ({ personalityName, claimDate, sentence = null }) => { /> )} - + ); }; diff --git a/src/components/Search/SearchPageView.tsx b/src/components/Search/SearchPageView.tsx index 13288e58f..d5fee0ec3 100644 --- a/src/components/Search/SearchPageView.tsx +++ b/src/components/Search/SearchPageView.tsx @@ -1,9 +1,8 @@ import React from "react"; import SearchApi from "../../api/searchApi"; -import { Typography } from "antd"; import Button, { ButtonType } from "../Button"; import { useAppSelector } from "../../store/store"; -import { Divider, Grid } from "@mui/material"; +import { Divider, Grid, Typography } from "@mui/material"; import { useDispatch } from "react-redux"; import { ActionTypes, SearchTypes } from "../../store/types"; import { useRouter } from "next/router"; @@ -176,9 +175,9 @@ function SearchPageView({ searchText }) { my={2} > - + {t("search:searchPageTittle")} - +
{ return ( - - - - - + + + + + + + + + - - - + + + ); };