Added matches dialog alert and column titles (#2771)

pull/2770/head
Anderson Shindy Oki 2 days ago committed by GitHub
parent 0f7f3192c3
commit 04be28f437
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,12 +1,21 @@
import { FunctionComponent } from "react"; import { FunctionComponent } from "react";
import { Group, List, Popover, Stack, Text } from "@mantine/core";
import { useHover } from "@mantine/hooks";
import { import {
faCheck, Alert,
em,
Flex,
Group,
List,
Popover,
Stack,
Text,
} from "@mantine/core";
import { useHover, useMediaQuery } from "@mantine/hooks";
import {
faCheckCircle, faCheckCircle,
faExclamationCircle, faExclamationCircle,
faListCheck, faListCheck,
faTimes, faMinus,
faPlus,
} from "@fortawesome/free-solid-svg-icons"; } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { BuildKey } from "@/utilities"; import { BuildKey } from "@/utilities";
@ -26,6 +35,8 @@ const StateIcon: FunctionComponent<StateIconProps> = ({
const { hovered, ref } = useHover(); const { hovered, ref } = useHover();
const isMobile = useMediaQuery(`(max-width: ${em(750)})`);
const PopoverTarget: FunctionComponent = () => { const PopoverTarget: FunctionComponent = () => {
if (isHistory) { if (isHistory) {
return <FontAwesomeIcon icon={faListCheck} />; return <FontAwesomeIcon icon={faListCheck} />;
@ -48,11 +59,23 @@ const StateIcon: FunctionComponent<StateIconProps> = ({
</Text> </Text>
</Popover.Target> </Popover.Target>
<Popover.Dropdown> <Popover.Dropdown>
<Text size="xl" ta="center">
Scoring Criteria
</Text>
{isMobile ? null : (
<Alert variant="light" color="blue" mb="sm">
Not matching attributes will not prevent the subtitle to be
downloaded and are strictly used for scoring the subtitle.
</Alert>
)}
<Group justify="left" gap="xl" wrap="nowrap" grow> <Group justify="left" gap="xl" wrap="nowrap" grow>
<Stack align="flex-start" justify="flex-start" gap="xs" mb="auto"> <Stack align="flex-start" justify="flex-start" gap="xs" mb="auto">
<Flex gap="sm">
<Text c="green"> <Text c="green">
<FontAwesomeIcon icon={faCheck}></FontAwesomeIcon> <FontAwesomeIcon icon={faPlus}></FontAwesomeIcon>
</Text> </Text>
<Text c="green">Matching</Text>
</Flex>
<List> <List>
{matches.map((v, idx) => ( {matches.map((v, idx) => (
<List.Item key={BuildKey(idx, v, "match")}>{v}</List.Item> <List.Item key={BuildKey(idx, v, "match")}>{v}</List.Item>
@ -60,9 +83,12 @@ const StateIcon: FunctionComponent<StateIconProps> = ({
</List> </List>
</Stack> </Stack>
<Stack align="flex-start" justify="flex-start" gap="xs" mb="auto"> <Stack align="flex-start" justify="flex-start" gap="xs" mb="auto">
<Flex gap="sm">
<Text c="yellow"> <Text c="yellow">
<FontAwesomeIcon icon={faTimes}></FontAwesomeIcon> <FontAwesomeIcon icon={faMinus}></FontAwesomeIcon>
</Text> </Text>
<Text c="yellow">Not Matching</Text>
</Flex>
<List> <List>
{dont.map((v, idx) => ( {dont.map((v, idx) => (
<List.Item key={BuildKey(idx, v, "miss")}>{v}</List.Item> <List.Item key={BuildKey(idx, v, "miss")}>{v}</List.Item>

Loading…
Cancel
Save