Skip to content
Snippets Groups Projects
Commit 2a43bedd authored by johngitt's avatar johngitt
Browse files

Fixed merges

parent 669f4f99
No related branches found
No related tags found
No related merge requests found
......@@ -19,13 +19,11 @@ export default function App() {
const colorScheme = useColorScheme();
const themeTextStyle = colorScheme === 'light' ? styles.lightThemeText : styles.darkThemeText;
const themeContainerStyle =
colorScheme === 'light' ? styles.lightContainer : styles.darkContainer;
return (
<SafeAreaProvider>
<View style={[styles.container, themeContainerStyle]}>
<View style={styles.container}>
<Animated.View style={[styles.box, style]} />
<Button
title="Press this to have rectangle change width"
......
......@@ -16,6 +16,7 @@ export default function AppLayout() {
// },
// }}
// />,
<AuthProvider>
<Tabs>
<Tabs.Screen
// Name of the route to hide.
......
......@@ -18,9 +18,7 @@ export default function createGroup() {
//const [leaderid, setLeaderid] = useState(0);
const [items, setItems] = useState([])
const themeTextStyle = colorScheme === 'light' ? styles.lightThemeText : styles.darkThemeText;
const themeContainerStyle =
colorScheme === 'light' ? styles.lightContainer : styles.darkContainer;
useEffect(() => {
......@@ -29,7 +27,7 @@ export default function createGroup() {
});
}, []);
const insertItem = (groupname, prize, username1, username2, countdown) => {
const insertItem = (groupname, prize, username1, countdown) => {
......@@ -58,135 +56,124 @@ export default function createGroup() {
return (
<SafeAreaProvider>
<View style={[styles.container, themeContainerStyle]}>
<Text style={[styles.text, themeTextStyle]}>Please fill in the blanks and press insert to create a group!</Text>
<StatusBar style="auto" />
<TextInput
style={styles.input}
value={groupname}
autoCapitalize='none'
onChangeText={text => setGroupname(text)}
placeholder="Enter Group Name"
/>
<TextInput
style={styles.input}
value={username1}
autoCapitalize='none'
onChangeText={text => setUsername1(text)}
placeholder="Enter Username 1"
/>
<TextInput
style={styles.input}
value={username2}
autoCapitalize = 'words'
onChangeText={text => setUsername2(text)}
placeholder="Enter Username 2"
/>
<TextInput
style={styles.input}
value={prize}
autoCapitalize = 'words'
onChangeText={text => setPrize(text)}
placeholder="Enter Prize"
/>
<TextInput
style={styles.input}
value={countdown}
autoCapitalize='none'
onChangeText={text => setCountdown(text)}
placeholder="Enter Countdown"
/>
<Button title="Insert Test Item" onPress={() => insertItem(groupname, prize, username1, username2, countdown)} />
</View>
</SafeAreaProvider>
);
}
const styles = StyleSheet.create({
container: {
alignItems: 'center',
justifyContent: 'center',
},
header: {
alignItems: 'center',
justifyContent: 'center',
paddingTop: 50,
paddingBottom: 20,
width: '100%',
height: 175,
},
heading: {
fontSize: 30,
fontWeight: 'bold',
color: '#fff',
marginBottom: 10,
},
forgotPasswordButton: {
width: '100%',
textAlign: 'flex-end',
},
forgotPasswordButtonText: {
color: '#528af6',
fontSize: 12,
fontWeight: 'bold',
textAlign: 'right'
},
card: {
backgroundColor: '#fff',
borderRadius: 10,
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 4,
return (
<SafeAreaProvider>
<View style={styles.container}>
<Text style={styles.text}>Please fill in the blanks and press insert to create a group!</Text>
<StatusBar style="auto" />
<TextInput
style={styles.input}
value={groupname}
autoCapitalize='none'
onChangeText={text => setGroupname(text)}
placeholder="Enter Group Name"
/>
<TextInput
style={styles.input}
value={username1}
autoCapitalize='none'
onChangeText={text => setUsername1(text)}
placeholder="Enter Competitors Username"
/>
<TextInput
style={styles.input}
value={prize}
autoCapitalize = 'words'
onChangeText={text => setPrize(text)}
placeholder="Enter Prize"
/>
<TextInput
style={styles.input}
value={countdown}
autoCapitalize='none'
onChangeText={text => setCountdown(text)}
placeholder="Enter Countdown"
/>
<Button title="Insert Test Item" onPress={() => insertItem(groupname, prize, username1, countdown)} />
</View>
</SafeAreaProvider>
);
}
const styles = StyleSheet.create({
container: {
alignItems: 'center',
justifyContent: 'center',
},
shadowOpacity: 0.2,
shadowRadius: 5,
elevation: 5,
padding: 20,
marginTop: 20,
width: '90%',
alignItems: 'center',
},
input: {
borderWidth: 1,
borderColor: '#ccc',
borderRadius: 5,
padding: 10,
marginVertical: 10,
width: '100%',
},
button: {
backgroundColor: '#528af6',
borderRadius: 5,
padding: 10,
marginTop: 10,
width: '100%',
alignItems: 'center',
},
buttonText: {
color: '#fff',
fontWeight: 'bold',
},
groupCreationText: {
color: '#528af6',
fontSize: 30,
fontWeight: 'bold',
marginTop: 20,
},
input: {
height: 40,
width: '80%',
borderColor: 'gray',
borderWidth: 1,
marginTop: 10,
padding: 10,
},
});
header: {
alignItems: 'center',
justifyContent: 'center',
paddingTop: 50,
paddingBottom: 20,
width: '100%',
height: 175,
},
heading: {
fontSize: 30,
fontWeight: 'bold',
color: '#fff',
marginBottom: 10,
},
forgotPasswordButton: {
width: '100%',
textAlign: 'flex-end',
},
forgotPasswordButtonText: {
color: '#528af6',
fontSize: 12,
fontWeight: 'bold',
textAlign: 'right'
},
card: {
backgroundColor: '#fff',
borderRadius: 10,
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 4,
},
shadowOpacity: 0.2,
shadowRadius: 5,
elevation: 5,
padding: 20,
marginTop: 20,
width: '90%',
alignItems: 'center',
},
input: {
borderWidth: 1,
borderColor: '#ccc',
borderRadius: 5,
padding: 10,
marginVertical: 10,
width: '100%',
},
button: {
backgroundColor: '#528af6',
borderRadius: 5,
padding: 10,
marginTop: 10,
width: '100%',
alignItems: 'center',
},
buttonText: {
color: '#fff',
fontWeight: 'bold',
},
groupCreationText: {
color: '#528af6',
fontSize: 30,
fontWeight: 'bold',
marginTop: 20,
},
input: {
height: 40,
width: '80%',
borderColor: 'gray',
borderWidth: 1,
marginTop: 10,
padding: 10,
},
});
\ No newline at end of file
......@@ -5,12 +5,14 @@ import { StatusBar } from 'expo-status-bar';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import Animated, { useSharedValue, withTiming, useAnimatedStyle, Easing } from 'react-native-reanimated';
import db from './database';
import { useAuth } from './AuthContext';
export default function Page() {
const [items, setItems] = useState([]);
const [inputValue, setInputValue] = useState("");
const { user, login, logout } = useAuth();
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
const [fullname, setFullname] = useState("");
......@@ -41,6 +43,7 @@ export default function Page() {
});
};
return (
<SafeAreaProvider>
<ImageBackground source={require('./color.png')}>
......@@ -75,6 +78,7 @@ export default function Page() {
<Button color='#fff' title="Sign Up"
onPress={() => {
insertItem(username, password, fullname)
login(username);
router.replace('/profile');
}} />
</TouchableOpacity>
......
......@@ -9,13 +9,11 @@ import { useAuth } from './AuthContext';
import { SimpleLineIcons } from "@expo/vector-icons";
export default function group() {
const colorScheme = useColorScheme();
const { user, login, logout } = useAuth();
const themeTextStyle = colorScheme === 'light' ? styles.lightThemeText : styles.darkThemeText;
const themeContainerStyle =
colorScheme === 'light' ? styles.lightContainer : styles.darkContainer;
const [users,setUsers] = useState([]);
const [isDatePickerVisible, setDatePickerVisible] =
......@@ -150,7 +148,7 @@ export default function group() {
{ id: 1, image: 'https://bootdey.com/img/Content/avatar/avatar1.png', screenTime: 1, name: "Sarah Smith"},
{ id: 2, image: 'https://bootdey.com/img/Content/avatar/avatar6.png', screenTime: 3, name: "John Doe"},
]
const [users, setUsers] = useState(userData)
const [users1, setUsers1] = useState(userData)
const groupData = [
{ id: 1, prize: '$20 AMEX Giftcard', measuring: 'Total Usage'},
......@@ -168,8 +166,8 @@ export default function group() {
<SafeAreaProvider>
<Link href="/" asChild>
<Pressable>
<Text style={[styles.notLogged, themeTextStyle]}> You are not currently signed into a profile </Text>
<Text style={[styles.notLogged, themeTextStyle]}> Click here to go to the login page </Text>
<Text style={styles.notLogged}> You are not currently signed into a profile </Text>
<Text style={styles.notLogged}> Click here to go to the login page </Text>
</Pressable>
</Link>
......@@ -181,7 +179,7 @@ export default function group() {
{
return (
<SafeAreaProvider>
<View style={[styles.container, themeContainerStyle]}>
<View style={styles.container}>
<View style={styles.header}>
<Image style={styles.avatar} source={{ uri: 'https://www.egypttoday.com/siteimages/Larg/202112260515371537.jpg' }} />
<View style={styles.info}>
......@@ -239,7 +237,7 @@ export default function group() {
</Text>
{users.map((item, index) => (
<Text key={index} style={[styles.text, themeTextStyle]}>Username : {item.username} password: {item.password} Full Name: {item.fullname}</Text>
<Text key={index} style={styles.text}>Username : {item.username} password: {item.password} Full Name: {item.fullname}</Text>
))}
<View style={styles.buttonContainer}>
......@@ -273,7 +271,7 @@ export default function group() {
</View>
<FlatList
enableEmptySections={true}
data={users}
data={users1}
keyExtractor={item => item.id}
renderItem={({ item }) => {
return (
......@@ -449,20 +447,5 @@ const styles = StyleSheet.create({
paddingRight: 19,
fontWeight: "bold",
},
lightContainer: {
// white
backgroundColor: '#FFFFFF',
},
darkContainer: {
// black
backgroundColor: '#000000',
},
lightThemeText: {
// white
color: '#000000',
},
darkThemeText: {
// black
color: '#FFFFFF',
},
});
import React, { useEffect, useState} from 'react';
import { Alert, Pressable, StyleSheet, Text, Button, View, Appearance, useColorScheme, ActivityIndicator, Dimensions , TextInput} from "react-native";
import { Link } from "expo-router";
import { Alert, TouchableOpacity, Pressable, StyleSheet, Text, Button, View, Appearance, useColorScheme, ActivityIndicator, Dimensions , TextInput, ImageBackground} from "react-native";
import { Link, router } from "expo-router";
import { StatusBar } from 'expo-status-bar';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import Animated, { useSharedValue, withTiming, useAnimatedStyle, Easing } from 'react-native-reanimated';
......@@ -9,13 +9,13 @@ import { useAuth } from './AuthContext';
export default function Page() {
const colorScheme = useColorScheme();
const { user, login, logout } = useAuth();
const [loggedIn, setLoggedIn] = useState(0);
const [incorrect, setIncorrect] = useState("")
const [items, setItems] = useState([]);
const [inputValue, setInputValue] = useState("");
const router = useRouter();
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
......
......@@ -16,9 +16,7 @@ export default function profile() {
const [fullname, setFullname] = useState("");
const themeTextStyle = colorScheme === 'light' ? styles.lightThemeText : styles.darkThemeText;
const themeContainerStyle =
colorScheme === 'light' ? styles.lightContainer : styles.darkContainer;
const width = Dimensions.get('window').width - 10
const height = 250
......@@ -73,8 +71,8 @@ export default function profile() {
return (
<Link href="/" asChild>
<Pressable>
<Text style={[styles.notLogged, themeTextStyle]}> You are not currently signed into a profile </Text>
<Text style={[styles.notLogged, themeTextStyle]}> Click here to go to the login page </Text>
<Text style={styles.notLogged}> You are not currently signed into a profile </Text>
<Text style={styles.notLogged}> Click here to go to the login page </Text>
</Pressable>
</Link>
......@@ -90,7 +88,7 @@ export default function profile() {
<View style={[styles.container, themeContainerStyle]}>
<View style={styles.container}>
<View style={styles.header}>
<Image style={styles.avatar} source={{ uri: 'https://www.bootdey.com/img/Content/avatar/avatar6.png' }} />
<View style={styles.info}>
......
......@@ -6,16 +6,14 @@ import Animated, { useSharedValue, withTiming, useAnimatedStyle, Easing, } from
export default function Page() {
const colorScheme = useColorScheme();
const themeTextStyle = colorScheme === 'light' ? styles.lightThemeText : styles.darkThemeText;
const themeContainerStyle =
colorScheme === 'light' ? styles.lightContainer : styles.darkContainer;
return (
<SafeAreaProvider>
<View style={[styles.container, themeContainerStyle]}>
<View style={styles.container}>
<Text style={[styles.text, themeTextStyle]}>This is a user page</Text>
<Link replace href="/" asChild>
<Pressable>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment