-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSocialMedia.tsx
More file actions
77 lines (67 loc) · 2.22 KB
/
SocialMedia.tsx
File metadata and controls
77 lines (67 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import React, { FC, useMemo } from 'react';
import { Linking, StyleSheet } from 'react-native';
import { scaleByAspectRatio, scaleProportionally } from 'src/utils';
import Icon from 'src/assets/icons';
import { Container } from 'src/components/containers';
import { Text } from 'src/components/texts';
import { Theme } from 'src/constants/styles';
import { CustomFlexStyle, CustomTextStyle } from 'src/constants/types';
interface SocialMediaProps {
text: string;
theme: Theme;
}
const SocialMedia: FC<SocialMediaProps> = ({ text, theme }) => {
const styles = useMemo(() => createStyles(theme), [theme]);
return (
<Container flexStyle={styles.flex.follow}>
<Text text={text + ':'} textStyle={styles.text.follow} />
<Icon
name="github"
size={scaleByAspectRatio(18)}
color={{ isGradient: true, grads: theme.common.color.defaultGradient1 }}
onPress={() => Linking.openURL('https://github.com/mc-es')}
/>
<Icon
name="instagram"
size={scaleByAspectRatio(18)}
color={{
isGradient: true,
grads: theme.common.color.defaultGradient1,
}}
onPress={() => Linking.openURL('https://www.instagram.com/its.mces')}
/>
<Icon
name="linkedin"
size={scaleByAspectRatio(18)}
color={{ isGradient: true, grads: theme.common.color.defaultGradient1 }}
onPress={() => Linking.openURL('https://www.linkedin.com/in/mc-es')}
/>
</Container>
);
};
export default SocialMedia;
const enum StyleNames {
FOLLOW = 'follow',
}
const createStyles = (
theme: Theme
): {
flex: Record<StyleNames, CustomFlexStyle>;
text: Record<StyleNames, CustomTextStyle>;
} => {
const flex = StyleSheet.create<Record<StyleNames, CustomFlexStyle>>({
[StyleNames.FOLLOW]: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
gap: scaleProportionally(5),
},
});
const text = StyleSheet.create<Record<StyleNames, CustomTextStyle>>({
[StyleNames.FOLLOW]: {
fontFamily: theme.common.font.families.bold,
fontSize: theme.common.font.sizes._16,
},
});
return { flex, text };
};