Przeglądaj źródła

fixed header profil + fixed skeleton css display

Skylsmoi 6 lat temu
rodzic
commit
c2e2764441

+ 4 - 3
src/component/Header/MenuActionListItem/MenuProfil.jsx Wyświetl plik

@@ -1,8 +1,10 @@
1 1
 import React from 'react'
2
+import { Link } from 'react-router-dom'
2 3
 import PropTypes from 'prop-types'
4
+import { PAGE_NAME } from '../../../helper.js'
3 5
 
4 6
 const MenuProfil = props => {
5
-  return props.user.isLoggedin
7
+  return props.user.isLoggedIn
6 8
     ? (
7 9
       <li className='header__menu__rightside__itemprofil'>
8 10
         <div className='header__menu__rightside__itemprofil__profilgroup dropdown'>
@@ -13,7 +15,7 @@ const MenuProfil = props => {
13 15
             </div>
14 16
           </button>
15 17
           <div className='profilgroup__setting dropdown-menu' aria-labelledby='dropdownMenuButton'>
16
-            <div className='setting__link dropdown-item' onClick={props.onClickMyProfil}>Mon compte</div>
18
+            <Link className='setting__link dropdown-item' to={PAGE_NAME.ACCOUNT}>Mon compte</Link>
17 19
             {/* <div className='setting__link dropdown-item'>Mot de passe</div> */}
18 20
             <div className='setting__link dropdown-item' onClick={props.onClickLogout}>Se déconnecter</div>
19 21
           </div>
@@ -26,6 +28,5 @@ export default MenuProfil
26 28
 
27 29
 MenuProfil.propTypes = {
28 30
   user: PropTypes.object.isRequired,
29
-  onClickMyProfil: PropTypes.func.isRequired,
30 31
   onClickLogout: PropTypes.func.isRequired
31 32
 }

+ 32 - 33
src/container/Header.jsx Wyświetl plik

@@ -29,47 +29,46 @@ class Header extends React.Component {
29 29
 
30 30
   handleClickHelp = () => {}
31 31
 
32
-  handleClickMyProfil = () => {}
33 32
   handleClickLogout = () => {}
34 33
 
35 34
   render () {
36 35
     const { lang, user } = this.props
37 36
 
38
-    const HeaderWrapper = props => <header><nav className='header navbar navbar-expand-md navbar-light bg-light'>{props.children}</nav></header>
39
-    const HeaderMenuRightWrapper = props => <div className='header__menu collapse navbar-collapse justify-content-end' id='navbarSupportedContent'>{props.children}</div>
40
-    const MenuActionListWrapper = props => <ul className='header__menu__rightside'>{ props.children }</ul>
41
-
42 37
     return (
43
-      <HeaderWrapper>
44
-        <Logo logoSrc={logoHeader} onClickImg={this.handleClickLogo} />
45
-        <NavbarToggler />
38
+      <header>
39
+        <nav className='header navbar navbar-expand-md navbar-light bg-light'>
40
+          <Logo logoSrc={logoHeader} onClickImg={this.handleClickLogo} />
46 41
 
47
-        <HeaderMenuRightWrapper>
48
-          <MenuLinkList
49
-            onClickFeature={this.handleClickFeature}
50
-            onClickExplore={this.handleClickExplore}
51
-            onClickAbout={this.handleClickAbout}
52
-          />
53
-          <MenuActionListWrapper>
54
-            <MenuActionListItemSearch
55
-              onChangeInput={this.handleChangeInput}
56
-              onClickSubmit={this.handleClickSubmit}
57
-            />
58
-            <MenuActionListItemDropdownLang
59
-              langList={lang}
60
-              onChangeLang={this.handleChangeLang}
61
-            />
62
-            <MenuActionListItemHelp
63
-              onClickHelp={this.handleClickHelp}
64
-            />
65
-            <MenuActionListItemMenuProfil
66
-              user={user}
67
-              onClickMyProfil={this.handleClickMyProfil}
68
-              onClickLogout={this.handleClickLogout}
42
+          <NavbarToggler />
43
+
44
+          <div className='header__menu collapse navbar-collapse justify-content-end' id='navbarSupportedContent'>
45
+            <MenuLinkList
46
+              onClickFeature={this.handleClickFeature}
47
+              onClickExplore={this.handleClickExplore}
48
+              onClickAbout={this.handleClickAbout}
69 49
             />
70
-          </MenuActionListWrapper>
71
-        </HeaderMenuRightWrapper>
72
-      </HeaderWrapper>
50
+
51
+            <ul className='header__menu__rightside'>
52
+              <MenuActionListItemSearch
53
+                onChangeInput={this.handleChangeInput}
54
+                onClickSubmit={this.handleClickSubmit}
55
+              />
56
+              <MenuActionListItemDropdownLang
57
+                langList={lang}
58
+                onChangeLang={this.handleChangeLang}
59
+              />
60
+              <MenuActionListItemHelp
61
+                onClickHelp={this.handleClickHelp}
62
+              />
63
+              <MenuActionListItemMenuProfil
64
+                user={user}
65
+                onClickLogout={this.handleClickLogout}
66
+              />
67
+            </ul>
68
+
69
+          </div>
70
+        </nav>
71
+      </header>
73 72
     )
74 73
   }
75 74
 }

+ 1 - 1
src/container/Sidebar.jsx Wyświetl plik

@@ -35,7 +35,7 @@ class Sidebar extends React.Component {
35 35
     const { workspaceList, t } = this.props
36 36
 
37 37
     return (
38
-      <div className='sidebar d-none d-lg-table-cell'>
38
+      <div className='sidebar d-none d-lg-block'>
39 39
         <nav className='sidebar__navigation'>
40 40
           <ul className='sidebar__navigation__workspace'>
41 41
             { workspaceList.map((ws, i) =>

+ 2 - 2
src/container/Tracim.jsx Wyświetl plik

@@ -38,13 +38,13 @@ class Tracim extends React.Component {
38 38
       : props.children
39 39
 
40 40
     return (
41
-      <div>
41
+      <div className='tracim'>
42 42
         <Header />
43 43
 
44 44
         { user.isLoggedIn === undefined
45 45
           ? (<div />) // while we dont know if user is connected, display nothing but the header @TODO show loader
46 46
           : (
47
-            <div>
47
+            <div className='tracim__content'>
48 48
               <Route path={PAGE_NAME.LOGIN} component={Login} />
49 49
 
50 50
               <SidebarWrapper locationPath={location.pathname}>

+ 5 - 6
src/css/Generic.styl Wyświetl plik

@@ -1,13 +1,12 @@
1
-/*** SIDEBAR ***/
1
+.tracim
2
+  height 100%
3
+  &__content
4
+    height 100%
2 5
 
3 6
 .sidebarpagecontainer
4 7
   display flex
8
+  padding-top 88px
5 9
   min-height calc(100% - 50px)
6
-  padding-top 85px
7
-
8
-/********************/
9
-
10
-/*** ELEMENTS ON ALL PAGE ***/
11 10
 
12 11
 .pageWrapperGeneric
13 12
   width 100%

+ 0 - 1
src/css/Sidebar.styl Wyświetl plik

@@ -15,7 +15,6 @@
15 15
       color white
16 16
 
17 17
 .sidebar
18
-  display none
19 18
   min-height 100%
20 19
   background-color secondColor
21 20
   z-index 1

+ 1 - 1
src/css/index.styl Wyświetl plik

@@ -1,6 +1,6 @@
1 1
 body
2 2
   font-family 'Quicksand', sans-serif
3
-html, body, #content, #content > div
3
+html, body, #content
4 4
   height 100%
5 5
 
6 6
 @import 'Variable.styl' // Côme - this comes from node_modules/tracim_lib