diff --git a/src/GZCTF/ClientApp/package.json b/src/GZCTF/ClientApp/package.json index 42f57f202..b1f73ba5f 100644 --- a/src/GZCTF/ClientApp/package.json +++ b/src/GZCTF/ClientApp/package.json @@ -50,7 +50,7 @@ "@types/node": "18.15.11", "@types/prismjs": "^1.26.0", "@types/react": "^18.2.5", - "@types/react-dom": "^18.2.3", + "@types/react-dom": "^18.2.4", "@types/react-pdf": "^6.2.0", "@typescript-eslint/eslint-plugin": "^5.59.2", "@typescript-eslint/parser": "^5.59.2", diff --git a/src/GZCTF/ClientApp/pnpm-lock.yaml b/src/GZCTF/ClientApp/pnpm-lock.yaml index c02467420..4fb00daee 100644 --- a/src/GZCTF/ClientApp/pnpm-lock.yaml +++ b/src/GZCTF/ClientApp/pnpm-lock.yaml @@ -118,8 +118,8 @@ devDependencies: specifier: ^18.2.5 version: 18.2.5 '@types/react-dom': - specifier: ^18.2.3 - version: 18.2.3 + specifier: ^18.2.4 + version: 18.2.4 '@types/react-pdf': specifier: ^6.2.0 version: 6.2.0 @@ -1210,8 +1210,8 @@ packages: /@types/prop-types@15.7.5: resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} - /@types/react-dom@18.2.3: - resolution: {integrity: sha512-hxXEXWxFJXbY0LMj/T69mznqOZJXNtQMqVxIiirVAZnnpeYiD4zt+lPsgcr/cfWg2VLsxZ1y26vigG03prYB+Q==} + /@types/react-dom@18.2.4: + resolution: {integrity: sha512-G2mHoTMTL4yoydITgOGwWdWMVd8sNgyEP85xVmMKAPUBwQWm9wBPQUmvbeF4V3WBY1P7mmL4BkjQ0SqUpf1snw==} dependencies: '@types/react': 18.2.5 dev: true diff --git a/src/GZCTF/ClientApp/src/components/ChallengeDetailModal.tsx b/src/GZCTF/ClientApp/src/components/ChallengeDetailModal.tsx index cffe833c8..912455467 100644 --- a/src/GZCTF/ClientApp/src/components/ChallengeDetailModal.tsx +++ b/src/GZCTF/ClientApp/src/components/ChallengeDetailModal.tsx @@ -307,7 +307,7 @@ const ChallengeDetailModal: FC = (props) => { > - + {challenge?.context?.url && ( = (props) => { onMouseEnter={downloadOpen} onMouseLeave={downloadClose} onClick={() => window.open(challenge.context?.url ?? '#')} - style={{ - float: 'right', - }} + top={0} + right={0} + pos="absolute" > @@ -341,7 +341,17 @@ const ChallengeDetailModal: FC = (props) => { )} - + p:first-child:before': { + content: '""', + float: 'right', + width: 45, + height: 45, + }, + }} + /> {challenge?.hints && challenge.hints.length > 0 && ( diff --git a/src/GZCTF/ClientApp/src/components/MarkdownRender.tsx b/src/GZCTF/ClientApp/src/components/MarkdownRender.tsx index 3217dfce7..420747851 100644 --- a/src/GZCTF/ClientApp/src/components/MarkdownRender.tsx +++ b/src/GZCTF/ClientApp/src/components/MarkdownRender.tsx @@ -3,11 +3,12 @@ import 'katex/dist/katex.min.css' import { marked } from 'marked' import Prism from 'prismjs' import { forwardRef } from 'react' -import { TypographyStylesProvider } from '@mantine/core' +import { Sx, TypographyStylesProvider } from '@mantine/core' import { useTypographyStyles } from '@Utils/useTypographyStyles' interface MarkdownProps extends React.ComponentPropsWithoutRef<'div'> { source: string + sx?: Sx | (Sx | undefined)[] } const RenderReplacer = (func: any, replacer: (text: string) => string) => { @@ -59,7 +60,7 @@ export const MarkdownRender = forwardRef((props, className={others.className ? cx(classes.root, others.className) : classes.root} {...others} > -
+
) }) diff --git a/src/GZCTF/ClientApp/src/components/RecentGame.tsx b/src/GZCTF/ClientApp/src/components/RecentGame.tsx index 859266561..00d1f9cf3 100644 --- a/src/GZCTF/ClientApp/src/components/RecentGame.tsx +++ b/src/GZCTF/ClientApp/src/components/RecentGame.tsx @@ -52,9 +52,9 @@ const RecentGame: FC = ({ game, ...others }) => { > {poster ? ( - poster + poster ) : ( -
+
)} @@ -62,9 +62,9 @@ const RecentGame: FC = ({ game, ...others }) => { @@ -76,22 +76,22 @@ const RecentGame: FC = ({ game, ...others }) => { - + <Title lineClamp={1} order={4} align="left" color={theme.colors.gray[0]}> > {title} - + {status === GameStatus.Coming ? '开始于' : '结束于'} diff --git a/src/GZCTF/ClientApp/src/components/RecentGameCarousel.tsx b/src/GZCTF/ClientApp/src/components/RecentGameCarousel.tsx index 159118dbe..e680b471e 100644 --- a/src/GZCTF/ClientApp/src/components/RecentGameCarousel.tsx +++ b/src/GZCTF/ClientApp/src/components/RecentGameCarousel.tsx @@ -13,7 +13,7 @@ const RecentGameCarousel: FC = ({ games, ...props }) => return ( = ({ gameId, wpddl, }, }} > - + 提交说明 = (props) => { variant="filled" size="lg" color="brand" + top={0} + right={0} + pos="absolute" onMouseEnter={downloadOpen} onMouseLeave={downloadClose} onClick={() => @@ -134,9 +137,6 @@ const ChallengePreviewModal: FC = (props) => { withCloseButton: false, }) } - style={{ - float: 'right', - }} > @@ -148,7 +148,17 @@ const ChallengePreviewModal: FC = (props) => { )} - + p:first-child:before': { + content: '""', + float: 'right', + width: 45, + height: 45, + }, + }} + /> {challenge?.hints && challenge.hints.length > 0 && ( diff --git a/src/GZCTF/ClientApp/src/pages/account/Login.tsx b/src/GZCTF/ClientApp/src/pages/account/Login.tsx index 99d880a97..44c4afaa4 100644 --- a/src/GZCTF/ClientApp/src/pages/account/Login.tsx +++ b/src/GZCTF/ClientApp/src/pages/account/Login.tsx @@ -1,5 +1,5 @@ import { FC, useState } from 'react' -import { Link, useNavigate, useParams } from 'react-router-dom' +import { Link, useNavigate, useSearchParams } from 'react-router-dom' import { PasswordInput, Grid, TextInput, Button, Anchor } from '@mantine/core' import { useInputState, getHotkeyHandler } from '@mantine/hooks' import { showNotification } from '@mantine/notifications' @@ -11,7 +11,7 @@ import { usePageTitle } from '@Utils/usePageTitle' import api from '@Api' const Login: FC = () => { - const params = useParams() + const params = useSearchParams()[0] const navigate = useNavigate() const [pwd, setPwd] = useInputState('') @@ -49,8 +49,7 @@ const Login: FC = () => { withCloseButton: false, }) api.account.mutateAccountProfile() - const from = params['from'] - navigate(from ? (from as string) : '/') + navigate(params.get('from') ?? '/') }) .catch((err) => { showErrorNotification(err) diff --git a/src/GZCTF/ClientApp/src/pages/admin/games/[id]/Review.tsx b/src/GZCTF/ClientApp/src/pages/admin/games/[id]/Review.tsx index d18899325..e279611b4 100644 --- a/src/GZCTF/ClientApp/src/pages/admin/games/[id]/Review.tsx +++ b/src/GZCTF/ClientApp/src/pages/admin/games/[id]/Review.tsx @@ -186,7 +186,7 @@ const ParticipationItem: FC = (props) => { - + {participation.organization} @@ -200,7 +200,7 @@ const ParticipationItem: FC = (props) => { - + {StatusMap.get(participation.status!)?.transformTo.map((value) => { const s = StatusMap.get(value)! return (