1
1
import React , { useEffect , useState } from "react" ;
2
- import { Grid , Paper , Tab } from "@material-ui/core" ;
2
+ import { Button , Collapse , Grid , Paper , Tab } from "@material-ui/core" ;
3
3
import { StyledPagination } from "../styled/StyledPagination" ;
4
4
import { createStyles , makeStyles } from "@material-ui/core/styles" ;
5
5
import { TabContext , TabList , TabPanel } from "@material-ui/lab" ;
@@ -41,7 +41,8 @@ const useStyles = makeStyles(() =>
41
41
justifyContent : 'center' ,
42
42
position : 'sticky' ,
43
43
top : '100px' ,
44
- flexGrow : 1
44
+ flexGrow : 1 ,
45
+ margin : 0
45
46
} ,
46
47
taggingMiscBlock : {
47
48
width : '100%' ,
@@ -64,6 +65,7 @@ function TaggingUI({taggingSession, dispatchTaggingSession, taggingClusterSessio
64
65
65
66
const [ page , setPage ] = useState < number > ( 1 )
66
67
const [ tab , setTab ] = useState < string > ( '1' )
68
+ const [ showQuestion , setShowQuestion ] = useState < boolean > ( true )
67
69
68
70
69
71
const total_clusters = taggingClusterSession . clusters . length
@@ -94,6 +96,9 @@ function TaggingUI({taggingSession, dispatchTaggingSession, taggingClusterSessio
94
96
setPage ( 1 )
95
97
}
96
98
}
99
+ if ( command == 'q' ) {
100
+ setShowQuestion ( ! showQuestion )
101
+ }
97
102
} )
98
103
99
104
@@ -130,13 +135,18 @@ function TaggingUI({taggingSession, dispatchTaggingSession, taggingClusterSessio
130
135
131
136
return (
132
137
< Grid container direction = { 'row' } className = { classes . root } spacing = { 10 } >
133
- < Grid item xs = { 4 } >
134
- < QuestionSelect
135
- questions = { taggingSession . questions }
136
- selectedQuestion = { taggingSession . currentQuestion }
137
- setQuestionSelect = { selectedChange } />
138
+ < Grid item xs = { showQuestion ? 4 : 1 } >
139
+ < Button onClick = { ( ) => {
140
+ setShowQuestion ( ! showQuestion )
141
+ } } > Q</ Button >
142
+ < Collapse in = { showQuestion } >
143
+ < QuestionSelect
144
+ questions = { taggingSession . questions }
145
+ selectedQuestion = { taggingSession . currentQuestion }
146
+ setQuestionSelect = { selectedChange } />
147
+ </ Collapse >
138
148
</ Grid >
139
- < Grid item xs = { 8 } >
149
+ < Grid item xs = { showQuestion ? 8 : 10 } >
140
150
< TabContext value = { tab } >
141
151
< TabList
142
152
indicatorColor = 'primary'
@@ -200,6 +210,7 @@ function TaggingUI({taggingSession, dispatchTaggingSession, taggingClusterSessio
200
210
}
201
211
</ div >
202
212
</ Grid >
213
+ < Grid item xs = { showQuestion ? undefined : 1 } />
203
214
</ Grid >
204
215
)
205
216
0 commit comments