1
1
import { useState } from 'react' ;
2
2
import './App.css' ;
3
3
import { Layout , Button , Row , Col , notification , Empty } from 'antd' ;
4
- import { GithubOutlined } from '@ant-design/icons'
4
+ import { GithubOutlined , SettingOutlined } from '@ant-design/icons'
5
5
import BotCard from './components/BotCard'
6
6
import QRCodeLogin from './components/QRCodeLogin'
7
7
import PasswordLogin from './components/PasswordLogin'
8
+ import PluginSetting from "./components/PluginSetting" ;
8
9
import { useInterval } from './utils/interval'
9
10
import { service } from './api/RpcImpl'
10
11
import { dto } from './api/gen/proto' ;
@@ -13,6 +14,7 @@ const { Header, Content } = Layout;
13
14
const App = ( ) => {
14
15
const [ showQRCodeLogin , setShowQRCodeLogin ] = useState < boolean > ( false ) ;
15
16
const [ showPasswordLogin , setShowPasswordLogin ] = useState < boolean > ( false ) ;
17
+ const [ showSetting , setShowSetting ] = useState < boolean > ( false ) ;
16
18
17
19
const [ listBotResp , setListBotResp ] = useState < dto . IListBotResp > ( { } ) ;
18
20
useInterval ( async ( ) => {
@@ -36,12 +38,12 @@ const App = () => {
36
38
< Content >
37
39
< div >
38
40
< Button style = { { margin : "20px 8px" } } type = "primary" onClick = { ( ) => setShowQRCodeLogin ( true ) } > 扫码创建</ Button >
39
- < QRCodeLogin isVisible = { showQRCodeLogin } onClose = { ( ) => { setShowQRCodeLogin ( false ) } } > </ QRCodeLogin >
41
+ < QRCodeLogin isVisible = { showQRCodeLogin } onClose = { ( ) => { setShowQRCodeLogin ( false ) } } / >
40
42
< Button style = { { margin : "20px 8px" } } type = "primary" onClick = { ( ) => setShowPasswordLogin ( true ) } > 密码创建</ Button >
41
- < PasswordLogin isVisible = { showPasswordLogin } onClose = { ( ) => { setShowPasswordLogin ( false ) } } > </ PasswordLogin >
42
- < Button style = { { margin : "20px 8px" } } icon = { < GithubOutlined /> } href = "https://github.com/ProtobufBot/ProtobufBot" target = "_blank" >
43
- GitHub
44
- </ Button >
43
+ < PasswordLogin isVisible = { showPasswordLogin } onClose = { ( ) => { setShowPasswordLogin ( false ) } } / >
44
+ < Button style = { { margin : "20px 8px" } } shape = "circle" icon = { < SettingOutlined /> } onClick = { ( ) => setShowSetting ( true ) } / >
45
+ < PluginSetting isVisible = { showSetting } onClose = { ( ) => { setShowSetting ( false ) } } />
46
+ < Button style = { { margin : "20px 8px" } } shape = "circle" icon = { < GithubOutlined /> } href = "https://github.com/ProtobufBot/ProtobufBot" target = "_blank" / >
45
47
</ div >
46
48
{ ! ! listBotResp && ! ! listBotResp . botList ?
47
49
< Row gutter = { { xs : 8 , sm : 16 , md : 24 , lg : 32 } } style = { { margin : '20px' } } >
0 commit comments