diff --git a/package-lock.json b/package-lock.json index c3e7f13..20886b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2263,6 +2263,11 @@ } } }, + "classnames": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.6.tgz", + "integrity": "sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==" + }, "clean-css": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.1.tgz", diff --git a/package.json b/package.json index de2f088..596dc66 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "webpack-merge": "^4.1.4" }, "dependencies": { + "classnames": "^2.2.6", "i18next": "^11.9.0", "i18next-browser-languagedetector": "^2.2.3", "ini": "^1.3.5", diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx new file mode 100644 index 0000000..1432d9d --- /dev/null +++ b/src/components/Header/index.tsx @@ -0,0 +1,20 @@ +import * as React from 'react' +import { BaseComponentProps } from '@models/BaseProps' +import classnames from 'classnames' +import './style.scss' + +interface HeaderProps extends BaseComponentProps { + // header title + title: string +} + +export class Header extends React.Component { + render () { + const { title, children, className, style } = this.props + + return
+

{title}

+
{children}
+
+ } +} diff --git a/src/components/Header/style.scss b/src/components/Header/style.scss new file mode 100644 index 0000000..622a0da --- /dev/null +++ b/src/components/Header/style.scss @@ -0,0 +1,18 @@ +@import '~@styles/variables'; + +.header { + width: 100%; + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; + + > h1 { + flex-shrink: 0; + font-size: 30px; + color: $color-primary-dark; + font-weight: 500; + text-shadow: 0 2px 6px rgba($color: $color-primary-dark, $alpha: 0.4); + user-select: none; + } +} diff --git a/src/components/index.ts b/src/components/index.ts new file mode 100644 index 0000000..f887995 --- /dev/null +++ b/src/components/index.ts @@ -0,0 +1 @@ +export * from './Header' diff --git a/src/containers/Proxies/index.tsx b/src/containers/Proxies/index.tsx new file mode 100644 index 0000000..e46c88d --- /dev/null +++ b/src/containers/Proxies/index.tsx @@ -0,0 +1,12 @@ +import * as React from 'react' +import { Header } from '@components' + +export default class Proxies extends React.Component<{}, {}> { + render () { + return
+
+ +
+
+ } +} diff --git a/src/containers/Proxies/style.scss b/src/containers/Proxies/style.scss new file mode 100644 index 0000000..c764641 --- /dev/null +++ b/src/containers/Proxies/style.scss @@ -0,0 +1 @@ +@import '~@styles/variables'; diff --git a/src/containers/ProxyGroup/index.tsx b/src/containers/ProxyGroup/index.tsx new file mode 100644 index 0000000..13aa01a --- /dev/null +++ b/src/containers/ProxyGroup/index.tsx @@ -0,0 +1,10 @@ +import * as React from 'react' +import { Header } from '@components' + +export default class ProxyGroup extends React.Component<{}, {}> { + render () { + return
+
+
+ } +} diff --git a/src/containers/ProxyGroup/style.scss b/src/containers/ProxyGroup/style.scss new file mode 100644 index 0000000..c764641 --- /dev/null +++ b/src/containers/ProxyGroup/style.scss @@ -0,0 +1 @@ +@import '~@styles/variables'; diff --git a/src/containers/Sidebar/style.scss b/src/containers/Sidebar/style.scss index d9e236c..8e10ce1 100644 --- a/src/containers/Sidebar/style.scss +++ b/src/containers/Sidebar/style.scss @@ -4,6 +4,7 @@ display: flex; flex-direction: column; align-items: center; + flex-shrink: 0; width: 120px; } diff --git a/src/models/BaseProps.ts b/src/models/BaseProps.ts index 13cbaa1..1440187 100644 --- a/src/models/BaseProps.ts +++ b/src/models/BaseProps.ts @@ -1,3 +1,4 @@ +import { CSSProperties } from 'react' import { RouteComponentProps } from 'react-router' import { RouterStore, ConfigStore } from '@stores' @@ -10,8 +11,13 @@ export interface BaseRouterProps extends RouteComponentProps, BaseProps {} /** * use when component is inject by mobx */ -export interface BaseProps { +export interface BaseProps extends BaseComponentProps { styles?: any router?: RouterStore config?: ConfigStore } + +export interface BaseComponentProps { + className?: string + style?: CSSProperties +} diff --git a/src/styles/common.scss b/src/styles/common.scss index 9693e25..a1af578 100644 --- a/src/styles/common.scss +++ b/src/styles/common.scss @@ -24,3 +24,20 @@ body { min-height: 100vh; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; } + +.page-container { + width: 100%; +} + +.page { + padding: 10px 35px; + width: 100%; + max-width: 1200px; + margin: 0 auto; + display: flex; + flex-direction: column; +} + +.container { + margin: 20px 0; +} diff --git a/src/views/App.tsx b/src/views/App.tsx index c4e0326..4a55f72 100644 --- a/src/views/App.tsx +++ b/src/views/App.tsx @@ -27,7 +27,7 @@ export default class App extends React.Component { return (
-
+
{ routes.map( route => diff --git a/src/views/Proxies/index.tsx b/src/views/Proxies/index.tsx index ce68cce..6793a0f 100644 --- a/src/views/Proxies/index.tsx +++ b/src/views/Proxies/index.tsx @@ -1,7 +1,14 @@ import * as React from 'react' +// containers +import ProxiesContainer from '@containers/Proxies' +import ProxyGroupContainer from '@containers/ProxyGroup' + export default class Proxies extends React.Component<{}, {}> { render () { - return 'Proxies' + return
+ + +
} }