Skip to content

Commit

Permalink
fix: at is not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Sep 21, 2022
1 parent fcabc53 commit 38b812b
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions GZCTF/ClientApp/src/components/MarkdownRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const MarkdownRender = forwardRef<HTMLDivElement, MarkdownProps>((props,
}
},
renderer,
silent: true,
})

return (
Expand Down
2 changes: 1 addition & 1 deletion GZCTF/ClientApp/src/components/PostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const PostCard: FC<PostCardProps> = ({ post, onTogglePinned }) => {
<Group position="apart" style={{ margin: 'auto', fontStyle: 'normal' }}>
<Group spacing={5} position="right">
<Avatar src={post.autherAvatar} size="sm">
{post.autherName?.at(0) ?? 'A'}
{post.autherName?.slice(0, 1) ?? 'A'}
</Avatar>
<Text weight={700}>
{post.autherName ?? 'Anonym'} 发布于 {dayjs(post.time).format('HH:mm, YY/MM/DD')}
Expand Down
4 changes: 2 additions & 2 deletions GZCTF/ClientApp/src/components/ScoreboardTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const TableRow: FC<{
}),
})}
>
{item.name?.at(0) ?? 'T'}
{item.name?.slice(0, 1) ?? 'T'}
</Avatar>
<Text
lineClamp={1}
Expand Down Expand Up @@ -340,7 +340,7 @@ const ScoreboardTable: FC = () => {
title={
<Group position="left" spacing={5} noWrap>
<Avatar src={currentItem?.avatar} size="md" radius="md" color="brand">
{currentItem?.name?.at(0) ?? 'T'}
{currentItem?.name?.slice(0, 1) ?? 'T'}
</Avatar>
<Title align="left" order={4}>
{currentItem?.name}
Expand Down
2 changes: 1 addition & 1 deletion GZCTF/ClientApp/src/components/TeamCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const TeamCard: FC<TeamCardProps> = (props) => {
<Stack style={{ flexGrow: 1 }}>
<Group align="stretch" position="apart">
<Avatar color="cyan" size="lg" radius="md" src={team.avatar}>
{team.name?.at(0) ?? 'T'}
{team.name?.slice(0, 1) ?? 'T'}
</Avatar>

<Stack spacing={0} style={{ width: 'calc(100% - 72px)' }}>
Expand Down
2 changes: 1 addition & 1 deletion GZCTF/ClientApp/src/components/TeamRank.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const TeamRank: FC<PaperProps> = (props) => {
<Stack spacing={8}>
<Group>
<Avatar color="cyan" size="md" radius="md" src={data?.rank?.avatar}>
{data?.rank?.name?.at(0) ?? 'T'}
{data?.rank?.name?.slice(0, 1) ?? 'T'}
</Avatar>
<Skeleton width="8rem" visible={!data}>
<Title order={4}>{data?.rank?.name ?? 'Team'}</Title>
Expand Down
2 changes: 1 addition & 1 deletion GZCTF/ClientApp/src/pages/admin/Teams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ const Teams: FC = () => {
<Group position="apart">
<Group position="left">
<Avatar src={team.avatar} radius="xl">
{team.name?.at(0)}
{team.name?.slice(0, 1)}
</Avatar>
<Text lineClamp={1}>{team.name}</Text>
</Group>
Expand Down
2 changes: 1 addition & 1 deletion GZCTF/ClientApp/src/pages/admin/games/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const Games: FC = () => {
sx={{ cursor: 'pointer' }}
>
<Avatar src={game.poster} radius={0}>
{game.title?.at(0)}
{game.title?.slice(0, 1)}
</Avatar>
<Text weight={700} lineClamp={1}>
{game.title}
Expand Down
4 changes: 2 additions & 2 deletions GZCTF/ClientApp/src/pages/posts/[postId]/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const Post: FC = () => {
{post?.title}
</Title>
<Avatar src={post?.autherAvatar} color="brand" radius="xl" size="lg">
{post?.autherName?.at(0) ?? 'A'}
{post?.autherName?.slice(0, 1) ?? 'A'}
</Avatar>
<Text weight={700}>{post?.autherName ?? 'Anonym'}</Text>
<Stack spacing={2}>
Expand All @@ -75,7 +75,7 @@ const Post: FC = () => {
)}
<Group spacing={5} mb={100} position="right">
<Avatar src={post?.autherAvatar} size="sm">
{post?.autherName?.at(0) ?? 'A'}
{post?.autherName?.slice(0, 1) ?? 'A'}
</Avatar>
<Text weight={700}>
{post?.autherName ?? 'Anonym'} 发布于 {dayjs(post?.time).format('HH:mm, YY/MM/DD')}
Expand Down
5 changes: 4 additions & 1 deletion GZCTF/ClientApp/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ export default defineConfig(({ mode }) => {
'/hub': { target: TARGET.replace('http', 'ws'), ws: true },
},
},
preview: {
port: 64000
},
build: {
outDir: 'build',
target: ['es2018', 'chrome80'],
target: ['es2020', 'chrome86'],
assetsDir: 'static',
chunkSizeWarningLimit: 2000,
rollupOptions: {
Expand Down

0 comments on commit 38b812b

Please sign in to comment.