@@ -52,7 +52,18 @@ function ProgressIndicator({
5252 ) ;
5353}
5454
55- export default function Benchmark ( { samples, html, ignoredTags } ) {
55+ function WaitingIndicator ( ) {
56+ return (
57+ < Text style = { styles . waitingText } > Waiting for benchmark to launch</ Text >
58+ ) ;
59+ }
60+
61+ export default function Benchmark ( {
62+ samples,
63+ html,
64+ tagsStyles,
65+ classesStyles
66+ } ) {
5667 const {
5768 onLayout,
5869 launch,
@@ -67,15 +78,26 @@ export default function Benchmark({ samples, html, ignoredTags }) {
6778 return (
6879 < View key = { runId } onLayout = { onLayout } >
6980 < currentProfile . component
70- ignoredTags = { ignoredTags }
7181 running = { true }
7282 html = { html }
83+ tagsStyles = { tagsStyles }
84+ classesStyles = { classesStyles }
7385 { ...currentProfile . props }
7486 />
7587 </ View >
7688 ) ;
7789 } ,
78- [ html , ignoredTags , onLayout , currentProfile ]
90+ [ html , onLayout , currentProfile , tagsStyles , classesStyles ]
91+ ) ;
92+
93+ const renderWaitBench = React . useCallback (
94+ ( { benchmarks } ) =>
95+ benchmarks ? (
96+ < Benchmarks benchmarks = { benchmarks } />
97+ ) : (
98+ < WaitingIndicator />
99+ ) ,
100+ [ ]
79101 ) ;
80102
81103 const isRunning = state . state === 'RUNNING' || state . state === 'WAIT_RUN' ;
@@ -102,14 +124,7 @@ export default function Benchmark({ samples, html, ignoredTags }) {
102124
103125 < ScrollView contentContainerStyle = { styles . scrollContainer } >
104126 { match ( state , {
105- WAIT_BENCH : ( { benchmarks } ) =>
106- benchmarks ? (
107- < Benchmarks benchmarks = { benchmarks } />
108- ) : (
109- < Text style = { styles . waitingText } >
110- Waiting for benchmark to launch
111- </ Text >
112- ) ,
127+ WAIT_BENCH : renderWaitBench ,
113128 WAIT_RUN : renderHtml ,
114129 RUNNING : renderHtml
115130 } ) }
@@ -123,12 +138,15 @@ const styles = StyleSheet.create({
123138 flex : 1
124139 } ,
125140 buttonContainer : {
141+ paddingTop : 40 ,
126142 marginBottom : 16 ,
127- paddingHorizontal : 16
143+ paddingHorizontal : 16 ,
144+ backgroundColor : '#fff' ,
145+ zIndex : 10
128146 } ,
129147 scrollContainer : {
130- flexGrow : 1 ,
131- paddingHorizontal : 16
148+ paddingHorizontal : 16 ,
149+ paddingBottom : 20
132150 } ,
133151 progressContainer : {
134152 backgroundColor : '#E3F2FD' ,
0 commit comments