diff --git a/frontend/src/_vars.scss b/frontend/src/_vars.scss index 6cfc0eb..e65237e 100755 --- a/frontend/src/_vars.scss +++ b/frontend/src/_vars.scss @@ -1,2 +1,4 @@ $primary_color: #242a33; +$second_color: #1A1B1E; +$third_color:#25262b; diff --git a/frontend/src/components/RegexView/RegexView.module.scss b/frontend/src/components/RegexView/RegexView.module.scss index 26f5d90..6dd71be 100755 --- a/frontend/src/components/RegexView/RegexView.module.scss +++ b/frontend/src/components/RegexView/RegexView.module.scss @@ -1,6 +1,13 @@ +@use "../../vars" as *; .box{ padding:30px; margin:5px; +} + +.regex_text{ + padding: 10px; + background-color: $third_color; + border-radius: 15px; } \ No newline at end of file diff --git a/frontend/src/components/RegexView/index.tsx b/frontend/src/components/RegexView/index.tsx index c67dabc..afbe669 100755 --- a/frontend/src/components/RegexView/index.tsx +++ b/frontend/src/components/RegexView/index.tsx @@ -1,17 +1,85 @@ -import { TextInput } from '@mantine/core'; +import { Center, Grid, SegmentedControl, Text, Title, Box, Badge, Space, ActionIcon } from '@mantine/core'; import React from 'react'; import { RegexFilter } from '../../js/models'; import { getHumanReadableRegex } from '../../js/utils'; - import style from "./RegexView.module.scss"; +import { FaListAlt } from "react-icons/fa" +import { TiCancel } from "react-icons/ti" +import { BsTrashFill } from "react-icons/bs" function RegexView({ regexInfo }:{ regexInfo:RegexFilter }) { + + const mode_string = regexInfo.mode == "C"? "C -> S": + regexInfo.mode == "S"? "S -> C": + regexInfo.mode == "B"? "S <-> C": "🤔" + + let regex_expr = getHumanReadableRegex(regexInfo.regex); + let exact_regex = true; + + if (regex_expr.length>=4 && regex_expr.startsWith(".*") && regex_expr.endsWith(".*")){ + regex_expr = regex_expr.substring(2,regex_expr.length-2) + exact_regex = false; + } + return