diff options
author | Paul Frazee <pfrazee@gmail.com> | 2024-01-18 22:21:47 -0800 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2024-01-18 22:21:47 -0800 |
commit | f58e1149c91995a49c1b991e574e9942990ad449 (patch) | |
tree | c79331be1abf82a66b1265e0242535cfff990067 /src/view/shell/desktop/Search.tsx | |
parent | 809c534d3205010fb3df4a666b400d40aae674ec (diff) | |
download | voidsky-f58e1149c91995a49c1b991e574e9942990ad449.tar.zst |
Change handling for mobile
Diffstat (limited to 'src/view/shell/desktop/Search.tsx')
-rw-r--r-- | src/view/shell/desktop/Search.tsx | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/view/shell/desktop/Search.tsx b/src/view/shell/desktop/Search.tsx index c24940b52..4a9483733 100644 --- a/src/view/shell/desktop/Search.tsx +++ b/src/view/shell/desktop/Search.tsx @@ -35,14 +35,36 @@ export const MATCH_HANDLE = export function SearchLinkCard({ label, to, + onPress, style, }: { label: string - to: string + to?: string + onPress?: () => void style?: ViewStyle }) { const pal = usePalette('default') + const inner = ( + <View + style={[pal.border, {paddingVertical: 16, paddingHorizontal: 12}, style]}> + <Text type="md" style={[pal.text]}> + {label} + </Text> + </View> + ) + + if (onPress) { + return ( + <TouchableOpacity + onPress={onPress} + accessibilityLabel={label} + accessibilityHint=""> + {inner} + </TouchableOpacity> + ) + } + return ( <Link href={to} asAnchor anchorNoUnderline> <View |