File tree 3 files changed +25
-9
lines changed
3 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -2,17 +2,21 @@ import { Spin } from 'antd';
2
2
import { useLocale } from 'dumi' ;
3
3
import { useEffect } from 'react' ;
4
4
5
- export const Redirect = ( { url } : { url : string } ) => {
5
+ export const Redirect = ( { url, target , text } : { url : string ; target ?: string ; text ?: string ; } ) => {
6
6
const { id : lang } = useLocale ( ) ;
7
+ const loading = target !== '_blank' ;
7
8
8
9
useEffect ( ( ) => {
9
- window . location . replace ( url ) ;
10
+ if ( target === '_blank' ) {
11
+ window . open ( url ) ;
12
+ }
13
+ else window . location . replace ( url ) ;
10
14
} , [ ] ) ;
11
15
12
16
return (
13
17
< div style = { { display : 'flex' , justifyContent : 'center' , gap : 15 } } >
14
- < Spin />
15
- { lang === 'zh-CN' ? '跳转中...' : 'Redirecting...' }
18
+ < Spin spinning = { loading } />
19
+ { text ? text : lang === 'zh-CN' ? '跳转中...' : 'Redirecting...' }
16
20
</ div >
17
21
) ;
18
22
} ;
Original file line number Diff line number Diff line change 4
4
* order: 2
5
5
*/
6
6
7
- import { Redirect } from '../components/Redirect ' ;
7
+ import Guide from './guide ' ;
8
8
9
- export default ( ) => {
10
- return < Redirect url = "https://openspg.yuque.com/ndx6g9/ns5nw2" /> ;
11
- } ;
9
+ export default Guide ;
Original file line number Diff line number Diff line change 4
4
* order: 2
5
5
*/
6
6
import { Redirect } from '../components/Redirect' ;
7
+ import { Button , Typography , Flex } from 'antd' ;
8
+ import { useLocale } from 'dumi' ;
9
+
10
+ const { Title } = Typography ;
7
11
8
12
export default ( ) => {
9
- return < Redirect url = "https://openspg.yuque.com/ndx6g9/ooil9x" /> ;
13
+ const { id : locale } = useLocale ( ) ;
14
+ const intl = ( zh : string , en : string ) => ( locale === 'zh-CN' ? zh : en ) ;
15
+
16
+ return < div >
17
+ < Title level = { 4 } > { intl ( '版本' , 'Version' ) } </ Title >
18
+ < Redirect url = { intl ( 'https://openspg.yuque.com/ndx6g9/nmwkzz' , 'https://openspg.yuque.com/ndx6g9/ps5q6b' ) } target = '_blank' text = " " />
19
+ < Flex vertical align = { 'flex-start' } >
20
+ < Button type = "link" target = "_blank" href = { intl ( 'https://openspg.yuque.com/ndx6g9/ooil9x' , 'https://openspg.yuque.com/ndx6g9/ns5nw2' ) } > 0.0.2</ Button >
21
+ < Button type = "link" target = "_blank" href = { intl ( 'https://openspg.yuque.com/ndx6g9/nmwkzz' , 'https://openspg.yuque.com/ndx6g9/ps5q6b' ) } > 0.0.3</ Button >
22
+ </ Flex >
23
+ </ div > ;
10
24
} ;
You can’t perform that action at this time.
0 commit comments