@@ -10,68 +10,67 @@ import SVGIconImage from '../SVGIconImage'
1010import { PROJECT_STATUS_ACTIVE } from '../../config/constants'
1111import './ProjectSidebarInfo.scss'
1212
13- function ProjectSidebarInfo ( { project, duration, currentMemberRole} ) {
13+ function ProjectSidebarInfo ( { project, duration, currentMemberRole } ) {
14+ if ( ! project ) return null
1415
15- if ( ! project ) return null
16-
17- const category = findCategory ( project . type )
18- // icon for the category, use default generic work project icon for categories which no longer exist now
19- const categoryIcon = _ . get ( category , 'icon' , 'tech-32px-outline-work-project' )
20- return (
21- < div className = "project-sidebar-info" >
22- < div className = "header" >
23- < div className = "project-header" >
24- < div className = "project-type-icon" > < SVGIconImage filePath = { categoryIcon } /> </ div >
25- < div className = "project-details" >
26- < div className = "project-name" >
27- < TextTruncate
28- containerClassName = "project-name"
29- line = { 1 }
30- truncateText = "..."
31- text = { project . name }
32- />
33- </ div >
34- < div className = "project-date" > { moment ( project . updatedAt ) . format ( 'MMM DD, YYYY' ) } </ div >
35- </ div >
36- </ div >
37- </ div >
38- < div className = "body" >
39- < TextTruncate
40- containerClassName = "project-description"
41- line = { 4 }
42- truncateText = "..."
43- text = { project . description }
44- textTruncateChild = { < span > < Link className = "read-more-link" to = { `/projects/${ project . id } /specification` } > read more </ Link > </ span > }
45- />
46- < div className = "project-status" >
47- { project . status !== PROJECT_STATUS_ACTIVE &&
48- < ProjectStatus
49- status = { project . status }
50- showText
51- withoutLabel
52- currentMemberRole = { currentMemberRole }
53- canEdit = { false }
54- unifiedHeader = { false }
55- />
56- }
57- { project . status === PROJECT_STATUS_ACTIVE &&
58- < ProjectProgress { ...duration } viewType = { ProjectProgress . ViewTypes . CIRCLE } percent = { 46 } >
59- < span className = "progress-text" > { duration . percent } % completed</ span >
60- </ ProjectProgress >
61- }
62- </ div >
16+ const category = findCategory ( project . type )
17+ // icon for the category, use default generic work project icon for categories which no longer exist now
18+ const categoryIcon = _ . get ( category , 'icon' , 'tech-32px-outline-work-project' )
19+ return (
20+ < div className = "project-sidebar-info" >
21+ < div className = "header" >
22+ < div className = "project-header" >
23+ < div className = "project-type-icon" > < SVGIconImage filePath = { categoryIcon } /> </ div >
24+ < div className = "project-details" >
25+ < div className = "project-name" >
26+ < TextTruncate
27+ containerClassName = "project-name"
28+ line = { 1 }
29+ truncateText = "..."
30+ text = { project . name }
31+ />
6332 </ div >
33+ < div className = "project-date" > { moment ( project . updatedAt ) . format ( 'MMM DD, YYYY' ) } </ div >
34+ </ div >
35+ </ div >
36+ </ div >
37+ < div className = "body" >
38+ < TextTruncate
39+ containerClassName = "project-description"
40+ line = { 4 }
41+ truncateText = "..."
42+ text = { project . description }
43+ textTruncateChild = { < span > < Link className = "read-more-link" to = { `/projects/${ project . id } /specification` } > read more </ Link > </ span > }
44+ />
45+ < div className = "project-status" >
46+ { project . status !== PROJECT_STATUS_ACTIVE &&
47+ < ProjectStatus
48+ status = { project . status }
49+ showText
50+ withoutLabel
51+ currentMemberRole = { currentMemberRole }
52+ canEdit = { false }
53+ unifiedHeader = { false }
54+ />
55+ }
56+ { project . status === PROJECT_STATUS_ACTIVE &&
57+ < ProjectProgress { ...duration } viewType = { ProjectProgress . ViewTypes . CIRCLE } percent = { 46 } >
58+ < span className = "progress-text" > { duration . percent } % completed</ span >
59+ </ ProjectProgress >
60+ }
6461 </ div >
65- )
62+ </ div >
63+ </ div >
64+ )
6665}
6766
6867ProjectSidebarInfo . defaultTypes = {
6968}
7069
7170ProjectSidebarInfo . propTypes = {
72- project : PT . object . isRequired ,
73- currentMemberRole : PT . string ,
74- duration : PT . object . isRequired ,
71+ project : PT . object . isRequired ,
72+ currentMemberRole : PT . string ,
73+ duration : PT . object . isRequired
7574}
7675
7776export default ProjectSidebarInfo
0 commit comments