Skip to content

Commit

Permalink
rename anti-code to opposing-code
Browse files Browse the repository at this point in the history
  • Loading branch information
fynnos committed Dec 5, 2024
1 parent ad13478 commit 841f340
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ function AnnotationScaling() {
const codes = ProjectHooks.useGetAllCodes(projectId, false);

const [code, setCode] = useState<CodeRead | null>(null);
const [antiCode, setAntiCode] = useState<CodeRead | null>(null);
const [opposingCode, setopposingCode] = useState<CodeRead | null>(null);
const [accept, setAccept] = useState<AnnoscalingResult[]>([]);
const [reject, setReject] = useState<AnnoscalingResult[]>([]);

// global server state (react-query)
const suggestions = AnnoscalingHooks.useAnnotationSuggestions(projectId, code?.id, antiCode?.id);
const suggestions = AnnoscalingHooks.useAnnotationSuggestions(projectId, code?.id, opposingCode?.id);
const confirmHook = AnnoscalingHooks.useConfirmSuggestions();

const handleSubmit = () => {
confirmHook.mutate(
{
requestBody: {
code_id: code!.id,
reject_code_id: antiCode!.id,
reject_code_id: opposingCode!.id,
project_id: projectId,
accept: accept.map((r) => ({ sdoc_id: r.sdoc_id, sentence: r.sentence_id })),
reject: reject.map((r) => ({ sdoc_id: r.sdoc_id, sentence: r.sentence_id })),
Expand Down Expand Up @@ -102,15 +102,15 @@ function AnnotationScaling() {
sx={{ width: 300 }}
renderInput={(params) => (
<Stack direction="row" alignItems="center">
<SquareIcon style={{ color: antiCode?.color ?? "white" }}></SquareIcon>
<TextField autoFocus {...params} label="Anti-Code"></TextField>
<SquareIcon style={{ color: opposingCode?.color ?? "white" }}></SquareIcon>
<TextField autoFocus {...params} label="Opposing-Code"></TextField>
</Stack>
)}
autoHighlight
selectOnFocus
clearOnBlur
handleHomeEndKeys
onChange={(_event, value, _reason) => setAntiCode(value)}
onChange={(_event, value, _reason) => setopposingCode(value)}
/>
<Button
variant="contained"
Expand Down

0 comments on commit 841f340

Please sign in to comment.