Browse Source

changed digit of ws in sidebar to first 2 letters

Skylsmoi 7 years ago
parent
commit
36d9488709
2 changed files with 2 additions and 7 deletions
  1. 1 6
      src/component/Sidebar/WorkspaceListItem.jsx
  2. 1 1
      src/css/Sidebar.styl

+ 1 - 6
src/component/Sidebar/WorkspaceListItem.jsx View File

4
 import PropTypes from 'prop-types'
4
 import PropTypes from 'prop-types'
5
 import AnimateHeight from 'react-animate-height'
5
 import AnimateHeight from 'react-animate-height'
6
 
6
 
7
-const pad = number => {
8
-  number = number.toString()
9
-  return number.length < 2 ? pad('0' + number, 2) : number
10
-}
11
-
12
 const WorkspaceListItem = props => {
7
 const WorkspaceListItem = props => {
13
   return (
8
   return (
14
     <li className='sidebar__navigation__workspace__item'>
9
     <li className='sidebar__navigation__workspace__item'>
15
       <div className='sidebar__navigation__workspace__item__wrapper' onClick={props.onClickTitle}>
10
       <div className='sidebar__navigation__workspace__item__wrapper' onClick={props.onClickTitle}>
16
         <div className='sidebar__navigation__workspace__item__number'>
11
         <div className='sidebar__navigation__workspace__item__number'>
17
-          {pad(props.number)}
12
+          {props.name.substring(0, 2).toUpperCase()}
18
         </div>
13
         </div>
19
 
14
 
20
         <div className='sidebar__navigation__workspace__item__name' title={props.name}>
15
         <div className='sidebar__navigation__workspace__item__name' title={props.name}>

+ 1 - 1
src/css/Sidebar.styl View File

85
         &__number
85
         &__number
86
           leftside()
86
           leftside()
87
           padding 12px
87
           padding 12px
88
-          min-width 50px
88
+          width 50px
89
           letter-spacing 2px
89
           letter-spacing 2px
90
         &__name
90
         &__name
91
           flex-grow 2
91
           flex-grow 2