Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update Social links with the TextLink #16067

Merged
merged 1 commit into from
Mar 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions src/pages/signin/Socials.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from 'react';
import _ from 'underscore';
import {Pressable, Linking} from 'react-native';
import Icon from '../../components/Icon';
import Text from '../../components/Text';
import * as Expensicons from '../../components/Icon/Expensicons';
import themeColors from '../../styles/themes/default';
import styles from '../../styles/styles';
import variables from '../../styles/variables';
import CONST from '../../CONST';
import Hoverable from '../../components/Hoverable';
import TextLink from '../../components/TextLink';

const socialsList = [
{
Expand Down Expand Up @@ -35,22 +36,23 @@ const socialsList = [
const Socials = () => (
<Text>
{_.map(socialsList, social => (
<Pressable
onPress={() => {
Linking.openURL(social.link);
}}
style={styles.pr1}
<Hoverable
key={social.link}
>
{({hovered}) => (
<Icon
src={social.iconURL}
height={variables.iconSizeLarge}
width={variables.iconSizeLarge}
fill={hovered ? themeColors.link : themeColors.textLight}
/>
{hovered => (
<TextLink
style={styles.pr1}
href={social.link}
>
<Icon
src={social.iconURL}
height={variables.iconSizeLarge}
width={variables.iconSizeLarge}
fill={hovered ? themeColors.link : themeColors.textLight}
/>
</TextLink>
)}
</Pressable>
</Hoverable>
))}
</Text>
);
Expand Down