Explorar el Código

fixed header profil + fixed skeleton css display

Skylsmoi hace 7 años
padre
commit
c2e2764441

+ 4 - 3
src/component/Header/MenuActionListItem/MenuProfil.jsx Ver fichero

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

+ 32 - 33
src/container/Header.jsx Ver fichero

29
 
29
 
30
   handleClickHelp = () => {}
30
   handleClickHelp = () => {}
31
 
31
 
32
-  handleClickMyProfil = () => {}
33
   handleClickLogout = () => {}
32
   handleClickLogout = () => {}
34
 
33
 
35
   render () {
34
   render () {
36
     const { lang, user } = this.props
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
     return (
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 Ver fichero

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

+ 2 - 2
src/container/Tracim.jsx Ver fichero

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

+ 5 - 6
src/css/Generic.styl Ver fichero

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

+ 0 - 1
src/css/Sidebar.styl Ver fichero

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

+ 1 - 1
src/css/index.styl Ver fichero

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