mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-26 19:22:51 +00:00
* perf(app): keep large diffs responsive Render file headers on the canvas and bound expensive text shaping to the active viewport while preserving sticky, hover, and horizontal-scroll behavior. Let native scroll cancellation arbitrate header presses so finger scrolling cannot expand files. * test(app): assert canvas diff header accessibility * test(app): assert canvas diff header semantics
39 lines
984 B
TypeScript
39 lines
984 B
TypeScript
import { View, Text } from "react-native";
|
|
import { StyleSheet } from "react-native-unistyles";
|
|
import { formatDiffCount } from "@/git/file-header-presentation";
|
|
|
|
interface DiffStatProps {
|
|
additions: number;
|
|
deletions: number;
|
|
testID?: string;
|
|
}
|
|
|
|
export function DiffStat({ additions, deletions, testID }: DiffStatProps) {
|
|
return (
|
|
<View style={styles.row} testID={testID}>
|
|
<Text style={styles.additions}>+{formatDiffCount(additions)}</Text>
|
|
<Text style={styles.deletions}>-{formatDiffCount(deletions)}</Text>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create((theme) => ({
|
|
row: {
|
|
flexDirection: "row",
|
|
alignItems: "center",
|
|
height: 20,
|
|
gap: 4,
|
|
flexShrink: 0,
|
|
},
|
|
additions: {
|
|
fontSize: theme.fontSize.sm,
|
|
fontWeight: theme.fontWeight.normal,
|
|
color: theme.colors.statusSuccess,
|
|
},
|
|
deletions: {
|
|
fontSize: theme.fontSize.sm,
|
|
fontWeight: theme.fontWeight.normal,
|
|
color: theme.colors.statusDanger,
|
|
},
|
|
}));
|