fix(app): use platform-specific components for markdown links
This commit is contained in:
@@ -468,15 +468,24 @@ function MarkdownLink({
|
|||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const [hovered, setHovered] = useState(false);
|
const [hovered, setHovered] = useState(false);
|
||||||
const hoverProps =
|
if (Platform.OS !== "web") {
|
||||||
Platform.OS === "web"
|
return (
|
||||||
? { onHoverIn: () => setHovered(true), onHoverOut: () => setHovered(false) }
|
<Text
|
||||||
: {};
|
accessibilityRole="link"
|
||||||
|
onPress={() => onPress(href)}
|
||||||
|
style={style}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</Text>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Pressable
|
<Pressable
|
||||||
accessibilityRole="link"
|
accessibilityRole="link"
|
||||||
onPress={() => onPress(href)}
|
onPress={() => onPress(href)}
|
||||||
{...hoverProps}
|
onHoverIn={() => setHovered(true)}
|
||||||
|
onHoverOut={() => setHovered(false)}
|
||||||
>
|
>
|
||||||
<Text style={[style, hovered && { textDecorationLine: "underline" }]}>
|
<Text style={[style, hovered && { textDecorationLine: "underline" }]}>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
Reference in New Issue
Block a user