chore: submission list router rename to submission

This commit is contained in:
Paul Pan 2024-03-16 20:10:08 +08:00
parent 2816c9fbee
commit 1c69063825
4 changed files with 15 additions and 20 deletions

10
src/components/Title.tsx Normal file
View File

@ -0,0 +1,10 @@
import { Center, Text } from "@chakra-ui/react";
export default function Title(props: { word: string; center?: boolean }) {
const b = (
<Text as="b" fontSize="lg">
{props.word}
</Text>
);
return props.center ? <Center>{b}</Center> : b;
}

View File

@ -30,9 +30,9 @@ export default function ProblemDetailPage() {
variant="outline"
size="sm"
leftIcon={<MdSearch />}
onClick={() => navigate(`/problem/${id}/status`)}
onClick={() => navigate(`/problem/${id}/submission`)}
>
Status
Submissions
</Button>
</WrapItem>
</Wrap>

View File

@ -1,28 +1,13 @@
import { useState } from "react";
import type { ColumnDef, PaginationState } from "@tanstack/react-table";
import {
Badge,
Button,
Input,
InputGroup,
InputLeftElement,
Link,
Stack,
Text,
useColorModeValue,
} from "@chakra-ui/react";
import { Badge, Button, Input, InputGroup, InputLeftElement, Link, Stack, useColorModeValue } from "@chakra-ui/react";
import { LinkIcon, SearchIcon } from "@chakra-ui/icons";
import { Link as ReactRouterLink } from "react-router-dom";
import type { ProblemInfo } from "../app/services/problem";
import { useSearchQuery } from "../app/services/problem";
import Table from "../components/Table";
const Title = (props: { word: string }) => (
<Text as="b" fontSize="lg">
{props.word}{" "}
</Text>
);
import Title from "../components/Title";
const columns: ColumnDef<ProblemInfo>[] = [
{

View File

@ -26,7 +26,7 @@ export default function SubmitPage() {
useEffect(() => {
if (result.isSuccess) {
navigate(`/problem/${id}/status`);
navigate(`/problem/${id}/submission`);
} else if (result.isError) {
toast({
status: "error",