Skip to content
Source
Sign inSign up

PaneListItem.tsx

22 lines715 Bytes

1import { Pressable } from "react-native";
2​
3import type { PaneListItemProps } from "./PaneListItem.types";
4export type { PaneListItemProps } from "./PaneListItem.types";
5​
6/** A selectable entry in a pane's navigation list, such as a changed file. */
7export function PaneListItem(props: PaneListItemProps) {
8 return (
9 <Pressable
10 accessibilityRole="button"
11 accessibilityState={{ selected: props.selected }}
12 className={
13 props.selected
14 ? "mt-1 min-h-12 justify-center rounded-xl bg-subtle-strong px-3 py-2"
15 : "mt-1 min-h-12 justify-center rounded-xl px-3 py-2 active:bg-subtle"
16 }
17 onPress={props.onPress}
18 >
19 {props.children}
20 </Pressable>
21 );