Skip to content

Commit

Permalink
fix: add small styling changes
Browse files Browse the repository at this point in the history
  • Loading branch information
okwasniewski committed Nov 12, 2024
1 parent 6df9676 commit de07c61
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
14 changes: 9 additions & 5 deletions packages/react-native-benchmarking-library/src/Benchmark.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCallback, useState } from "react";
import { Button, Text } from "react-native";
import { Button, Text, View } from "react-native";
import { startProfiling, stopProfiling } from "react-native-release-profiler";

export interface BenchmarkProps {
Expand Down Expand Up @@ -43,16 +43,20 @@ export const Benchmark: React.FC<BenchmarkProps> = ({
}

if (running) {
return <Text>Running benchmark, please wait</Text>;
return (
<View style={{ justifyContent: "center", alignItems: "center" }}>
<Text>Running benchmark, please wait</Text>
</View>
);
}

if (benchmarkRunTime) {
const completedLabel = `${name}Completed`;
return (
<>
<Text testID={completedLabel}>{benchmarkRunTime}</Text>
<View style={{justifyContent: 'center', alignItems: 'center'}}>
<Text style={{fontWeight: 'bold'}} testID={completedLabel} accessibilityValue={{text: `${benchmarkRunTime}`}}>Benchmark took: {benchmarkRunTime}ms</Text>
<Text testID="profileLocation">{profileLocation}</Text>
</>
</View>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,17 @@ export const BenchmarkHarness: React.FC<{ items: BenchmarkDescriptor[] }> = ({
return (
<>
<View
style={{ flex: 1, backgroundColor: "white" }}
style={{ flex: 1 }}
accessibilityLabel="benchmarkView"
>
<JavaScriptEngineVersion />
<Button
testID="toggleFlamegraph"
title={toggleFlamegraphTitle}
onPress={toggleFlamegraph}
/>
<View style={{marginBottom:20}}>
<Button
testID="toggleFlamegraph"
title={toggleFlamegraphTitle}
onPress={toggleFlamegraph}
/>
</View>
{items.map(({ benchmarkType, title, benchmarkFn }) => {
switch (benchmarkType) {
case "graphics":
Expand Down

0 comments on commit de07c61

Please sign in to comment.