import React from 'react';
import { Appwrite } from 'appwrite';
import appwriteConfig from '../src/appwrite/AppwriteConfig';
import { View, Text, Image, StyleSheet, TouchableOpacity, Linking } from 'react-native';
import Colors from '@/constants/Colors';
import { useRouter } from 'expo-router';
import welcomeImage from '../assets/images/icon.png';
const welcome_image = Image.resolveAssetSource(welcomeImage).uri;
const appwrite = new Appwrite();
appwrite.setEndpoint(appwriteConfig.endpoint).setProject(appwriteConfig.project);
const welcomeScreen = () => {
const router = useRouter();
const openPrivacyPolicy = () => {
Linking.openURL('https://quickgram.in');
};
const openTermsOfService = () => {
Linking.openURL('https://quickgram.in');
};
const handleAgreeAndContinue = () => {
router.push(./authentication/phonenumber/VerifyPhoneScreen);
};
return (
<View style={styles.container}>
<Image source={{ uri: welcome_image }} style={styles.welcome} />
<Text style={styles.headline}>Welcome to Quickgram</Text>
<Text style={styles.description}>
Read our{' '}
<Text style={styles.link} onPress={openPrivacyPolicy}>
Privacy Policy
</Text>
. {'Tap "Agree & Continue" to accept the '}
<Text style={styles.link} onPress={openTermsOfService}>
Terms of Service
</Text>
.
</Text>
<TouchableOpacity style={styles.button} onPress={handleAgreeAndContinue} >
<Text style={styles.buttonText}>Agree & Continue</Text>
</TouchableOpacity>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
padding: 20,
backgroundColor: '#fff',
},
welcome: {
width: '80%',
height: 280,
borderRadius: 60,
marginBottom: 80,
},
headline: {
fontSize: 24,
fontWeight: 'bold',
marginVertical: 20,
},
description: {
fontSize: 14,
textAlign: 'center',
marginBottom: 80,
color: Colors.gray,
},
link: {
color: Colors.primary,
},
button: {
width: '100%',
alignItems: 'center',
},
buttonText: {
color: Colors.primary,
fontSize: 22,
fontWeight: '500',
},
});
export default welcomeScreen;