mirror of
https://github.com/woodchen-ink/clash-and-dashboard.git
synced 2025-07-18 14:01:56 +08:00
Chore: cleanup code
This commit is contained in:
parent
d193373419
commit
c9c0ecd37f
@ -17,8 +17,7 @@ export class Switch extends React.Component<SwitchProps, {}> {
|
||||
onChange: () => {}
|
||||
}
|
||||
|
||||
handleClick = (e: React.MouseEvent<HTMLElement>) => {
|
||||
e.stopPropagation()
|
||||
handleClick = () => {
|
||||
if (!this.props.disabled) {
|
||||
this.props.onChange(!this.props.checked)
|
||||
}
|
||||
|
@ -3,12 +3,11 @@ import { Route } from 'react-router-dom'
|
||||
import { I18nProps } from '@i18n'
|
||||
import './App.scss'
|
||||
|
||||
import Overview from '@views/Overview'
|
||||
import Proxies from '@views/Proxies'
|
||||
import Logs from '@views/Logs'
|
||||
import Rules from '@views/Rules'
|
||||
import Settings from '@views/Settings'
|
||||
|
||||
import Overview from '@containers/Overview'
|
||||
import Proxies from '@containers/Proxies'
|
||||
import Logs from '@containers/Logs'
|
||||
import Rules from '@containers/Rules'
|
||||
import Settings from '@containers/Settings'
|
||||
import SlideBar from '@containers/Sidebar'
|
||||
|
||||
export interface AppProps extends I18nProps {
|
@ -1,16 +1,19 @@
|
||||
import * as React from 'react'
|
||||
import { Header, Icon, Proxy } from '@components'
|
||||
import { ProxyType } from '@models'
|
||||
|
||||
import './style.scss'
|
||||
|
||||
export default class Proxies extends React.Component<{}, {}> {
|
||||
export class Proxies extends React.Component<{}, {}> {
|
||||
render () {
|
||||
const proxies: { type: ProxyType, name: string }[] = [
|
||||
{ type: ProxyType.Shadowsocks, name: 'shadowsocks' },
|
||||
{ type: ProxyType.Vmess, name: 'vmess' }
|
||||
]
|
||||
|
||||
return <div className="proxies-container">
|
||||
return (
|
||||
<div className="page">
|
||||
<div className="proxies-container">
|
||||
<Header title="代理" >
|
||||
<Icon type="plus" size={20} style={{ fontWeight: 'bold' }} />
|
||||
</Header>
|
||||
@ -26,5 +29,12 @@ export default class Proxies extends React.Component<{}, {}> {
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
<div className="proxies-container">
|
||||
<Header title="策略组" />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default Proxies
|
||||
|
@ -1,10 +0,0 @@
|
||||
import * as React from 'react'
|
||||
import { Header } from '@components'
|
||||
|
||||
export default class ProxyGroup extends React.Component<{}, {}> {
|
||||
render () {
|
||||
return <div className="container">
|
||||
<Header title="策略组" />
|
||||
</div>
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
@import '~@styles/variables';
|
@ -5,7 +5,7 @@ import { HashRouter } from 'react-router-dom'
|
||||
import { I18nextProvider } from 'react-i18next'
|
||||
import { AppContainer } from 'react-hot-loader'
|
||||
import { rootStores } from '@lib/createStore'
|
||||
import App from '@views/App'
|
||||
import App from '@containers/App'
|
||||
import i18n from '@i18n'
|
||||
|
||||
const rootEl = document.getElementById('root')
|
||||
@ -28,8 +28,8 @@ export default function renderApp () {
|
||||
)
|
||||
|
||||
if (module.hot) {
|
||||
module.hot.accept('./views/App', () => {
|
||||
const NewApp = require('./views/App').default
|
||||
module.hot.accept('./containers/App', () => {
|
||||
const NewApp = require('./containers/App').default
|
||||
render(
|
||||
<AppContainer>
|
||||
<Provider {...rootStores}>
|
||||
|
@ -1,14 +0,0 @@
|
||||
import * as React from 'react'
|
||||
|
||||
// containers
|
||||
import ProxiesContainer from '@containers/Proxies'
|
||||
import ProxyGroupContainer from '@containers/ProxyGroup'
|
||||
|
||||
const Proxies: React.SFC = () => (
|
||||
<div className="page">
|
||||
<ProxiesContainer />
|
||||
<ProxyGroupContainer />
|
||||
</div>
|
||||
)
|
||||
|
||||
export default Proxies
|
@ -19,8 +19,6 @@
|
||||
"@components/*": ["src/components/*"],
|
||||
"@containers": ["src/containers"],
|
||||
"@containers/*": ["src/containers/*"],
|
||||
"@views": ["src/views"],
|
||||
"@views/*": ["src/views/*"],
|
||||
"@i18n": ["src/i18n"],
|
||||
"@i18n/*": ["src/i18n/*"],
|
||||
"@stores": ["src/stores"],
|
||||
|
Loading…
x
Reference in New Issue
Block a user