@@ -24,9 +24,9 @@ const { Title, Text, Paragraph } = Typography;
24
24
interface HeroSectionProps {
25
25
challenges : number ;
26
26
difficultyCounts : {
27
- easy : number ;
28
- medium : number ;
29
- hard : number ;
27
+ beginner : number ;
28
+ intermediate : number ;
29
+ advanced : number ;
30
30
} ;
31
31
animatedStats : boolean ;
32
32
}
@@ -40,10 +40,10 @@ const HeroSection: React.FC<HeroSectionProps> = ({ challenges, difficultyCounts,
40
40
const isMobile = useMediaQuery ( { maxWidth : 768 } ) ;
41
41
42
42
// 计算每个难度级别的百分比
43
- const total = difficultyCounts . easy + difficultyCounts . medium + difficultyCounts . hard || 1 ;
44
- const easyPercent = Math . round ( ( difficultyCounts . easy / total ) * 100 ) ;
45
- const mediumPercent = Math . round ( ( difficultyCounts . medium / total ) * 100 ) ;
46
- const hardPercent = Math . round ( ( difficultyCounts . hard / total ) * 100 ) ;
43
+ const total = difficultyCounts . beginner + difficultyCounts . intermediate + difficultyCounts . advanced || 1 ;
44
+ const beginnerPercent = Math . round ( ( difficultyCounts . beginner / total ) * 100 ) ;
45
+ const intermediatePercent = Math . round ( ( difficultyCounts . intermediate / total ) * 100 ) ;
46
+ const advancedPercent = Math . round ( ( difficultyCounts . advanced / total ) * 100 ) ;
47
47
48
48
// 难度级别卡片样式
49
49
const difficultyCardStyle = {
@@ -174,7 +174,7 @@ const HeroSection: React.FC<HeroSectionProps> = ({ challenges, difficultyCounts,
174
174
< Row gutter = { [ isMobile ? 8 : 16 , isMobile ? 8 : 16 ] } >
175
175
{ /* 初级难度 */ }
176
176
< Col span = { 24 } sm = { 8 } >
177
- < Tooltip title = { `${ easyPercent } % ${ t ( 'home.hero.stats.ofTotal' ) } ` } >
177
+ < Tooltip title = { `${ beginnerPercent } % ${ t ( 'home.hero.stats.ofTotal' ) } ` } >
178
178
< div
179
179
style = { {
180
180
...difficultyCardStyle ,
@@ -200,10 +200,10 @@ const HeroSection: React.FC<HeroSectionProps> = ({ challenges, difficultyCounts,
200
200
marginBottom : '8px' ,
201
201
textShadow : '0 0 10px rgba(82, 196, 26, 0.4)'
202
202
} } >
203
- { difficultyCounts . easy }
203
+ { difficultyCounts . beginner }
204
204
</ div >
205
205
< Progress
206
- percent = { easyPercent }
206
+ percent = { beginnerPercent }
207
207
showInfo = { false }
208
208
strokeColor = "#52c41a"
209
209
trailColor = "rgba(255,255,255,0.1)"
@@ -215,7 +215,7 @@ const HeroSection: React.FC<HeroSectionProps> = ({ challenges, difficultyCounts,
215
215
216
216
{ /* 中级难度 */ }
217
217
< Col span = { 24 } sm = { 8 } >
218
- < Tooltip title = { `${ mediumPercent } % ${ t ( 'home.hero.stats.ofTotal' ) } ` } >
218
+ < Tooltip title = { `${ intermediatePercent } % ${ t ( 'home.hero.stats.ofTotal' ) } ` } >
219
219
< div
220
220
style = { {
221
221
...difficultyCardStyle ,
@@ -241,10 +241,10 @@ const HeroSection: React.FC<HeroSectionProps> = ({ challenges, difficultyCounts,
241
241
marginBottom : '8px' ,
242
242
textShadow : '0 0 10px rgba(250, 173, 20, 0.4)'
243
243
} } >
244
- { difficultyCounts . medium }
244
+ { difficultyCounts . intermediate }
245
245
</ div >
246
246
< Progress
247
- percent = { mediumPercent }
247
+ percent = { intermediatePercent }
248
248
showInfo = { false }
249
249
strokeColor = "#faad14"
250
250
trailColor = "rgba(255,255,255,0.1)"
@@ -256,7 +256,7 @@ const HeroSection: React.FC<HeroSectionProps> = ({ challenges, difficultyCounts,
256
256
257
257
{ /* 高级难度 */ }
258
258
< Col span = { 24 } sm = { 8 } >
259
- < Tooltip title = { `${ hardPercent } % ${ t ( 'home.hero.stats.ofTotal' ) } ` } >
259
+ < Tooltip title = { `${ advancedPercent } % ${ t ( 'home.hero.stats.ofTotal' ) } ` } >
260
260
< div
261
261
style = { {
262
262
...difficultyCardStyle ,
@@ -282,10 +282,10 @@ const HeroSection: React.FC<HeroSectionProps> = ({ challenges, difficultyCounts,
282
282
marginBottom : '8px' ,
283
283
textShadow : '0 0 10px rgba(245, 34, 45, 0.4)'
284
284
} } >
285
- { difficultyCounts . hard }
285
+ { difficultyCounts . advanced }
286
286
</ div >
287
287
< Progress
288
- percent = { hardPercent }
288
+ percent = { advancedPercent }
289
289
showInfo = { false }
290
290
strokeColor = "#f5222d"
291
291
trailColor = "rgba(255,255,255,0.1)"
0 commit comments