11import React , { useEffect , useState } from "react" ;
2- import { Grid , Dialog , IconButton , Box , Typography } from "@material-ui/core" ;
2+ import {
3+ Grid ,
4+ Dialog ,
5+ IconButton ,
6+ Box ,
7+ Typography ,
8+ makeStyles ,
9+ } from "@material-ui/core" ;
310import { useParams , useLocation , useHistory } from "react-router-dom" ;
411import { TestRun } from "../types" ;
512import { testRunService } from "../services" ;
@@ -26,11 +33,7 @@ const getQueryParams = (guery: string) => {
2633 } ;
2734} ;
2835
29- const styles : {
30- modal : React . CSSProperties ;
31- button : React . CSSProperties ;
32- icon : React . CSSProperties ;
33- } = {
36+ const useStyles = makeStyles ( ( theme ) => ( {
3437 modal : {
3538 margin : 40 ,
3639 } ,
@@ -46,9 +49,18 @@ const styles: {
4649 width : 64 ,
4750 height : 64 ,
4851 } ,
49- } ;
52+ buildListContainer : {
53+ maxHeight : "89vh" ,
54+ overflow : "auto" ,
55+ } ,
56+ testRunContainer : {
57+ maxHeight : "83vh" ,
58+ overflow : "auto" ,
59+ } ,
60+ } ) ) ;
5061
5162const ProjectPage = ( ) => {
63+ const classes = useStyles ( ) ;
5264 const { projectId } = useParams ( ) ;
5365 const location = useLocation ( ) ;
5466 const history = useHistory ( ) ;
@@ -138,7 +150,7 @@ const ProjectPage = () => {
138150 < ProjectSelect selectedId = { projectId } />
139151 </ Grid >
140152 </ Grid >
141- < Grid item >
153+ < Grid item className = { classes . buildListContainer } >
142154 < BuildList />
143155 </ Grid >
144156 </ Grid >
@@ -157,7 +169,7 @@ const ProjectPage = () => {
157169 />
158170 </ Box >
159171 </ Grid >
160- < Grid item >
172+ < Grid item className = { classes . testRunContainer } >
161173 < TestRunList
162174 items = { filteredTestRuns }
163175 selectedId = { selectedTestdId }
@@ -171,39 +183,39 @@ const ProjectPage = () => {
171183 />
172184 { selectedTestRunIndex !== undefined &&
173185 testRuns [ selectedTestRunIndex ] && (
174- < Dialog open = { true } fullScreen style = { styles . modal } >
186+ < Dialog open = { true } fullScreen className = { classes . modal } >
175187 < TestDetailsModal
176188 testRun = { testRuns [ selectedTestRunIndex ] }
177189 updateTestRun = { updateTestRun }
178190 />
179191 { selectedTestRunIndex + 1 < testRuns . length && (
180192 < IconButton
181193 color = "secondary"
194+ className = { classes . button }
182195 style = { {
183- ...styles . button ,
184196 right : 0 ,
185197 } }
186198 onClick = { ( ) => {
187199 const next = testRuns [ selectedTestRunIndex + 1 ] ;
188200 history . push ( buildTestRunLocation ( next ) ) ;
189201 } }
190202 >
191- < NavigateNext style = { styles . icon } />
203+ < NavigateNext className = { classes . icon } />
192204 </ IconButton >
193205 ) }
194206 { selectedTestRunIndex > 0 && (
195207 < IconButton
196208 color = "secondary"
209+ className = { classes . button }
197210 style = { {
198- ...styles . button ,
199211 left : 0 ,
200212 } }
201213 onClick = { ( ) => {
202214 const prev = testRuns [ selectedTestRunIndex - 1 ] ;
203215 history . push ( buildTestRunLocation ( prev ) ) ;
204216 } }
205217 >
206- < NavigateBefore style = { styles . icon } />
218+ < NavigateBefore className = { classes . icon } />
207219 </ IconButton >
208220 ) }
209221 </ Dialog >
0 commit comments