diff --git a/src/components/Header/style.scss b/src/components/Header/style.scss index 02ec140..1dfa24b 100644 --- a/src/components/Header/style.scss +++ b/src/components/Header/style.scss @@ -14,5 +14,6 @@ font-weight: 500; text-shadow: 0 2px 6px rgba($color: $color-primary-dark, $alpha: 0.4); user-select: none; + line-height: 32px; } } diff --git a/src/containers/Settings/index.tsx b/src/containers/Settings/index.tsx index 7082c20..0e3ed53 100644 --- a/src/containers/Settings/index.tsx +++ b/src/containers/Settings/index.tsx @@ -1,6 +1,7 @@ import * as React from 'react' -import { Header, Card, Row, Col, Switch, ButtonSelect, ButtonSelectOptions, Input } from '@components' +import { Header, Card, Row, Col, Switch, ButtonSelect, ButtonSelectOptions, Input, Icon } from '@components' import { translate } from 'react-i18next' +import { changeLanguage } from 'i18next' import { I18nProps } from '@i18n' import './style.scss' @@ -8,10 +9,9 @@ class Settings extends React.Component { state = { startAtLogin: false, - language: 'en', setAsSystemProxy: true, allowConnectFromLan: true, - proxyMode: 'rule', + proxyMode: 'Rule', socks5ProxyPort: 7891, httpProxyPort: 7890, externalController: '127.0.0.1:7892' @@ -22,17 +22,14 @@ class Settings extends React.Component { { label: 'English', value: 'en' } ] - proxyModeOptions: ButtonSelectOptions[] = [ - { label: '全局', value: 'global' }, - { label: '规则', value: 'rule' }, - { label: '直连', value: 'none' } - ] + changeLanguage = (language: string) => { + changeLanguage(language) + } render () { - const { t } = this.props + const { t, lng } = this.props const { startAtLogin, - language, setAsSystemProxy, allowConnectFromLan, proxyMode, @@ -40,6 +37,11 @@ class Settings extends React.Component { httpProxyPort, externalController } = this.state + const proxyModeOptions: ButtonSelectOptions[] = [ + { label: t('values.global'), value: 'Global' }, + { label: t('values.rules'), value: 'Rule' }, + { label: t('values.direct'), value: 'Direct' } + ] return (
@@ -61,8 +63,8 @@ class Settings extends React.Component { this.setState({ language })} + value={lng} + onSelect={this.changeLanguage} /> @@ -87,6 +89,7 @@ class Settings extends React.Component { + @@ -94,7 +97,7 @@ class Settings extends React.Component { this.setState({ proxyMode })} /> @@ -107,20 +110,28 @@ class Settings extends React.Component { - + {t('labels.httpProxyPort')} - + this.setState({ httpProxyPort })}> - + {t('labels.externalController')} - + + + + + + +

{t('versionString', { version: 'unknown' })}

+ {t('checkUpdate')} +
) } diff --git a/src/containers/Settings/style.scss b/src/containers/Settings/style.scss index ac13277..cac555a 100644 --- a/src/containers/Settings/style.scss +++ b/src/containers/Settings/style.scss @@ -5,6 +5,7 @@ padding: 20px 0; .column { + font-weight: bold; align-items: center; } @@ -17,3 +18,47 @@ color: $color-primary-darken; } } + +.clash-version { + position: relative; + margin-top: 25px; + padding: 20px 45px; + display: flex; + + .check-icon { + width: 24px; + height: 24px; + border-radius: 50%; + background: linear-gradient(135deg, $color-primary, $color-primary-dark); + display: flex; + justify-content: center; + align-items: center; + + > i { + transform: scale(0.5); + color: #fff; + font-weight: bold; + } + } + + .version-info { + margin-left: 10px; + font-size: 14px; + line-height: 24px; + color: $color-primary-darken; + } + + .check-update-btn { + position: absolute; + right: 45px; + font-size: 14px; + line-height: 24px; + color: $color-gray-dark; + cursor: pointer; + transition: all 150ms ease; + + &:hover { + color: $color-primary-darken; + } + } +} diff --git a/src/containers/Sidebar/style.scss b/src/containers/Sidebar/style.scss index 02d6b40..6e2ae0f 100644 --- a/src/containers/Sidebar/style.scss +++ b/src/containers/Sidebar/style.scss @@ -41,7 +41,7 @@ } > a.active { - background: linear-gradient(to right, $color-primary, $color-primary-dark); + background: linear-gradient(135deg, $color-primary, $color-primary-dark); color: #fff; box-shadow: 0 2px 8px rgba($color: $color-primary-dark, $alpha: 0.5); } diff --git a/src/i18n/index.ts b/src/i18n/index.ts index d9531ab..cd9c229 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -25,7 +25,8 @@ const options = { } export interface I18nProps { - t? (key: string): string + t? (key: string, variables?: { [key: string]: any }): string + lng?: string } export default i18n.use(LanguageDetector).init(options)