File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -2,16 +2,19 @@ import './style.scss'
2
2
3
3
type PoemItemProps = {
4
4
username : string
5
+ time : number
5
6
word : string
6
7
poem : string [ ]
7
8
}
8
9
9
10
const PoemItem : React . FC < PoemItemProps > = ( props ) => {
10
- const { username, word, poem } = props
11
+ const { username, time , word, poem } = props
11
12
12
13
return (
13
14
< div className = "poem-item" data-component = "" >
14
- < div className = "username" > { username } </ div >
15
+ < div className = "username" >
16
+ { username } { time }
17
+ </ div >
15
18
{ word . split ( '' ) . map ( ( letter , index ) => {
16
19
return (
17
20
< div key = { index } className = "poem" >
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ type PoemListProps = unknown
10
10
type PoemType = {
11
11
id : number
12
12
username : string
13
+ time : number
13
14
word : string
14
15
poem : string [ ]
15
16
}
@@ -22,6 +23,7 @@ const fetchPoemList = async (): Promise<PoemType[]> => {
22
23
type OriginPoemType = {
23
24
id : number
24
25
content : string
26
+ timeSpent : number
25
27
word : {
26
28
text : string
27
29
}
@@ -34,6 +36,7 @@ const fetchPoemList = async (): Promise<PoemType[]> => {
34
36
{
35
37
poems {
36
38
id
39
+ timeSpent
37
40
content
38
41
word {
39
42
text
@@ -46,6 +49,7 @@ const fetchPoemList = async (): Promise<PoemType[]> => {
46
49
const poemList : PoemType [ ] = poems . map ( ( poem : OriginPoemType ) => ( {
47
50
id : poem . id ,
48
51
username : '김정빈지노' ,
52
+ time : poem . timeSpent ,
49
53
word : poem . word . text ,
50
54
poem : poem . content . split ( '@' ) ,
51
55
} ) )
You can’t perform that action at this time.
0 commit comments