removing tos from ios

This commit is contained in:
Roland Osborne 2023-04-03 12:06:07 -07:00
parent 37f6ec6f09
commit b0b5c19754
4 changed files with 74 additions and 66 deletions

View File

@ -56,22 +56,24 @@ export function Admin() {
</TouchableOpacity>
</View>
<View style={styles.tos}>
<TouchableOpacity style={styles.viewterms} onPress={actions.showTerms}>
<Text style={styles.viewtermstext}>View Terms of Service</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.agreeterms} onPress={() => actions.agree(!state.agree)}>
{ state.agree && (
<MatIcons name={'checkbox-outline'} size={20} color={Colors.primary} />
)}
{ !state.agree && (
<MatIcons name={'checkbox-blank-outline'} size={20} color={Colors.primary} />
)}
<Text style={styles.agreetermstext}>I agree to Terms of Service</Text>
</TouchableOpacity>
</View>
{ Platform.OS !== 'ios' && (
<View style={styles.tos}>
<TouchableOpacity style={styles.viewterms} onPress={actions.showTerms}>
<Text style={styles.viewtermstext}>View Terms of Service</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.agreeterms} onPress={() => actions.agree(!state.agree)}>
{ state.agree && (
<MatIcons name={'checkbox-outline'} size={20} color={Colors.primary} />
)}
{ !state.agree && (
<MatIcons name={'checkbox-blank-outline'} size={20} color={Colors.primary} />
)}
<Text style={styles.agreetermstext}>I agree to Terms of Service</Text>
</TouchableOpacity>
</View>
)}
{ state.enabled && state.agree && (
{ state.enabled && (Platform.OS === 'ios' || state.agree) && (
<TouchableOpacity style={styles.reset} onPress={admin}>
{ state.busy && (
<ActivityIndicator size="small" color="#ffffff" />
@ -81,7 +83,7 @@ export function Admin() {
)}
</TouchableOpacity>
)}
{ (!state.enabled || !state.agree) && (
{ (!state.enabled || (Platform.OS !== 'ios' && !state.agree)) && (
<View style={styles.noreset}>
<Text style={styles.noresettext}>Access</Text>
</View>

View File

@ -138,23 +138,25 @@ export function Create() {
</View>
)}
<View style={styles.tos}>
<TouchableOpacity style={styles.viewterms} onPress={actions.showTerms}>
<Text style={styles.viewtermstext}>View Terms of Service</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.agreeterms} onPress={() => actions.agree(!state.agree)}>
{ state.agree && (
<MatIcons name={'checkbox-outline'} size={20} color={Colors.primary} />
)}
{ !state.agree && (
<MatIcons name={'checkbox-blank-outline'} size={20} color={Colors.primary} />
)}
<Text style={styles.agreetermstext}>I agree to Terms of Service</Text>
</TouchableOpacity>
</View>
{ Platform.OS !== 'ios' && (
<View style={styles.tos}>
<TouchableOpacity style={styles.viewterms} onPress={actions.showTerms}>
<Text style={styles.viewtermstext}>View Terms of Service</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.agreeterms} onPress={() => actions.agree(!state.agree)}>
{ state.agree && (
<MatIcons name={'checkbox-outline'} size={20} color={Colors.primary} />
)}
{ !state.agree && (
<MatIcons name={'checkbox-blank-outline'} size={20} color={Colors.primary} />
)}
<Text style={styles.agreetermstext}>I agree to Terms of Service</Text>
</TouchableOpacity>
</View>
)}
<View style={styles.buttons}>
{ state.enabled && state.agree && (
{ state.enabled && (Platform.OS === 'ios' || state.agree) && (
<TouchableOpacity style={styles.create} onPress={create}>
{ state.busy && (
<ActivityIndicator size="small" color="#ffffff" />
@ -164,7 +166,7 @@ export function Create() {
)}
</TouchableOpacity>
)}
{ (!state.enabled || !state.agree) && (
{ (!state.enabled || (Platform.OS !== 'ios' && !state.agree)) && (
<View style={styles.nocreate}>
<Text style={styles.nocreatetext}>Create Account</Text>
</View>

View File

@ -1,4 +1,4 @@
import { KeyboardAvoidingView, ActivityIndicator, Modal, ScrollView, Alert, Text, TextInput, View, TouchableOpacity } from 'react-native';
import { Platform, KeyboardAvoidingView, ActivityIndicator, Modal, ScrollView, Alert, Text, TextInput, View, TouchableOpacity } from 'react-native';
import { styles } from './Login.styled';
import Ionicons from 'react-native-vector-icons/AntDesign';
import { useLogin } from './useLogin.hook';
@ -63,22 +63,24 @@ export function Login() {
</View>
)}
<View style={styles.tos}>
<TouchableOpacity style={styles.viewterms} onPress={actions.showTerms}>
<Text style={styles.viewtermstext}>View Terms of Service</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.agreeterms} onPress={() => actions.agree(!state.agree)}>
{ state.agree && (
<MatIcons name={'checkbox-outline'} size={20} color={Colors.primary} />
)}
{ !state.agree && (
<MatIcons name={'checkbox-blank-outline'} size={20} color={Colors.primary} />
)}
<Text style={styles.agreetermstext}>I agree to Terms of Service</Text>
</TouchableOpacity>
</View>
{ Platform.OS !== 'ios' && (
<View style={styles.tos}>
<TouchableOpacity style={styles.viewterms} onPress={actions.showTerms}>
<Text style={styles.viewtermstext}>View Terms of Service</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.agreeterms} onPress={() => actions.agree(!state.agree)}>
{ state.agree && (
<MatIcons name={'checkbox-outline'} size={20} color={Colors.primary} />
)}
{ !state.agree && (
<MatIcons name={'checkbox-blank-outline'} size={20} color={Colors.primary} />
)}
<Text style={styles.agreetermstext}>I agree to Terms of Service</Text>
</TouchableOpacity>
</View>
)}
{ state.enabled && state.agree && (
{ state.enabled && (Platform.OS === 'ios' || state.agree) && (
<TouchableOpacity style={styles.login} onPress={login}>
{ state.busy && (
<ActivityIndicator size="small" color="#ffffff" />
@ -88,7 +90,7 @@ export function Login() {
)}
</TouchableOpacity>
)}
{ (!state.enabled || !state.agree) && (
{ (!state.enabled || (Platform.OS !== 'ios' && !state.agree)) && (
<View style={styles.nologin}>
<Text style={styles.nologintext}>Login</Text>
</View>

View File

@ -47,23 +47,25 @@ export function Reset() {
autoCapitalize="none" placeholder="token" placeholderTextColor={Colors.grey} />
<View style={styles.space} />
</View>
{ Platform.OS !== 'ios' && (
<View style={styles.tos}>
<TouchableOpacity style={styles.viewterms} onPress={actions.showTerms}>
<Text style={styles.viewtermstext}>View Terms of Service</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.agreeterms} onPress={() => actions.agree(!state.agree)}>
{ state.agree && (
<MatIcons name={'checkbox-outline'} size={20} color={Colors.primary} />
)}
{ !state.agree && (
<MatIcons name={'checkbox-blank-outline'} size={20} color={Colors.primary} />
)}
<Text style={styles.agreetermstext}>I agree to Terms of Service</Text>
</TouchableOpacity>
</View>
)}
<View style={styles.tos}>
<TouchableOpacity style={styles.viewterms} onPress={actions.showTerms}>
<Text style={styles.viewtermstext}>View Terms of Service</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.agreeterms} onPress={() => actions.agree(!state.agree)}>
{ state.agree && (
<MatIcons name={'checkbox-outline'} size={20} color={Colors.primary} />
)}
{ !state.agree && (
<MatIcons name={'checkbox-blank-outline'} size={20} color={Colors.primary} />
)}
<Text style={styles.agreetermstext}>I agree to Terms of Service</Text>
</TouchableOpacity>
</View>
{ state.enabled && state.agree && (
{ state.enabled && (Platform.OS === 'ios' || state.agree) && (
<TouchableOpacity style={styles.reset} onPress={reset}>
{ state.busy && (
<ActivityIndicator size="small" color="#ffffff" />
@ -73,7 +75,7 @@ export function Reset() {
)}
</TouchableOpacity>
)}
{ (!state.enabled || !state.agree) && (
{ (!state.enabled || (Platform.OS !== 'ios' && !state.agree)) && (
<View style={styles.noreset}>
<Text style={styles.noresettext}>Access</Text>
</View>