2023-01-20 14:42:18 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { View, StyleSheet, Text, ViewStyle } from 'react-native';
|
|
|
|
|
|
|
|
import sharedStyles from '../views/Styles';
|
|
|
|
import { useTheme } from '../theme';
|
|
|
|
import openLink from '../lib/methods/helpers/openLink';
|
|
|
|
import { useAppSelector } from '../lib/hooks';
|
|
|
|
import I18n from '../i18n';
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
bottomContainer: {
|
|
|
|
flexDirection: 'column',
|
|
|
|
alignItems: 'center',
|
|
|
|
marginBottom: 32,
|
|
|
|
marginHorizontal: 30
|
|
|
|
},
|
|
|
|
bottomContainerText: {
|
|
|
|
...sharedStyles.textRegular,
|
2023-03-02 19:04:52 +00:00
|
|
|
fontSize: 13,
|
|
|
|
textAlign: 'center'
|
2023-01-20 14:42:18 +00:00
|
|
|
},
|
|
|
|
bottomContainerTextBold: {
|
|
|
|
...sharedStyles.textSemibold,
|
2023-03-02 19:04:52 +00:00
|
|
|
fontSize: 13,
|
|
|
|
textAlign: 'center'
|
2023-01-20 14:42:18 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const UGCRules = ({ styleContainer }: { styleContainer?: ViewStyle }) => {
|
|
|
|
const { colors, theme } = useTheme();
|
|
|
|
const { server } = useAppSelector(state => ({
|
|
|
|
server: state.server.server
|
|
|
|
}));
|
|
|
|
|
|
|
|
const openContract = (route: string) => {
|
|
|
|
if (!server) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
openLink(`${server}/${route}`, theme);
|
|
|
|
};
|
|
|
|
return (
|
|
|
|
<View style={[styles.bottomContainer, styleContainer]}>
|
|
|
|
<Text style={[styles.bottomContainerText, { color: colors.auxiliaryText }]}>
|
|
|
|
{`${I18n.t('Onboarding_agree_terms')}\n`}
|
|
|
|
<Text
|
|
|
|
style={[styles.bottomContainerTextBold, { color: colors.actionTintColor }]}
|
|
|
|
onPress={() => openContract('terms-of-service')}
|
|
|
|
>
|
|
|
|
{I18n.t('Terms_of_Service')}
|
|
|
|
</Text>{' '}
|
|
|
|
{I18n.t('and')}
|
|
|
|
<Text
|
|
|
|
style={[styles.bottomContainerTextBold, { color: colors.actionTintColor }]}
|
|
|
|
onPress={() => openContract('privacy-policy')}
|
|
|
|
>
|
|
|
|
{' '}
|
|
|
|
{I18n.t('Privacy_Policy')}
|
|
|
|
</Text>
|
|
|
|
</Text>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default UGCRules;
|