mirror of
https://github.com/woodchen-ink/clash-and-dashboard.git
synced 2025-07-18 14:01:56 +08:00
Improve: compatible with ClashX
This commit is contained in:
parent
546cd9d161
commit
f750ec07f1
@ -5,7 +5,6 @@
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 120px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.slidebar-logo {
|
||||
|
@ -1,12 +1,14 @@
|
||||
import * as React from 'react'
|
||||
import { render } from 'react-dom'
|
||||
import { BrowserRouter } from 'react-router-dom'
|
||||
import { HashRouter, BrowserRouter } from 'react-router-dom'
|
||||
import { I18nextProvider } from 'react-i18next'
|
||||
import { AppContainer } from 'react-hot-loader'
|
||||
import { isClashX } from '@lib/jsBridge'
|
||||
import App from '@views/App'
|
||||
import i18n from '@i18n'
|
||||
|
||||
const rootEl = document.getElementById('root')
|
||||
const Router = isClashX() ? HashRouter : BrowserRouter
|
||||
|
||||
// Hot Module Replacement API
|
||||
declare let module: { hot: any }
|
||||
@ -14,11 +16,11 @@ declare let module: { hot: any }
|
||||
export default function renderApp () {
|
||||
render(
|
||||
<AppContainer>
|
||||
<BrowserRouter>
|
||||
<Router>
|
||||
<I18nextProvider i18n={ i18n }>
|
||||
<App />
|
||||
</I18nextProvider>
|
||||
</BrowserRouter>
|
||||
</Router>
|
||||
</AppContainer>,
|
||||
rootEl
|
||||
)
|
||||
@ -28,11 +30,11 @@ export default function renderApp () {
|
||||
const NewApp = require('./views/App').default
|
||||
render(
|
||||
<AppContainer>
|
||||
<BrowserRouter>
|
||||
<Router>
|
||||
<I18nextProvider i18n={ i18n }>
|
||||
<NewApp />
|
||||
</I18nextProvider>
|
||||
</BrowserRouter>
|
||||
</Router>
|
||||
</AppContainer>,
|
||||
rootEl
|
||||
)
|
||||
|
@ -3,6 +3,7 @@
|
||||
// styles initial
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
background: rgba($color: $color-white, $alpha: 0.9);
|
||||
}
|
||||
|
||||
*,
|
||||
|
@ -14,6 +14,7 @@ $color-primary-lightly: #b4ddf5;
|
||||
$color-gray: #d8dee2;
|
||||
$color-gray-dark: #b7c5d6;
|
||||
$color-gray-darken: #909399;
|
||||
$color-white: #fff;
|
||||
$color-green: #67c23a;
|
||||
$color-orange: #e6a23c;
|
||||
$color-red: #f56c6c;
|
||||
|
Loading…
x
Reference in New Issue
Block a user