From 5ec15e86636bf0b81e9db403084c0dd5886043ee Mon Sep 17 00:00:00 2001 From: "yhui.yang" Date: Fri, 14 Jul 2017 19:20:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=EF=BC=8C=E5=B0=86=E7=99=BB=E5=BD=95=E6=B3=A8=E5=86=8C=E7=A7=BB?= =?UTF-8?q?=E8=87=B3=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Header/Header.js | 27 ++++--------- client/components/Header/Header.scss | 12 +++++- client/containers/Home/Home.js | 14 +++++-- client/containers/Home/Home.scss | 57 ++++++++++------------------ client/containers/Login/Login.scss | 7 ---- client/containers/Login/login.scss | 1 - client/routes.js | 5 ++- 7 files changed, 53 insertions(+), 70 deletions(-) delete mode 100644 client/containers/Login/Login.scss diff --git a/client/components/Header/Header.js b/client/components/Header/Header.js index 47c6e67a..65115741 100644 --- a/client/components/Header/Header.js +++ b/client/components/Header/Header.js @@ -32,49 +32,36 @@ ToolGuest.propTypes={ class Header extends Component { constructor(props) { super(props); - this.state={ - guestToolShow:true - } } handleLogin = (e) => { e.preventDefault(); this.props.loginTypeAction("1"); - this.setState({ - guestToolShow:false - }) } handleReg = (e)=>{ e.preventDefault(); this.props.loginTypeAction("2"); - this.setState({ - guestToolShow:false - }) - } - hideGuestTool = (e)=>{ - e.preventDefault(); - this.setState({ - guestToolShow:true - }) } render () { const { login, user, msg } = this.props; return (
-

YAPI

+

+ YAPI +

    - {login?:(this.state.guestToolShow?:'')} + {login?:''}
diff --git a/client/components/Header/Header.scss b/client/components/Header/Header.scss index 34a45b48..15516504 100644 --- a/client/components/Header/Header.scss +++ b/client/components/Header/Header.scss @@ -21,8 +21,18 @@ $color-grey-deep : #929aac; h1 { font-size: .25rem; float: left; - margin: 0 .2rem; + margin: 0 .2rem 0 0; color: $color-white; + cursor: pointer; + a{ + color: $color-white; + &:hover { + color: $color-white; + } + &:focus{ + text-decoration: none; + } + } } .nav-toolbar { diff --git a/client/containers/Home/Home.js b/client/containers/Home/Home.js index 2553cb3e..15593afc 100644 --- a/client/containers/Home/Home.js +++ b/client/containers/Home/Home.js @@ -1,5 +1,7 @@ import './Home.scss' import React, { Component } from 'react' +import Login from '../Login/login-wrap' + class Home extends Component { constructor(props) { @@ -8,9 +10,15 @@ class Home extends Component { render () { return ( - - 主页 - +
+
+
+

YAPI

+
一个高效,易用,功能强大的api管理系统
+
+ +
+
) } } diff --git a/client/containers/Home/Home.scss b/client/containers/Home/Home.scss index f8d45caa..09f71974 100644 --- a/client/containers/Home/Home.scss +++ b/client/containers/Home/Home.scss @@ -1,42 +1,27 @@ @import '../../styles/common.scss'; /* .home-main.css */ -// .home-main { -// display: -webkit-box; -// -webkit-box-orient: vertical; -// height: 100%; -// } +.home-main { + display: -webkit-box; + max-width: 11rem; + margin: 0 auto; + -webkit-box-orient: vertical; + .main-one{ + height:calc(100% - .64rem); + padding: .5rem 0; + .home-des{ + padding: .3rem 0; + .title{ + font-size: .6rem; + } + .detail{ + font-size: .23rem; + } + } + .login-form{ -// /* .home-box.css */ -// .home-box { -// font-size: 0.14rem; -// display: -webkit-box; -// -webkit-box-align: center; -// -webkit-box-pack: center; -// -webkit-box-flex: 1; + } + } -// .content { -// max-width: 5rem; -// min-width: 3rem; -// zoom: 1; -// overflow: hidden; -// margin: -70px 0 0 0; -// } +} -// h3 { -// font-size: 0.2rem; -// } - -// a { -// font-size: 0.14rem; -// } - -// .ant-input-affix-wrapper { -// margin: 0 0 20px 0; -// height: 35px; -// } - -// .login { -// float: right; -// } -// } diff --git a/client/containers/Login/Login.scss b/client/containers/Login/Login.scss deleted file mode 100644 index 23812370..00000000 --- a/client/containers/Login/Login.scss +++ /dev/null @@ -1,7 +0,0 @@ -@import '../../styles/common.scss'; - -/* .login-main.css */ -.login-form { - width: 4rem; - margin: 1rem auto; -} diff --git a/client/containers/Login/login.scss b/client/containers/Login/login.scss index 23812370..d41d1bdc 100644 --- a/client/containers/Login/login.scss +++ b/client/containers/Login/login.scss @@ -3,5 +3,4 @@ /* .login-main.css */ .login-form { width: 4rem; - margin: 1rem auto; } diff --git a/client/routes.js b/client/routes.js index 1990215d..552e9a9b 100644 --- a/client/routes.js +++ b/client/routes.js @@ -1,13 +1,14 @@ import React from 'react' import { Route, HashRouter } from 'react-router-dom' -import { Home, Login, ProjectGroups, Interface } from './containers/index' +import { Home, ProjectGroups, Interface } from './containers/index' +import Header from './components/Header/Header' export default () => { return (
+
-