Browse Source

Merge pull request #15 from tracim/fix-sidebar

Skylsmoi 6 years ago
parent
commit
251d0699f6
No account linked to committer's email

+ 8 - 8
frontend/src/component/Sidebar/WorkspaceListItem.jsx View File

@@ -7,27 +7,27 @@ import { Link } from 'react-router-dom'
7 7
 
8 8
 const WorkspaceListItem = props => {
9 9
   return (
10
-    <li className='sidebar__navigation__workspace__item'>
10
+    <li className='sidebar__content__navigation__workspace__item'>
11 11
       <div
12
-        className='sidebar__navigation__workspace__item__wrapper primaryColorBg primaryColorBgDarkenHover primaryColorBorder'
12
+        className='sidebar__content__navigation__workspace__item__wrapper primaryColorBg primaryColorBgDarkenHover primaryColorBorder'
13 13
         onClick={props.onClickTitle}
14 14
       >
15
-        <div className='sidebar__navigation__workspace__item__number'>
15
+        <div className='sidebar__content__navigation__workspace__item__number'>
16 16
           {props.label.substring(0, 2).toUpperCase()}
17 17
         </div>
18 18
 
19
-        <div className='sidebar__navigation__workspace__item__name' title={props.label}>
19
+        <div className='sidebar__content__navigation__workspace__item__name' title={props.label}>
20 20
           {props.label}
21 21
         </div>
22 22
 
23
-        <div className='sidebar__navigation__workspace__item__icon'>
23
+        <div className='sidebar__content__navigation__workspace__item__icon'>
24 24
           <i className={classnames(props.isOpenInSidebar ? 'fa fa-chevron-up' : 'fa fa-chevron-down')} />
25 25
         </div>
26 26
       </div>
27 27
 
28 28
       <AnimateHeight duration={500} height={props.isOpenInSidebar ? 'auto' : 0}>
29 29
         <ul
30
-          className='sidebar__navigation__workspace__item__submenu'
30
+          className='sidebar__content__navigation__workspace__item__submenu'
31 31
           id={`sidebarSubMenu_${props.number}`}
32 32
         >
33 33
           { props.allowedApp.map(aa =>
@@ -37,14 +37,14 @@ const WorkspaceListItem = props => {
37 37
             >
38 38
               <Link to={aa.route}>
39 39
                 <div className={classnames(
40
-                  'sidebar__navigation__workspace__item__submenu__dropdown primaryColorBgLighten primaryColorBgHover primaryColorBorderDarken',
40
+                  'sidebar__content__navigation__workspace__item__submenu__dropdown primaryColorBgLighten primaryColorBgHover primaryColorBorderDarken',
41 41
                   {'activeFilter': props.activeFilterList.includes(aa.slug)}
42 42
                 )}>
43 43
                   <div className='dropdown__icon'>
44 44
                     <i className={classnames(`fa fa-${aa.faIcon}`)} style={{backgroudColor: aa.hexcolor}} />
45 45
                   </div>
46 46
 
47
-                  <div className='sidebar__navigation__workspace__item__submenu__dropdown__showdropdown'>
47
+                  <div className='sidebar__content__navigation__workspace__item__submenu__dropdown__showdropdown'>
48 48
                     <div className='dropdown__title' id='navbarDropdown'>
49 49
                       <div className='dropdown__title__text'>
50 50
                         {aa.label/* [props.lang.id] */}

+ 37 - 39
frontend/src/container/Sidebar.jsx View File

@@ -106,49 +106,47 @@ class Sidebar extends React.Component {
106 106
 
107 107
     return (
108 108
       <div className={classnames('sidebar primaryColorBgDarken', {'sidebarclose': sidebarClose})}>
109
-        <div className='sidebarSticky'>
110
-          <div className='sidebar__expand primaryColorBg' onClick={this.handleClickToggleSidebar}>
111
-            <i className={classnames('fa fa-chevron-left', {'fa-chevron-right': sidebarClose, 'fa-chevron-left': !sidebarClose})} />
112
-          </div>
113 109
 
114
-          <div className='sidebar__wrapper'>
115
-
116
-            <nav className='sidebar__navigation'>
117
-              <ul className='sidebar__navigation__workspace'>
118
-                { workspaceList.map(ws =>
119
-                  <WorkspaceListItem
120
-                    idWs={ws.id}
121
-                    label={ws.label}
122
-                    allowedApp={ws.sidebarEntry}
123
-                    lang={activeLang}
124
-                    activeFilterList={ws.id === workspaceIdInUrl ? [qs.parse(this.props.location.search).type] : []}
125
-                    isOpenInSidebar={ws.isOpenInSidebar}
126
-                    onClickTitle={() => this.handleClickWorkspace(ws.id, !ws.isOpenInSidebar)}
127
-                    onClickAllContent={this.handleClickAllContent}
128
-                    // onClickContentFilter={this.handleClickContentFilter}
129
-                    key={ws.id}
130
-                  />
131
-                )}
132
-              </ul>
133
-            </nav>
134
-
135
-            <div className='sidebar__btnnewworkspace'>
136
-              <button
137
-                className='sidebar__btnnewworkspace__btn btn btn-primary primaryColorBg primaryColorBorder primaryColorBorderDarkenHover mb-5'
138
-                onClick={this.handleClickNewWorkspace}
139
-              >
140
-                {t('Create a workspace')}
141
-              </button>
142
-            </div>
110
+        <div className='sidebar__expand primaryColorBg' onClick={this.handleClickToggleSidebar}>
111
+          <i className={classnames('fa fa-chevron-left', {'fa-chevron-right': sidebarClose, 'fa-chevron-left': !sidebarClose})} />
112
+        </div>
143 113
 
114
+        <div className='sidebar__content'>
115
+          <nav className={classnames('sidebar__content__navigation', {'sidebarclose': sidebarClose})}>
116
+            <ul className='sidebar__content__navigation__workspace'>
117
+              { workspaceList.map(ws =>
118
+                <WorkspaceListItem
119
+                  idWs={ws.id}
120
+                  label={ws.label}
121
+                  allowedApp={ws.sidebarEntry}
122
+                  lang={activeLang}
123
+                  activeFilterList={ws.id === workspaceIdInUrl ? [qs.parse(this.props.location.search).type] : []}
124
+                  isOpenInSidebar={ws.isOpenInSidebar}
125
+                  onClickTitle={() => this.handleClickWorkspace(ws.id, !ws.isOpenInSidebar)}
126
+                  onClickAllContent={this.handleClickAllContent}
127
+                  // onClickContentFilter={this.handleClickContentFilter}
128
+                  key={ws.id}
129
+                />
130
+              )}
131
+            </ul>
132
+          </nav>
133
+
134
+          <div className='sidebar__content__btnnewworkspace'>
135
+            <button
136
+              className='sidebar__content__btnnewworkspace__btn btn btn-primary primaryColorBg primaryColorBorder primaryColorBorderDarkenHover mb-5'
137
+              onClick={this.handleClickNewWorkspace}
138
+            >
139
+              {t('Create a workspace')}
140
+            </button>
144 141
           </div>
145 142
 
146
-          <div className='sidebar__footer mb-2'>
147
-            <div className='sidebar__footer__text whiteFontColor d-flex align-items-end justify-content-center'>
148
-              Copyright - 2013 - 2018
149
-              <div className='sidebar__footer__text__link'>
150
-                <a href='http://www.tracim.fr/' target='_blank' className='ml-3'>tracim.fr</a>
151
-              </div>
143
+        </div>
144
+
145
+        <div className='sidebar__footer mb-2'>
146
+          <div className='sidebar__footer__text whiteFontColor d-flex align-items-end justify-content-center'>
147
+            Copyright - 2013 - 2018
148
+            <div className='sidebar__footer__text__link'>
149
+              <a href='http://www.tracim.fr/' target='_blank' className='ml-3'>tracim.fr</a>
152 150
             </div>
153 151
           </div>
154 152
         </div>

+ 94 - 74
frontend/src/css/Sidebar.styl View File

@@ -1,4 +1,4 @@
1
-sidebar-width = 280px
1
+sidebar-width = 300px
2 2
 sidebar-animate-speed = 0.5s
3 3
 
4 4
 .sidebarSticky
@@ -15,6 +15,9 @@ leftside()
15 15
   background-color rgba(253, 253, 253, 0.3)
16 16
 
17 17
 .sidebar
18
+  display flex
19
+  flex-direction column
20
+  justify-content space-between
18 21
   position relative
19 22
   transition all sidebar-animate-speed
20 23
   width sidebar-width
@@ -26,8 +29,7 @@ leftside()
26 29
     width 0
27 30
   &__expand
28 31
     position absolute
29
-    top 0
30
-    right -43px
32
+    right -42px
31 33
     display flex
32 34
     justify-content center
33 35
     align-items center
@@ -38,73 +40,83 @@ leftside()
38 40
     cursor pointer
39 41
     color white
40 42
     transition all sidebar-animate-speed
41
-  &__btnnewworkspace
42
-    margin 50px 0
43
-    overflow hidden
44
-    &__btn
45
-      display block
46
-      margin 0 auto
47
-      padding 15px 30px
48
-  &__navigation
49
-    padding 0
50
-    overflow hidden
51
-    &__workspace
52
-      padding-left 0
53
-      list-style none
54
-      &__item
55
-        &__wrapper
56
-          display flex
57
-          align-items center
58
-          border-bottom 1px solid
59
-          width 100%
60
-          height 100%
61
-          cursor pointer
62
-        &__number
63
-          display flex
64
-          leftside()
65
-          padding 12px
66
-          width 50px
67
-          letter-spacing 2px
68
-        &__name
69
-          padding 10px
70
-          font-size 20px
71
-          color off-white
72
-          white-space nowrap
73
-          overflow hidden
74
-          text-overflow ellipsis
75
-        &__icon
76
-          margin 0 10px 0 auto
77
-          color white
78
-        &__submenu
79
-          margin 0
80
-          padding 0
81
-          width 100%
82
-          overflow hidden
83
-          & > li
84
-            display block
85
-          &__dropdown
43
+  &__content
44
+    height 100%
45
+    &__btnnewworkspace
46
+      margin 50px 0
47
+      overflow hidden
48
+      &__btn
49
+        display block
50
+        margin 0 auto
51
+        padding 15px 30px
52
+    &__navigation
53
+      padding 0
54
+      width sidebar-width
55
+      transition all sidebar-animate-speed
56
+      overflow hidden
57
+      &.sidebarclose
58
+        width 0
59
+      &__workspace
60
+        padding-left 0
61
+        list-style none
62
+        &__item
63
+          &__wrapper
86 64
             display flex
87 65
             align-items center
88 66
             border-bottom 1px solid
67
+            width 100%
68
+            height 100%
89 69
             cursor pointer
90
-            &__showdropdown
70
+          &__number
71
+            display flex
72
+            leftside()
73
+            padding 12px
74
+            width 50px
75
+            letter-spacing 2px
76
+          &__name
77
+            padding 10px
78
+            width 224px
79
+            font-size 20px
80
+            color off-white
81
+            white-space nowrap
82
+            overflow hidden
83
+            text-overflow ellipsis
84
+          &__icon
85
+            display flex
86
+            align-items center
87
+            width 26px
88
+            height 50px
89
+            color white
90
+          &__submenu
91
+            margin 0
92
+            padding 0
93
+            width 100%
94
+            overflow hidden
95
+            & > li
96
+              display block
97
+            &__dropdown
91 98
               display flex
92
-              justify-content space-between
93 99
               align-items center
94
-              padding 0 10px
95
-              width 100%
96
-            .dropdown__icon
97
-              padding 10px 15px
98
-              min-width 50px
99
-              leftside()
100
-            .dropdown__title
101
-              white-space nowrap
102
-              overflow hidden
103
-              text-overflow ellipsis
104
-              // color off-white
105
-            &.activeFilter
100
+              border-bottom 1px solid
101
+              cursor pointer
102
+              &__showdropdown
103
+                display flex
104
+                justify-content space-between
105
+                align-items center
106
+                padding 0 10px
107
+                width 100%
106 108
               .dropdown__icon
107
-                background-color rgba(253, 253, 253, 0.8)
109
+                padding 10px 15px
110
+                min-width 50px
111
+                leftside()
112
+              .dropdown__title
113
+                white-space nowrap
114
+                overflow hidden
115
+                text-overflow ellipsis
116
+                // color off-white
117
+              &.activeFilter
118
+                .dropdown__icon
119
+                  background-color rgba(253, 253, 253, 0.8)
108 120
   &__footer
109 121
     &__text
110 122
       color off-white
@@ -117,39 +129,47 @@ leftside()
117 129
             text-decoration underline
118 130
             color fourthColor
119 131
 
132
+
133
+/***** MEDIAQUERIES ******/
134
+
120 135
 /***** MEDIA 992px and 1199px ******/
121 136
 
122 137
 @media (min-width: min-lg) and (max-width: max-lg)
123 138
 
139
+  .sidebarpagecontainer
140
+    position relative
141
+
124 142
   .sidebar
125
-    position fixed
143
+    position absolute
126 144
 
127
-/***** MEDIA 576px and 991px ******/
145
+/*** MEDIA 768px and 991px ****/
128 146
 
129
-@media (min-width: min-sm) and (max-width: max-md)
147
+@media (min-width: min-md) and (max-width: max-md)
130 148
 
131
-  .sidebarSticky
132
-    top 69px
149
+  .sidebarpagecontainer
150
+    position relative
133 151
 
134 152
   .sidebar
135
-    position fixed
153
+    position absolute
136 154
 
137 155
 /***** MEDIA 576px and 767px *****/
138 156
 
139 157
 @media (min-width: min-sm) and (max-width: max-sm)
140 158
 
141 159
   .sidebarpagecontainer
160
+    position relative
142 161
     padding-top 69px
143 162
 
144
-/***** MEDIA  *****/
163
+  .sidebar
164
+    position absolute
165
+
166
+/***** MEDIA 575px *****/
145 167
 
146 168
 @media (max-width: 575px)
147 169
 
148 170
   .sidebarpagecontainer
171
+    position relative
149 172
     padding-top 69px
150 173
 
151
-  .sidebarSticky
152
-    top 69px
153
-
154 174
   .sidebar
155
-    position fixed
175
+    position absolute