@@ -11,7 +11,6 @@ import {
1111 Box ,
1212} from "@material-ui/core" ;
1313import { TestRun } from "../types" ;
14- import { createStyles , makeStyles , Theme } from "@material-ui/core/styles" ;
1514import { testRunService , testVariationService } from "../services" ;
1615import DrawArea from "./DrawArea" ;
1716import { TestStatus } from "../types/testStatus" ;
@@ -20,21 +19,13 @@ import { IgnoreArea } from "../types/ignoreArea";
2019import { KonvaEventObject } from "konva/types/Node" ;
2120import { Close , Add , Delete , Save } from "@material-ui/icons" ;
2221import TestStatusChip from "./TestStatusChip" ;
23-
24- const useStyles = makeStyles ( ( theme : Theme ) =>
25- createStyles ( {
26- appBar : {
27- position : "relative" ,
28- } ,
29- } )
30- ) ;
22+ import ImageDetails from "./ImageDetails" ;
3123
3224const TestDetailsModal : React . FunctionComponent < {
3325 testRun : TestRun ;
3426 updateTestRun : ( testRun : TestRun ) => void ;
3527} > = ( { testRun, updateTestRun } ) => {
3628 const history = useHistory ( ) ;
37- const classes = useStyles ( ) ;
3829
3930 const [ isDiffShown , setIsDiffShown ] = useState ( ! ! testRun . diffName ) ;
4031 const [ selectedRectId , setSelectedRectId ] = React . useState < string > ( ) ;
@@ -79,7 +70,7 @@ const TestDetailsModal: React.FunctionComponent<{
7970 when = { ! isIgnoreAreasSaved ( ) }
8071 message = { `You have unsaved changes that will be lost` }
8172 />
82- < AppBar className = { classes . appBar } >
73+ < AppBar position = "sticky" >
8374 < Toolbar >
8475 < Grid container justify = "space-between" >
8576 < Grid item >
@@ -214,6 +205,9 @@ const TestDetailsModal: React.FunctionComponent<{
214205 </ Box >
215206 < Grid container >
216207 < Grid item xs = { 6 } >
208+ < Box m = { 1 } >
209+ < ImageDetails type = "Baseline" imageName = { testRun . baselineName } />
210+ </ Box >
217211 < DrawArea
218212 width = { stageWidth }
219213 height = { stageHeigth }
@@ -227,27 +221,37 @@ const TestDetailsModal: React.FunctionComponent<{
227221 </ Grid >
228222 < Grid item xs = { 6 } >
229223 { isDiffShown ? (
230- < DrawArea
231- width = { stageWidth }
232- height = { stageHeigth }
233- imageUrl = { testRun . diffName }
234- ignoreAreas = { ignoreAreas }
235- setIgnoreAreas = { setIgnoreAreas }
236- selectedRectId = { selectedRectId }
237- setSelectedRectId = { setSelectedRectId }
238- onStageClick = { removeSelection }
239- />
224+ < React . Fragment >
225+ < Box m = { 1 } >
226+ < ImageDetails type = "Diff" imageName = { testRun . diffName } />
227+ </ Box >
228+ < DrawArea
229+ width = { stageWidth }
230+ height = { stageHeigth }
231+ imageUrl = { testRun . diffName }
232+ ignoreAreas = { ignoreAreas }
233+ setIgnoreAreas = { setIgnoreAreas }
234+ selectedRectId = { selectedRectId }
235+ setSelectedRectId = { setSelectedRectId }
236+ onStageClick = { removeSelection }
237+ />
238+ </ React . Fragment >
240239 ) : (
241- < DrawArea
242- width = { stageWidth }
243- height = { stageHeigth }
244- imageUrl = { testRun . imageName }
245- ignoreAreas = { ignoreAreas }
246- setIgnoreAreas = { setIgnoreAreas }
247- selectedRectId = { selectedRectId }
248- setSelectedRectId = { setSelectedRectId }
249- onStageClick = { removeSelection }
250- />
240+ < React . Fragment >
241+ < Box m = { 1 } >
242+ < ImageDetails type = "Image" imageName = { testRun . imageName } />
243+ </ Box >
244+ < DrawArea
245+ width = { stageWidth }
246+ height = { stageHeigth }
247+ imageUrl = { testRun . imageName }
248+ ignoreAreas = { ignoreAreas }
249+ setIgnoreAreas = { setIgnoreAreas }
250+ selectedRectId = { selectedRectId }
251+ setSelectedRectId = { setSelectedRectId }
252+ onStageClick = { removeSelection }
253+ />
254+ </ React . Fragment >
251255 ) }
252256 </ Grid >
253257 </ Grid >
0 commit comments