1
+ /* eslint-disable react/display-name */
1
2
import React from 'react' ;
2
- import Dm from './user-icon/dm' ;
3
- import Tpp from './user-icon/tpp' ;
4
3
import { Button } from '@bifrostui/react' ;
5
- import { usePrefersColor , useNavigate } from 'dumi' ;
4
+ import { usePrefersColor , useNavigate , useIntl , useLocale } from 'dumi' ;
6
5
import { ToTopOutlinedIcon } from '@bifrostui/icons' ;
7
- import './home-page.less' ;
6
+ import Tpp from './user-icon/tpp' ;
7
+ import Dm from './user-icon/dm' ;
8
+ import './index.less' ;
9
+ import locales from './locales' ;
8
10
9
11
export default ( ) => {
10
12
const [ color ] = usePrefersColor ( ) ;
13
+ const { locale } = useIntl ( ) ;
14
+ const current = locale === 'zh-CN' ? 'zhCN' : 'enUS' ;
11
15
const navigate = useNavigate ( ) ;
12
16
return (
13
- < div className = "main-container" >
17
+ < div className = "main-container home-page " >
14
18
< div className = "main-head" >
15
19
< div >
16
20
< img
17
21
className = "main-logo"
18
22
src = "https://gw.alicdn.com/imgextra/i2/O1CN01Bqi4MA1USNSLdER5C_!!6000000002516-55-tps-190-90.svg"
19
23
/>
20
- < div className = "main-desc" > 一款简洁灵活的跨端组件库 </ div >
24
+ < div className = "main-desc" > { locales [ current ] . description } </ div >
21
25
< Button
22
26
size = "large"
23
27
variant = "contained"
24
28
className = "start-btn"
25
29
endIcon = { < ToTopOutlinedIcon /> }
26
30
onClick = { ( ) => {
27
- navigate ( " /guide/introduce" , { replace : true } ) ;
31
+ navigate ( ' /guide/introduce' , { replace : true } ) ;
28
32
} }
29
33
>
30
- 开始体验
34
+ { locales [ current ] . start }
31
35
</ Button >
32
36
</ div >
33
37
< img
@@ -41,51 +45,61 @@ export default () => {
41
45
className = "introduce-icon"
42
46
src = "https://gw.alicdn.com/imgextra/i1/O1CN01y4iaZr1aLP2g7R9xm_!!6000000003313-2-tps-160-160.png"
43
47
/>
44
- < div className = "introduce-title" > 一码多端</ div >
48
+ < div className = "introduce-title" >
49
+ { locales [ current ] . features [ 0 ] . title }
50
+ </ div >
45
51
< div className = "introduce-desc" >
46
- 同时支持H5和小程序
52
+ { locales [ current ] . features [ 0 ] . desc }
47
53
</ div >
48
54
</ div >
49
55
< div className = "introduce-item" >
50
56
< img
51
57
className = "introduce-icon"
52
58
src = "https://gw.alicdn.com/imgextra/i4/O1CN01fvzf101QVLTsWkcrR_!!6000000001981-2-tps-160-160.png"
53
59
/>
54
- < div className = "introduce-title" > 高定制</ div >
60
+ < div className = "introduce-title" >
61
+ { locales [ current ] . features [ 1 ] . title }
62
+ </ div >
55
63
< div className = "introduce-desc" >
56
- 一致优雅的API帮助您快速创造新主题
64
+ { locales [ current ] . features [ 1 ] . desc }
57
65
</ div >
58
66
</ div >
59
67
< div className = "introduce-item" >
60
68
< img
61
69
className = "introduce-icon"
62
70
src = "https://gw.alicdn.com/imgextra/i4/O1CN01CCqAR028qGfPoYba0_!!6000000007983-2-tps-160-160.png"
63
71
/>
64
- < div className = "introduce-title" > 高可用</ div >
72
+ < div className = "introduce-title" >
73
+ { locales [ current ] . features [ 2 ] . title }
74
+ </ div >
65
75
< div className = "introduce-desc" >
66
- 完善的配套,丰富的组件,开箱即用
76
+ { locales [ current ] . features [ 2 ] . desc }
67
77
</ div >
68
78
</ div >
69
79
</ div >
70
80
< div className = "main-resource" >
71
81
< div className = "resource-item" >
72
- < div className = "resource-title" > 设计语言</ div >
82
+ < div className = "resource-title" >
83
+ { locales [ current ] . subTitle [ 0 ] . title }
84
+ </ div >
73
85
< div className = "resource-content" >
74
86
< div >
75
- < div className = "content-title" > 设计语言</ div >
87
+ < div className = "content-title" >
88
+ { locales [ current ] . subTitle [ 0 ] . title }
89
+ </ div >
76
90
< div className = "content-desc" >
77
- 基于阿里影业的众多业务实践沉淀的设计语言和设计系统
91
+ { locales [ current ] . subTitle [ 0 ] . desc }
78
92
</ div >
79
93
< Button
80
94
size = "large"
81
95
variant = "contained"
82
96
style = { { '--bg-color' : '#2356df' , '--text-color' : '#fff' } }
83
97
endIcon = { < ToTopOutlinedIcon /> }
84
98
onClick = { ( ) => {
85
- navigate ( " /design/colors" , { replace : true } ) ;
99
+ navigate ( ' /design/colors' , { replace : true } ) ;
86
100
} }
87
101
>
88
- 查看详情
102
+ { locales [ current ] . subTitle [ 0 ] . btn }
89
103
</ Button >
90
104
</ div >
91
105
< img
@@ -95,23 +109,27 @@ export default () => {
95
109
</ div >
96
110
</ div >
97
111
< div className = "resource-item" >
98
- < div className = "resource-title" > 组件列表</ div >
112
+ < div className = "resource-title" >
113
+ { locales [ current ] . subTitle [ 1 ] . title }
114
+ </ div >
99
115
< div className = "resource-content" >
100
116
< div >
101
- < div className = "content-title" > 组件列表</ div >
117
+ < div className = "content-title" >
118
+ { locales [ current ] . subTitle [ 1 ] . title }
119
+ </ div >
102
120
< div className = "content-desc" >
103
- 一致的API、丰富的组件帮助您快速构建前端应用
121
+ { locales [ current ] . subTitle [ 1 ] . desc }
104
122
</ div >
105
123
< Button
106
124
size = "large"
107
125
variant = "contained"
108
126
style = { { '--bg-color' : '#2356df' , '--text-color' : '#fff' } }
109
127
endIcon = { < ToTopOutlinedIcon /> }
110
128
onClick = { ( ) => {
111
- navigate ( " /cores/button" , { replace : true } ) ;
129
+ navigate ( ' /cores/button' , { replace : true } ) ;
112
130
} }
113
131
>
114
- 查看详情
132
+ { locales [ current ] . subTitle [ 1 ] . btn }
115
133
</ Button >
116
134
</ div >
117
135
< img
@@ -123,7 +141,7 @@ export default () => {
123
141
</ div >
124
142
125
143
< div className = "main-users" >
126
- < div className = "users-title" > 谁在使用 </ div >
144
+ < div className = "users-title" > { locales [ current ] . subTitle [ 2 ] . title } </ div >
127
145
< div className = "user-list" >
128
146
< Tpp color = { color === 'light' ? '#eee' : '#5F6672' } />
129
147
< Dm color = { color === 'light' ? '#eee' : '#5F6672' } />
0 commit comments