fix(app): use platform-specific components for markdown links

This commit is contained in:
Mohamed Boudra
2026-03-13 13:27:24 +07:00
parent 013f573cff
commit 730f34753a
+14 -5
View File
@@ -468,15 +468,24 @@ function MarkdownLink({
children: ReactNode;
}) {
const [hovered, setHovered] = useState(false);
const hoverProps =
Platform.OS === "web"
? { onHoverIn: () => setHovered(true), onHoverOut: () => setHovered(false) }
: {};
if (Platform.OS !== "web") {
return (
<Text
accessibilityRole="link"
onPress={() => onPress(href)}
style={style}
>
{children}
</Text>
);
}
return (
<Pressable
accessibilityRole="link"
onPress={() => onPress(href)}
{...hoverProps}
onHoverIn={() => setHovered(true)}
onHoverOut={() => setHovered(false)}
>
<Text style={[style, hovered && { textDecorationLine: "underline" }]}>
{children}