diff options
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 |