Skip to content

Commit

Permalink
Restore environmentURL
Browse files Browse the repository at this point in the history
  • Loading branch information
MaciejSWM committed Dec 6, 2023
1 parent 1a8f7ad commit d95966a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/TextLink.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, {ForwardedRef, forwardRef, KeyboardEventHandler, MouseEventHandler} from 'react';
import {GestureResponderEvent, Text as RNText, StyleProp, TextStyle} from 'react-native';
import useEnvironment from '@hooks/useEnvironment';
import useThemeStyles from '@styles/useThemeStyles';
import * as Link from '@userActions/Link';
import CONST from '@src/CONST';
Expand Down Expand Up @@ -29,13 +30,14 @@ type TextLinkProps = (LinkProps | PressProps) &
};

function TextLink({href, onPress, children, style, onMouseDown = (event) => event.preventDefault(), ...rest}: TextLinkProps, ref: ForwardedRef<RNText>) {
const {environmentURL} = useEnvironment();
const styles = useThemeStyles();

const openLink = () => {
if (onPress) {
onPress();
} else {
Link.openExternalLink(href);
Link.openLink(href, environmentURL);
}
};

Expand Down

0 comments on commit d95966a

Please sign in to comment.