3
3
import Button from '@/components/Button/Button'
4
4
import useWebgalTerreAssets from '@/hooks/useWebgalTerreAssets'
5
5
import Link from 'next/link'
6
- import { RiGithubFill , RiMicrosoftFill , RiAppleFill , RiUbuntuFill } from 'react-icons/ri'
6
+ import { RiGithubFill , RiMicrosoftFill , RiAppleFill , RiUbuntuFill } from 'react-icons/ri'
7
7
import styles from '../Download.module.css'
8
- import { useLocale , useTranslations } from 'next-intl'
9
- import { i18n } from '@/i18n'
8
+ import { useLocale , useTranslations } from 'next-intl'
9
+ import { i18n } from '@/i18n'
10
10
11
11
const DownloadWebgalTerre = ( ) => {
12
12
@@ -28,20 +28,20 @@ const DownloadWebgalTerre = () => {
28
28
: null
29
29
30
30
const platformMap = [
31
- { platform : 'windows' , icon : < RiMicrosoftFill /> , label : t ( 'downloadWindows' ) } ,
32
- { platform : 'windowsSetup' , icon : < RiMicrosoftFill /> , label : t ( 'downloadWindowsSetup' ) } ,
33
- { platform : 'windowsArm64' , icon : < RiMicrosoftFill /> , label : t ( 'downloadWindowsArm64' ) } ,
34
- { platform : 'windowsArm64Setup' , icon : < RiMicrosoftFill /> , label : t ( 'downloadWindowsArm64Setup' ) } ,
35
- { platform : 'macos' , icon : < RiAppleFill /> , label : t ( 'downloadMacos' ) } ,
36
- { platform : 'linux' , icon : < RiUbuntuFill /> , label : t ( 'downloadLinux' ) } ,
37
- { platform : 'linuxArm64' , icon : < RiUbuntuFill /> , label : t ( 'downloadLinuxArm64' ) } ,
31
+ { platform : 'windows' , icon : < RiMicrosoftFill /> , label : t ( 'downloadWindows' ) } ,
32
+ { platform : 'windowsSetup' , icon : < RiMicrosoftFill /> , label : t ( 'downloadWindowsSetup' ) } ,
33
+ { platform : 'windowsArm64' , icon : < RiMicrosoftFill /> , label : t ( 'downloadWindowsArm64' ) } ,
34
+ { platform : 'windowsArm64Setup' , icon : < RiMicrosoftFill /> , label : t ( 'downloadWindowsArm64Setup' ) } ,
35
+ { platform : 'macos' , icon : < RiAppleFill /> , label : t ( 'downloadMacos' ) } ,
36
+ { platform : 'linux' , icon : < RiUbuntuFill /> , label : t ( 'downloadLinux' ) } ,
37
+ { platform : 'linuxArm64' , icon : < RiUbuntuFill /> , label : t ( 'downloadLinuxArm64' ) } ,
38
38
]
39
39
40
40
const downloadUrls = webgalTerreAssets ?. downloadUrl
41
41
. map ( ( item ) => {
42
42
const test = platformMap . find ( platform => item . platform === platform . platform )
43
43
if ( test )
44
- return { url : item . url , ...test }
44
+ return { url : item . url , ...test }
45
45
} )
46
46
47
47
const isZh = locale === 'zh-cn'
@@ -54,53 +54,56 @@ const DownloadWebgalTerre = () => {
54
54
{ /* <div className={styles.corner}>
55
55
<p className={`${styles['corner-text']} bg-terre`}>{t('recommend')}</p>
56
56
</div> */ }
57
- < p > < strong > { t ( 'version' ) } :</ strong > { webgalTerreAssets ?. version ? webgalTerreAssets ?. version : t ( 'fetching' ) } </ p >
58
- < p > < strong > { t ( 'releaseTime' ) } :</ strong > { webgalTerreAssets ?. releaseTime ? webgalTerreAssets ?. releaseTime . split ( 'T' ) [ 0 ] : t ( 'fetching' ) } </ p >
57
+ < p > < strong > { t ( 'version' ) } :</ strong > { webgalTerreAssets ?. version ? webgalTerreAssets ?. version : t ( 'fetching' ) }
58
+ </ p >
59
+ < p >
60
+ < strong > { t ( 'releaseTime' ) } :</ strong > { webgalTerreAssets ?. releaseTime ? webgalTerreAssets ?. releaseTime . split ( 'T' ) [ 0 ] : t ( 'fetching' ) }
61
+ </ p >
59
62
< div >
60
63
< p > < strong > { t ( 'releaseNote' ) } :</ strong > { ! ( releaseNote ) && t ( 'fetching' ) } </ p >
61
64
{
62
65
releaseNote &&
63
- < div dangerouslySetInnerHTML = { { __html : releaseNote } } className = { styles [ 'release-note' ] } />
66
+ < div dangerouslySetInnerHTML = { { __html : releaseNote } } className = { styles [ 'release-note' ] } />
64
67
}
65
68
</ div >
66
69
</ div >
67
70
< div className = { styles [ 'card-button-gourp' ] } >
68
71
< Button terre >
69
- < Link href = { webgalTerreUrl } target = { '_blank' } > < RiGithubFill /> { t ( 'gitHubReleases' ) } </ Link >
72
+ < Link href = { webgalTerreUrl } target = { '_blank' } > < RiGithubFill /> { t ( 'gitHubReleases' ) } </ Link >
70
73
</ Button >
71
74
{
72
75
downloadUrls &&
73
76
downloadUrls . map ( ( item ) =>
74
77
item ?. url &&
75
- < Button terre key = { item . platform } >
76
- < Link href = { item . url } target = '_top' > { item . icon } { item . label } </ Link >
77
- </ Button >
78
+ < Button terre key = { item . platform } >
79
+ < Link href = { item . url } target = '_top' > { item . icon } { item . label } </ Link >
80
+ </ Button >
78
81
)
79
82
}
80
83
81
84
</ div >
82
85
{
83
86
isZh && downloadUrls && < div className = { styles . cndownload } >
84
- < details className = 'space-y-4' >
85
- < summary className = 'cursor-pointer text-terre select-none' >
86
- { t ( 'otherDownloadLinkInfo' ) }
87
- </ summary >
88
- < div className = { styles [ 'card-button-gourp' ] } >
89
- {
90
- downloadUrls &&
91
- downloadUrls . map ( ( item ) =>
92
- item ?. url &&
93
- < Button terre key = { item . platform } >
94
- < Link href = { ghproxyStr + item . url } target = '_top' > { item . icon } { item . label } </ Link >
95
- </ Button >
96
- )
97
- }
98
- </ div >
99
- </ details >
100
- </ div >
87
+ { /* <details className='space-y-4'>*/ }
88
+ < div className = 'text-terre select-none' >
89
+ { t ( 'otherDownloadLinkInfo' ) }
90
+ </ div >
91
+ < div className = { styles [ 'card-button-gourp' ] } >
92
+ {
93
+ downloadUrls &&
94
+ downloadUrls . map ( ( item ) =>
95
+ item ?. url &&
96
+ < Button terre key = { item . platform } >
97
+ < Link href = { ghproxyStr + item . url } target = '_top' > { item . icon } { item . label } </ Link >
98
+ </ Button >
99
+ )
100
+ }
101
+ </ div >
102
+ { /* </details>*/ }
103
+ </ div >
101
104
}
102
105
</ div >
103
106
)
104
107
}
105
108
106
- export default DownloadWebgalTerre
109
+ export default DownloadWebgalTerre
0 commit comments