Skip to content

Commit 9b13aa6

Browse files
一些体验上的调整
1 parent 6f4a552 commit 9b13aa6

File tree

3 files changed

+27
-28
lines changed

3 files changed

+27
-28
lines changed

src/app/features/article/index.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ export default function Article() {
6262
getArticle(skipBefore / 1000)
6363
.then(v => {
6464
setStatus({ details: v });
65-
setOtherRefuseCommit('');
6665
if (v.article) setSkipBefore(v.article.promoteResult.updateAt * 1000);
6766
})
6867
.catch(
@@ -74,6 +73,7 @@ export default function Article() {
7473
setStatus({ details: details, submiting: true });
7574
await submitArticleCheckResult([details.article.lid, refuseCommit || true]);
7675
setStatus(null);
76+
setOtherRefuseCommit('');
7777
updateArticle();
7878
}
7979

@@ -119,34 +119,34 @@ export default function Article() {
119119
'YYYY/MM/DD HH:mm:ss'
120120
)}
121121
。文章 LID:
122-
<a
122+
<Link
123123
href={`https://www.luogu.com.cn/article/${details.article.lid}`}
124124
target="_blank"
125125
>
126126
{details.article.lid}
127-
</a>
127+
</Link>
128128
</Text>
129129
{details.article.solutionFor && (
130130
<Text>
131131
关联于题目{' '}
132-
<a
132+
<Link
133133
href={`https://www.luogu.com.cn/problem/${details.article.solutionFor.pid}`}
134134
target="_blank"
135135
>
136136
{details.article.solutionFor.pid}{' '}
137137
{details.article.solutionFor.title}
138-
</a>
138+
</Link>
139139
140140
{details.countForProblem && (
141141
<>
142142
共有 {details.countForProblem.pending} 篇待审核题解,
143143
{details.countForProblem.available}
144-
<a
144+
<Link
145145
href={`https://www.luogu.com.cn/problem/solution/${details.article.solutionFor.pid}`}
146146
target="_blank"
147147
>
148148
已通过题解
149-
</a>
149+
</Link>
150150
151151
</>
152152
)}
@@ -185,6 +185,7 @@ export default function Article() {
185185
很遗憾,您的《
186186
<Link
187187
href={`https://www.luogu.com.cn/article/${details.article.lid}`}
188+
target='_blank'
188189
>
189190
{details.article.title}
190191
</Link>

src/app/index.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,24 @@ import {
33
FluentProvider,
44
webLightTheme,
55
Image,
6-
Spinner
6+
Spinner,
7+
Theme
78
} from '@fluentui/react-components';
8-
9-
import Features from './features';
10-
11-
import './style.css';
129
import { UserSummary } from 'luogu-api';
1310
import { fetchMyInfo } from '../fetch';
1411
import { MyInfoContext } from './contexts';
1512
import { ErrorDiv } from './utils';
1613

14+
import Features from './features';
15+
16+
import './style.css';
17+
18+
const theme: Theme = {
19+
...webLightTheme,
20+
colorBrandForegroundLink: '#3498db',
21+
colorBrandForegroundLinkHover: '#0056b3'
22+
};
23+
1724
export default function App() {
1825
const [nowFeature, setNowFeature] = useState<number>(0);
1926
const NowFeatureComponent = Features[nowFeature][1];
@@ -33,7 +40,7 @@ export default function App() {
3340
}, []);
3441

3542
return (
36-
<FluentProvider theme={webLightTheme}>
43+
<FluentProvider theme={theme}>
3744
<div className="root">
3845
{!fetchError ? (
3946
<>

src/app/utils.tsx

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,7 @@ import React from 'react';
33
import { UserSummary } from 'luogu-api';
44
import { isError } from 'lodash';
55
import { isAxiosError } from 'axios';
6-
import {
7-
Dialog,
8-
DialogSurface,
9-
DialogBody,
10-
DialogTitle,
11-
DialogContent,
12-
DialogActions,
13-
DialogTrigger,
14-
Button,
15-
tokens,
16-
Input
17-
} from '@fluentui/react-components';
6+
import { Button, tokens, Input } from '@fluentui/react-components';
187
import dayjs from 'dayjs';
198
import { DismissCircleRegular } from '@fluentui/react-icons';
209

@@ -50,9 +39,11 @@ export function UserName({ children }: { children: UserSummary }) {
5039
}}
5140
>
5241
<>{children.name}</>
53-
<span style={{ marginLeft: '4px' }}>
54-
<CcfLevelSvg level={children.ccfLevel} />
55-
</span>
42+
{children.ccfLevel > 2 && (
43+
<span style={{ marginLeft: '4px' }}>
44+
<CcfLevelSvg level={children.ccfLevel} />
45+
</span>
46+
)}
5647
{children.badge && (
5748
<span
5849
className="username-badge"

0 commit comments

Comments
 (0)