|
@@ -9,12 +9,17 @@ import { makeRedirectUri } from "expo-auth-session";
|
|
|
import * as WebBrowser from 'expo-web-browser';
|
|
|
import { maybeCompleteAuthSession } from "expo-web-browser";
|
|
|
import React, { useState } from "react";
|
|
|
-import { ActivityIndicator, Image, StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
|
+import { ActivityIndicator, Image, Pressable, StyleSheet, Text, TouchableHighlight, TouchableOpacity, View } from "react-native";
|
|
|
import { useAuth } from "../../data/Auth/AuthContext";
|
|
|
import { BaseStackNavigationProp } from "../../navigation/BaseStackNavigator";
|
|
|
import { API_URL } from "../../utils/RequestUtils";
|
|
|
-import { PrimaryButton } from "../Buttons";
|
|
|
+import { GenericButton, PrimaryButton } from "../Buttons";
|
|
|
import UnauthorizedLayout from "./AuthLayout";
|
|
|
+import { ProfileSectionHeader } from "./ProfileSections/ProfileSectionHeader";
|
|
|
+import * as Linking from 'expo-linking';
|
|
|
+import { BrowserLink, ProfileLegal } from "./ProfileSections/ProfileLegal";
|
|
|
+import { Separator } from "../Separator";
|
|
|
+import Collapsible from "react-native-collapsible";
|
|
|
|
|
|
/**
|
|
|
* Props used by the {@link Intro} screen.
|
|
@@ -43,6 +48,7 @@ const LoginView : React.FC<{navigation: BaseStackNavigationProp}> = ({navigation
|
|
|
* */
|
|
|
const loginMessageState = "";
|
|
|
const [loginMessage, setLoginMessage] = useState<string>(loginMessageState);
|
|
|
+ const [legalCollapsed, toggleLegal] = useState<boolean>(true)
|
|
|
/**
|
|
|
* @type {boolean}
|
|
|
* React state holding the error state of the component.
|
|
@@ -70,6 +76,14 @@ const LoginView : React.FC<{navigation: BaseStackNavigationProp}> = ({navigation
|
|
|
await WebBrowser.openBrowserAsync(API_URL + "/privacy")
|
|
|
}
|
|
|
|
|
|
+ const openFeedback = () => {
|
|
|
+ Linking.openURL('mailto:dev@clicknpush.ca')
|
|
|
+ }
|
|
|
+
|
|
|
+ const openLegal = () => {
|
|
|
+ toggleLegal(!legalCollapsed)
|
|
|
+ }
|
|
|
+
|
|
|
return (
|
|
|
<UnauthorizedLayout>
|
|
|
{!loginMessage ?
|
|
@@ -80,6 +94,16 @@ const LoginView : React.FC<{navigation: BaseStackNavigationProp}> = ({navigation
|
|
|
<View style={styles.btnContainer}>
|
|
|
<PrimaryButton text="Login" onPress={login}/>
|
|
|
<PrimaryButton text="Create account" onPress={goToRegistration} />
|
|
|
+ <View style={{width: '100%'}}>
|
|
|
+ <GenericButton text="Legal" style={{justifyContent: 'center', alignItems: 'center', padding: 20, width: '100%', }} onPress={openLegal}/>
|
|
|
+ <Separator color="#E0E0E0" />
|
|
|
+ <Collapsible collapsed={legalCollapsed} style={{borderColor: '#E0E0E0', borderBottomWidth: 1, borderRightWidth: 1, borderLeftWidth: 1, justifyContent: 'center', alignItems: 'center', padding: 20}} >
|
|
|
+ <BrowserLink style={{marginBottom: 20}} text="Mobile app third-party licenses" route="mobile-tpl"/>
|
|
|
+ <BrowserLink text="API third-party licenses" route="api-tpl"/>
|
|
|
+ </Collapsible>
|
|
|
+ </View>
|
|
|
+ <Separator color="#D3D3D3" />
|
|
|
+ <GenericButton text="Provide feedback" style={{justifyContent: 'center', alignItems: 'center', padding: 20, width: '100%', }} onPress={openFeedback}/>
|
|
|
</View>
|
|
|
</View> :
|
|
|
<View style={{height: '100%', justifyContent: "center", alignItems: "center"}}>
|