File tree Expand file tree Collapse file tree 2 files changed +32
-11
lines changed Expand file tree Collapse file tree 2 files changed +32
-11
lines changed Original file line number Diff line number Diff line change @@ -15,14 +15,19 @@ const DescripTitle = styled.div`
15
15
line-height: 1.31;
16
16
` ;
17
17
18
- const DescripBody = styled . div `
18
+ interface BodyProps {
19
+ noDescrip ?: boolean ;
20
+ }
21
+
22
+ const DescripBody = styled . div < BodyProps > `
19
23
color: ${ colors . warmGrey } ;
20
24
font-size: ${ fontSizes . large } ;
21
25
margin-bottom: 18px;
22
26
white-space: pre-wrap;
23
27
font-style: normal;
24
28
line-height: 1.33;
25
29
margin-bottom: 32px;
30
+ opacity: ${ props => ( props . noDescrip ? '0.5' : '1' ) } ;
26
31
` ;
27
32
28
33
export const Divider = ( ) => (
@@ -31,16 +36,21 @@ export const Divider = () => (
31
36
</ svg >
32
37
) ;
33
38
34
- interface BodyProps {
39
+ interface DescripProps {
35
40
title : string ;
36
41
text : string ;
37
42
}
38
43
39
- const Description = ( { title, text } : BodyProps ) => {
44
+ const Description = ( { title, text } : DescripProps ) => {
40
45
return (
41
46
< DescripWrapper >
42
47
< DescripTitle > { title } </ DescripTitle >
43
- < DescripBody > { text } </ DescripBody >
48
+ { text !== null && text !== '' ? (
49
+ < DescripBody > { text } </ DescripBody >
50
+ ) : (
51
+ < DescripBody noDescrip > There's no description for this story yet.</ DescripBody >
52
+ ) }
53
+
44
54
< Divider />
45
55
</ DescripWrapper >
46
56
) ;
Original file line number Diff line number Diff line change @@ -3,10 +3,15 @@ import styled from 'styled-components';
3
3
import { colors , fontSizes , spacing } from '~lib/theme' ;
4
4
import { Task as TaskType } from '~components/projects/types' ;
5
5
6
- const TaskTitle = styled . div `
6
+ interface TitleProps {
7
+ noTasks ?: boolean ;
8
+ }
9
+
10
+ const TaskTitle = styled . div < TitleProps > `
7
11
font-size: ${ fontSizes . large } ;
8
12
color: ${ colors . warmGrey } ;
9
13
margin-bottom: 20px;
14
+ opacity: ${ props => ( props . noTasks ? '0.5' : '1' ) } ;
10
15
` ;
11
16
12
17
interface TaskDescripProps {
@@ -41,12 +46,18 @@ interface TasksProps {
41
46
const Tasks = ( { tasks } : TasksProps ) => {
42
47
return (
43
48
< TaskWrapper >
44
- < TaskTitle > Tasks</ TaskTitle >
45
- < ul >
46
- { tasks . map ( task => (
47
- < TaskDescrip completed = { task . complete } > { task . description } </ TaskDescrip >
48
- ) ) }
49
- </ ul >
49
+ { tasks . length !== 0 ? (
50
+ < >
51
+ < TaskTitle > Tasks</ TaskTitle >
52
+ < TaskList >
53
+ { tasks . map ( task => (
54
+ < TaskDescrip completed = { task . complete } > { task . description } </ TaskDescrip >
55
+ ) ) }
56
+ </ TaskList >
57
+ </ >
58
+ ) : (
59
+ < TaskTitle noTasks > No tasks</ TaskTitle >
60
+ ) }
50
61
</ TaskWrapper >
51
62
) ;
52
63
} ;
You can’t perform that action at this time.
0 commit comments