1
1
import { DragEvent , useEffect , useMemo , useRef , useState } from "react" ;
2
2
import { useOutletContext } from "react-router-dom" ;
3
- import { BacklogDTO , StoryDTO , TaskDTO } from "../../types/DTO/backlogDTO" ;
3
+ import { Socket } from "socket.io-client" ;
4
+ import { LexoRank } from "lexorank" ;
5
+ import useStoryEmitEvent from "../../hooks/pages/backlog/useStoryEmitEvent" ;
6
+ import useTaskEmitEvent from "../../hooks/pages/backlog/useTaskEmitEvent" ;
7
+ import getDragElementIndex from "../../utils/getDragElementIndex" ;
8
+ import useEpicEmitEvent from "../../hooks/pages/backlog/useEpicEmitEvent" ;
9
+ import useShowDetail from "../../hooks/pages/backlog/useShowDetail" ;
4
10
import StoryCreateButton from "../../components/backlog/StoryCreateButton" ;
5
11
import StoryCreateForm from "../../components/backlog/StoryCreateForm" ;
6
12
import StoryBlock from "../../components/backlog/StoryBlock" ;
7
13
import TaskBlock from "../../components/backlog/TaskBlock" ;
8
14
import EpicBlock from "../../components/backlog/EpicBlock" ;
9
15
import TaskContainer from "../../components/backlog/TaskContainer" ;
10
16
import TaskHeader from "../../components/backlog/TaskHeader" ;
11
- import { Socket } from "socket.io-client" ;
12
- import useStoryEmitEvent from "../../hooks/pages/backlog/useStoryEmitEvent" ;
13
- import useTaskEmitEvent from "../../hooks/pages/backlog/useTaskEmitEvent" ;
14
- import getDragElementIndex from "../../utils/getDragElementIndex" ;
15
- import { LexoRank } from "lexorank" ;
16
- import useEpicEmitEvent from "../../hooks/pages/backlog/useEpicEmitEvent" ;
17
- import { BacklogSocketData } from "../../types/common/backlog" ;
18
17
import EpicPageStoryDragContainer from "../../components/backlog/EpicPageStoryDragContainer" ;
19
18
import EpicPageTaskDragContainer from "../../components/backlog/EpicPageTaskDragContainer" ;
20
19
import EpicDragContainer from "../../components/backlog/EpicDragContainer" ;
21
20
import TaskCreateBlock from "../../components/backlog/TaskCreateBlock" ;
21
+ import EpicCreateButton from "../../components/backlog/EpicCreateButton" ;
22
+ import { BacklogSocketData } from "../../types/common/backlog" ;
23
+ import { BacklogDTO , StoryDTO , TaskDTO } from "../../types/DTO/backlogDTO" ;
24
+ import EpicCreateForm from "../../components/backlog/EpicCreateForm" ;
22
25
23
26
const EpicPage = ( ) => {
24
27
const { socket, backlog } : { socket : Socket ; backlog : BacklogDTO } =
@@ -29,6 +32,10 @@ const EpicPage = () => {
29
32
const [ showStory , setShowStory ] = useState < {
30
33
[ key : number ] : { showStoryList : boolean ; showStoryForm : boolean } ;
31
34
} > ( { } ) ;
35
+ const {
36
+ showDetail : showEpicCreateForm ,
37
+ handleShowDetail : handleShowEpicCreateForm ,
38
+ } = useShowDetail ( ) ;
32
39
33
40
useEffect ( ( ) => {
34
41
setShowStory ( ( prevShowStory ) => {
@@ -469,7 +476,18 @@ const EpicPage = () => {
469
476
} ;
470
477
471
478
return (
472
- < div className = "gap-4 pb-10" onDragOver = { handleEpicDragOver } >
479
+ < div className = "gap-4 pb-10 border-t" onDragOver = { handleEpicDragOver } >
480
+ { ! epicList . length && (
481
+ < div className = "mt-4" >
482
+ { showEpicCreateForm ? (
483
+ < EpicCreateForm
484
+ onCloseClick = { ( ) => handleShowEpicCreateForm ( false ) }
485
+ />
486
+ ) : (
487
+ < EpicCreateButton onClick = { ( ) => handleShowEpicCreateForm ( true ) } />
488
+ ) }
489
+ </ div >
490
+ ) }
473
491
{ ...epicList . map (
474
492
( { id : epicId , name, color, rankValue, storyList } , epicIndex ) => {
475
493
storyComponentRefList . current [ epicIndex ] = [ ] ;
0 commit comments