Skip to content

Commit c092f6e

Browse files
committed
Migrate various components on the page
1 parent b6ec068 commit c092f6e

File tree

6 files changed

+32
-31
lines changed

6 files changed

+32
-31
lines changed

src/components/AletheiaCaptcha.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import { useTranslation } from "next-i18next";
22
import React, { forwardRef, useImperativeHandle, useState } from "react";
33
import ReCAPTCHA from "react-google-recaptcha";
44
import { useAppSelector } from "../store/store";
5-
import Text from "antd/lib/typography/Text";
5+
import Typography from "@mui/material/Typography";
6+
import colors from "../styles/colors";
67
const recaptchaRef = React.createRef<ReCAPTCHA>();
78

89
interface CaptchaProps {
@@ -43,7 +44,7 @@ const AletheiaCaptcha = forwardRef(({ onChange }: CaptchaProps, ref) => {
4344
onExpired={onExpiredCaptcha}
4445
/>
4546
{showRequired && (
46-
<Text type="danger">{t("common:requiredFieldError")}</Text>
47+
<Typography variant="h1" style={{ color: colors.error, fontSize: 16 }} >{t("common:requiredFieldError")}</Typography>
4748
)}
4849
</div>
4950
);

src/components/ClaimReview/form/DynamicReviewTaskForm.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import { VisualEditorContext } from "../../Collaborative/VisualEditorProvider";
1212
import DynamicForm from "../../Form/DynamicForm";
1313
import { ReviewTaskEvents } from "../../../machines/reviewTask/enums";
1414
import { ReviewTaskMachineContext } from "../../../machines/reviewTask/ReviewTaskMachineProvider";
15-
import { Grid } from "@mui/material"
16-
import Text from "antd/lib/typography/Text";
15+
import { Grid, Typography } from "@mui/material"
16+
import colors from "../../../styles/colors";
1717
import {
1818
isUserLoggedIn,
1919
currentUserId,
@@ -230,9 +230,9 @@ const DynamicReviewTaskForm = ({ data_hash, personality, target }) => {
230230
/>
231231
<div style={{ paddingBottom: 20, marginLeft: 20 }}>
232232
{reviewerError && (
233-
<Text type="danger" data-cy="testReviewerError">
233+
<Typography variant="body1" style={{ color: colors.error, fontSize: 16 }} data-cy="testReviewerError">
234234
{t("reviewTask:invalidReviewerMessage")}
235-
</Text>
235+
</Typography>
236236
)}
237237
</div>
238238
{events?.length > 0 && showButtons && (

src/components/Collaborative/Components/Editor.style.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ const EditorStyle = styled.div`
3737
3838
.toolbar-item:hover::after {
3939
content: "";
40-
border: 1px solid ${colors.primary};
41-
width: 4px;
40+
background-color: ${colors.primary};
41+
width: 3px;
4242
height: 40px;
4343
}
4444

src/components/Collaborative/Components/Editor.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import React, { useCallback, useContext } from "react";
22

33
import { useHelpers, useCommands } from "@remirror/react";
4-
import SummarizeIcon from "@mui/icons-material/Summarize";
5-
import QuestionMarkIcon from "@mui/icons-material/QuestionMark";
6-
import ReportProblemIcon from "@mui/icons-material/ReportProblem";
7-
import FactCheckIcon from "@mui/icons-material/FactCheck";
8-
import { Button } from "antd";
4+
import {
5+
Summarize,
6+
QuestionMark,
7+
ReportProblem,
8+
FactCheck
9+
} from "@mui/icons-material";
10+
import { IconButton } from "@mui/material";
911
import EditorStyle from "./Editor.style";
1012
import useCardPresence from "../hooks/useCardPresence";
1113
import { ReviewTaskMachineContext } from "../../../machines/reviewTask/ReviewTaskMachineProvider";
@@ -59,7 +61,7 @@ const Editor = ({
5961
onClick: () => handleInsertNode(getContentHtml("data-summary-id")),
6062
disabled: editable || summaryDisabled,
6163
"data-cy": "testClaimReviewsummarizeAdd",
62-
icon: <SummarizeIcon className="toolbar-item-icon" />,
64+
icon: <Summarize className="toolbar-item-icon" />,
6365
},
6466
];
6567

@@ -70,21 +72,21 @@ const Editor = ({
7072
handleInsertNode(getContentHtml("data-verification-id")),
7173
disabled: editable || verificationDisabled,
7274
"data-cy": "testClaimReviewverificationAdd",
73-
icon: <FactCheckIcon className="toolbar-item-icon" />,
75+
icon: <FactCheck className="toolbar-item-icon" />,
7476
},
7577
{
7678
onClick: () =>
7779
handleInsertNode(getContentHtml("data-report-id")),
7880
disabled: editable || reportDisabled,
7981
"data-cy": "testClaimReviewreportAdd",
80-
icon: <ReportProblemIcon className="toolbar-item-icon" />,
82+
icon: <ReportProblem className="toolbar-item-icon" />,
8183
},
8284
{
8385
onClick: () =>
8486
handleInsertNode(getContentHtml("data-question-id")),
8587
disabled: editable,
8688
"data-cy": "testClaimReviewquestionsAdd",
87-
icon: <QuestionMarkIcon className="toolbar-item-icon" />,
89+
icon: <QuestionMark className="toolbar-item-icon" />,
8890
}
8991
);
9092
}
@@ -98,14 +100,14 @@ const Editor = ({
98100
<div className="toolbar">
99101
{actions ? (
100102
actions.map(({ icon, ...props }) => (
101-
<Button
103+
<IconButton
102104
key={props["data-cy"]}
103105
className="toolbar-item"
104106
style={{ outline: "none", border: "none" }}
105107
{...props}
106108
>
107109
{icon}
108-
</Button>
110+
</IconButton>
109111
))
110112
) : (
111113
<></>

src/components/Form/DynamicForm.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import { Grid } from "@mui/material";
2-
1+
import { Grid, Typography } from "@mui/material"
32
import { Controller } from "react-hook-form";
43
import DynamicInput from "./DynamicInput";
54
import React from "react";
6-
import Text from "antd/lib/typography/Text";
75
import colors from "../../styles/colors";
86
import { useTranslation } from "next-i18next";
97

@@ -73,9 +71,9 @@ const DynamicForm = ({
7371
)}
7472
/>
7573
{errors[fieldName] && (
76-
<Text type="danger" style={{ marginLeft: 20 }}>
74+
<Typography variant="body1" style={{ marginLeft: 20, color: colors.error, fontSize: 16 }}>
7775
{t(errors[fieldName].message)}
78-
</Text>
76+
</Typography>
7977
)}
8078
</Grid>
8179
</Grid>

src/components/Toolbar/ReviewTaskAdminToolBar.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Button, Col, Row } from "antd";
1+
import { Grid, IconButton } from "@mui/material";
22
import { Toolbar } from "@mui/material";
33
import React, { useContext } from "react";
44
import ManageAccountsIcon from "@mui/icons-material/ManageAccounts";
@@ -23,23 +23,23 @@ const ReviewTaskAdminToolBar = () => {
2323
};
2424

2525
return (
26-
<Row justify="center" style={{ background: colors.lightNeutral }}>
27-
<Col xs={22} lg={18}>
26+
<Grid container justifyContent="center" style={{ background: colors.lightNeutral }}>
27+
<Grid item xs={11} lg={9}>
2828
<AdminToolBarStyle
2929
namespace={nameSpace}
3030
position="static"
3131
style={{ boxShadow: "none", background: colors.lightNeutral }}
3232
>
3333
<Toolbar className="toolbar">
3434
<div className="toolbar-item">
35-
<Button onClick={handleReassignUser}>
35+
<IconButton onClick={handleReassignUser}>
3636
<ManageAccountsIcon />
37-
</Button>
37+
</IconButton>
3838
</div>
3939
</Toolbar>
4040
</AdminToolBarStyle>
41-
</Col>
42-
</Row>
41+
</Grid>
42+
</Grid>
4343
);
4444
};
4545

0 commit comments

Comments
 (0)