diff --git a/App.js b/App.js
index 6cbb521..181e02a 100644
--- a/App.js
+++ b/App.js
@@ -3,21 +3,23 @@ import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import HomeScreen from "./src/screens/HomeScreen";
-import SignInScreen from "./src/screens/SignInScreen";
+// import SignInScreen from "./src/screens/SignInScreen";
import DonateScreen from "./src/screens/DonateScreen";
import WebsitesScreen from "./src/screens/WebsitesScreen";
+import VolunteerFormScreen from "./src/screens/VolunteerFormScreen";
const Stack = createNativeStackNavigator();
export default function App() {
return (
-
-
-
-
-
-
-
-
+ //
+ //
+ //
+ //
+ //
+ //
+ //
+ //
+
);
}
diff --git a/src/components/BackButton.js b/src/components/BackButton.js
index 69e4898..06b094f 100644
--- a/src/components/BackButton.js
+++ b/src/components/BackButton.js
@@ -2,20 +2,21 @@ import { StyleSheet, Text, View, Image } from "react-native";
export default function BackButton(props) {
return (
-
- {"\n\n\n"}
-
-
- Back
-
+
+
+
+
+ Back
+
+
);
}
@@ -24,11 +25,6 @@ const styles = StyleSheet.create({
back: {
flexDirection: "row",
alignItems: "center",
- justifyContent: "center",
- alignSelf: "flex-start",
- paddingRight: "13%",
- borderRadius: 30,
- marginVertical: "-10%",
},
backText: {
diff --git a/src/components/MultipleChoice.js b/src/components/MultipleChoice.js
index 69f6344..c864460 100644
--- a/src/components/MultipleChoice.js
+++ b/src/components/MultipleChoice.js
@@ -2,10 +2,19 @@
import React from "react";
import { View, Text, TouchableOpacity, StyleSheet } from "react-native";
-const MultipleChoice = ({ options, selectedOption, onSelect }) => {
+const MultipleChoice = ({
+ title,
+ options,
+ selectedOption,
+ onSelect,
+ color = "black",
+}) => {
return (
-
- Performance Type *
+
+
+ {title}
+ *
+
{options.map((option) => (
{
const styles = StyleSheet.create({
label: {
- fontSize: 16,
+ fontSize: 25,
marginVertical: 10,
- fontWeight: "bold",
},
option: {
flexDirection: "row",
@@ -59,11 +67,12 @@ const styles = StyleSheet.create({
},
optionText: {
marginLeft: 10,
- fontSize: 14,
+ fontSize: 20,
+ flexWrap: "wrap",
},
selectedText: {
color: "#1E90FF",
- fontWeight: "bold",
+ fontWeight: "condensedBold",
},
});
diff --git a/src/components/NextButton.js b/src/components/NextButton.js
index 26a4bc5..7a3cd9d 100644
--- a/src/components/NextButton.js
+++ b/src/components/NextButton.js
@@ -3,8 +3,7 @@ import { StyleSheet, Text, View, Image } from "react-native";
export default function NextButton() {
return (
- {"\n\n\n"}
- Next
+ {"Next"}
-
- {props.title}
- *
+
+
+ {title}
+ *
-
+ {"\n"}
+ {subtitle}
+ setText(text)}
+ keyboardType={keyboardType}
+ >
);
}
const styles = StyleSheet.create({
inputField: {
+ height: 50,
borderRadius: 15,
borderWidth: 3,
- flexGrow: 0.5,
- textAlignVertical: "top",
- },
- red: {
- color: "red",
- },
- container: {
- flexGrow: 1,
+ fontSize: 30,
+ textAlign: "center",
+ marginBottom: 20,
+ paddingHorizontal: "10%",
},
});
diff --git a/src/screens/ContactInfoScreen.js b/src/screens/ContactInfoScreen.js
deleted file mode 100644
index 5ab8780..0000000
--- a/src/screens/ContactInfoScreen.js
+++ /dev/null
@@ -1,100 +0,0 @@
-import {
- Pressable,
- View,
- SafeAreaView,
- KeyboardAvoidingView,
- StyleSheet,
- Text,
-} from "react-native";
-import BackButton from "../components/BackButton";
-import TextField from "../components/TextField";
-import NextButton from "../components/NextButton";
-
-export default function ContactInfoScreen() {
- return (
- // TODO
-
-
-
-
-
-
-
-
-
- Contact Info
-
-
- Please fill in the following details about the person who will be
- performing at the concert.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-}
-
-const styles = StyleSheet.create({
- container: {
- paddingVertical: "7%",
- display: "flex",
- alignItems: "stretch",
- flexDirection: "column",
- flex: 1,
- minHeight: "100%",
- },
- body: {
- display: "flex",
- flexDirection: "column",
- justifyContent: "space-between",
- flex: 3,
- alignItems: "stretch",
- paddingHorizontal: "8%",
- },
- form: {
- display: "flex",
- alignItems: "stretch",
- flex: 6,
- },
- heading: {
- fontSize: 64,
- fontWeight: "condensedBold",
- },
- header: {
- alignItems: "center",
- paddingHorizontal: "5%",
- flex: 1,
- },
- backButton: {
- alignSelf: "flex-start",
- },
- instructions: {
- fontSize: 20,
- flexWrap: "wrap",
- },
- field: {
- flex: 1,
- backgroundColor: "blue",
- },
- nextButton: {
- alignSelf: "flex-end",
- flex: 2,
- justifyContent: "flex-end",
- },
-});
diff --git a/src/screens/PerformanceDetailsScreen.js b/src/screens/PerformanceDetailsScreen.js
deleted file mode 100644
index 3d9b3c5..0000000
--- a/src/screens/PerformanceDetailsScreen.js
+++ /dev/null
@@ -1,61 +0,0 @@
-// PerformanceDetailsScreen.js
-import React, { useState } from "react";
-import { View, StyleSheet, ScrollView, Button } from "react-native";
-import MultipleChoice from "../components/MultipleChoice";
-import TextField from "../components/TextField";
-
-const PerformanceDetailsScreen = () => {
- const [performanceType, setPerformanceType] = useState("individual");
- const [timeLimit, setTimeLimit] = useState("");
- const [recordingLink, setRecordingLink] = useState("");
-
- const performanceOptions = [
- { label: "Individual performance only", value: "individual" },
- {
- label: "Individual performance and music instrument presentation",
- value: "individualPresentation",
- },
- { label: "Group performance only", value: "group" },
- {
- label: "Group performance and music instrument presentation",
- value: "groupPresentation",
- },
- {
- label: "Library Band Ensemble (Band, Orchestra, or Choir)",
- value: "library",
- },
- ];
-
- return (
-
-
-
-
-
- );
-};
-
-const styles = StyleSheet.create({
- container: {
- flexGrow: 1,
- padding: 20,
- backgroundColor: "#fff",
- },
-});
-
-export default PerformanceDetailsScreen;
diff --git a/src/screens/SignInScreen.js b/src/screens/SignInScreen.js
index c90ff86..31f1beb 100644
--- a/src/screens/SignInScreen.js
+++ b/src/screens/SignInScreen.js
@@ -1,133 +1,134 @@
-import {
- StyleSheet,
- Text,
- View,
- SafeAreaView,
- Pressable,
- Image,
-} from "react-native";
+// import {
+// StyleSheet,
+// Text,
+// View,
+// SafeAreaView,
+// Pressable,
+// Image,
+// } from "react-native";
-import {
- GoogleSignin,
- statusCodes,
- isErrorWithCode,
-} from "@react-native-google-signin/google-signin";
+// import {
+// GoogleSignin,
+// statusCodes,
+// isErrorWithCode,
+// } from "@react-native-google-signin/google-signin";
-import BackButton from "../components/BackButton";
+// import BackButton from "../components/BackButton";
-GoogleSignin.configure({
- webClientId:
- "761199370622-3r5phtt6a1s6lm6554htodbk8u4k9p8f.apps.googleusercontent.com",
- iosClientId:
- "761199370622-qdq0afvq19r47p34rgjsso84leub5dlj.apps.googleusercontent.com",
-});
+// GoogleSignin.configure({
+// webClientId:
+// "761199370622-3r5phtt6a1s6lm6554htodbk8u4k9p8f.apps.googleusercontent.com", // client ID of type WEB for your server. Required to get the `idToken` on the user object, and for offline access.
+// scopes: ["https://www.googleapis.com/auth/drive.readonly"], // what API you want to access on behalf of the user, default is email and profile
+// iosClientId:
+// "761199370622-qdq0afvq19r47p34rgjsso84leub5dlj.apps.googleusercontent.com", // [iOS] if you want to specify the client ID of type iOS (otherwise, it is taken from GoogleService-Info.plist)
+// });
-export default function SignInScreen() {
- return (
-
-
-
-
-
- Sign In
-
- {"\n"}
- {"Thank you for choosing to help\n"}
- {"make our volunteer concerts a\n"}
- {"success! To begin, please sign\n"}
- {"in using your Google account.\n"}
-
+// export default function SignInScreen() {
+// return (
+//
+//
+//
+//
+//
+// Sign In
+//
+// {"\n"}
+// {"Thank you for choosing to help\n"}
+// {"make our volunteer concerts a\n"}
+// {"success! To begin, please sign\n"}
+// {"in using your Google account.\n"}
+//
- {
- try {
- await GoogleSignin.hasPlayServices();
- const userInfo = await GoogleSignin.signIn();
- console.log("success");
- console.log(JSON.stringify(userInfo, null, 2));
- } catch (error) {
- if (isErrorWithCode(error)) {
- switch (error.code) {
- case statusCodes.SIGN_IN_CANCELLED:
- // user cancelled the login flow
- console.log("Cancelled");
- break;
- case statusCodes.IN_PROGRESS:
- // operation (eg. sign in) already in progress
- console.log("In progress");
- break;
- case statusCodes.PLAY_SERVICES_NOT_AVAILABLE:
- // play services not available or outdated
- console.log("Play services not available or outdated");
- break;
- case statusCodes.SIGN_IN_REQUIRED:
- console.log("Sign in required");
- break;
- default:
- console.log(error);
- break;
- // some other error happened
- }
- } else {
- console.log("WOAH This is outta my control");
- // an error that's not related to google sign in occurred
- }
- }
- }}
- >
-
- Sign in with Google
-
-
-
- );
-}
+// {
+// try {
+// await GoogleSignin.hasPlayServices();
+// const userInfo = await GoogleSignin.signIn();
+// console.log("success");
+// console.log(JSON.stringify(userInfo, null, 2));
+// } catch (error) {
+// if (isErrorWithCode(error)) {
+// switch (error.code) {
+// case statusCodes.SIGN_IN_CANCELLED:
+// // user cancelled the login flow
+// console.log("Cancelled");
+// break;
+// case statusCodes.IN_PROGRESS:
+// // operation (eg. sign in) already in progress
+// console.log("In progress");
+// break;
+// case statusCodes.PLAY_SERVICES_NOT_AVAILABLE:
+// // play services not available or outdated
+// console.log("Play services not available or outdated");
+// break;
+// case statusCodes.SIGN_IN_REQUIRED:
+// console.log("Sign in required");
+// break;
+// default:
+// console.log(error);
+// break;
+// // some other error happened
+// }
+// } else {
+// console.log("WOAH This is outta my control");
+// // an error that's not related to google sign in occurred
+// }
+// }
+// }}
+// >
+//
+// Sign in with Google
+//
+//
+//
+// );
+// }
-const styles = StyleSheet.create({
- container: {
- backgroundColor: "#fff",
- padding: "1%",
- },
+// const styles = StyleSheet.create({
+// container: {
+// backgroundColor: "#fff",
+// padding: "1%",
+// },
- body: {
- alignItems: "center",
- justifyContent: "center",
- },
+// body: {
+// alignItems: "center",
+// justifyContent: "center",
+// },
- title: {
- fontWeight: "bold",
- fontSize: 45,
- },
+// title: {
+// fontWeight: "bold",
+// fontSize: 45,
+// },
- paragraph: {
- fontSize: 18,
- },
+// paragraph: {
+// fontSize: 18,
+// },
- OAuth: {
- flexDirection: "row",
- alignItems: "center",
- justifyContent: "center",
- width: 300,
- height: 50,
- borderRadius: 15,
- },
+// OAuth: {
+// flexDirection: "row",
+// alignItems: "center",
+// justifyContent: "center",
+// width: 300,
+// height: 50,
+// borderRadius: 15,
+// },
- OAuthLogo: {
- width: 40,
- height: 40,
- },
+// OAuthLogo: {
+// width: 40,
+// height: 40,
+// },
- OAuthText: {
- color: "#fff",
- fontSize: 25,
- },
+// OAuthText: {
+// color: "#fff",
+// fontSize: 25,
+// },
- GoogleOAuth: {
- backgroundColor: "#353535",
- color: "#fff",
- },
-});
+// GoogleOAuth: {
+// backgroundColor: "#353535",
+// color: "#fff",
+// },
+// });
diff --git a/src/screens/VolunteerFormScreen.js b/src/screens/VolunteerFormScreen.js
new file mode 100644
index 0000000..174cd81
--- /dev/null
+++ b/src/screens/VolunteerFormScreen.js
@@ -0,0 +1,285 @@
+import { useState } from "react";
+
+import {
+ Pressable,
+ View,
+ SafeAreaView,
+ ScrollView,
+ StyleSheet,
+ Text,
+ Dimensions,
+ KeyboardAvoidingView,
+ Platform,
+} from "react-native";
+
+import BackButton from "../components/BackButton";
+import TextField from "../components/TextField";
+import NextButton from "../components/NextButton";
+import MultipleChoice from "../components/MultipleChoice";
+
+export default function VolunteerFormScreen() {
+ const [fullName, setFullName] = useState("");
+ const [city, setCity] = useState("");
+ const [phoneNumber, setPhoneNumber] = useState("");
+ const [age, setAge] = useState(0);
+ const [musicPiece, setMusicPiece] = useState("");
+ const [composer, setComposer] = useState("");
+ const [instrument, setInstrument] = useState("");
+
+ const [performanceType, setPerformanceType] = useState("");
+ const [timeLimit, setTimeLimit] = useState(0);
+ const [length, setLength] = useState(0);
+ const [recordingLink, setRecordingLink] = useState("");
+
+ const performanceOptions = [
+ { label: "Individual performance only", value: "individual" },
+ {
+ label: "Individual performance and music instrument presentation",
+ value: "individualPresentation",
+ },
+ { label: "Group performance only", value: "group" },
+ {
+ label: "Group performance and music instrument presentation",
+ value: "groupPresentation",
+ },
+ {
+ label: "Library Band Ensemble (Band, Orchestra, or Choir)",
+ value: "library",
+ },
+ ];
+
+ const onSelectionChange = (type) => {
+ setPerformanceType(type);
+ console.log("change");
+
+ switch (type) {
+ case "individual":
+ setTimeLimit(8);
+ break;
+
+ case "individualPresentation":
+ setTimeLimit(12);
+ break;
+
+ case "group":
+ setTimeLimit(15);
+ break;
+
+ case "groupPresentation":
+ setTimeLimit(20);
+ break;
+
+ case "library":
+ setTimeLimit(60);
+ break;
+
+ default:
+ throw new Error(
+ "Value " +
+ type +
+ " is an invalid performanceType, or is not added to PerformanceDetailsScreen",
+ );
+ }
+
+ console.log(timeLimit);
+ };
+
+ const [borderColors, setBorderColors] = useState([
+ "black",
+ "black",
+ "black",
+ "black",
+ "black",
+ "black",
+ "black",
+ "black",
+ "black",
+ ]);
+
+ const [performanceTypeColor, setPerformanceTypeColor] = useState("black");
+
+ const validate = () => {
+ const variables = [
+ city,
+ phoneNumber,
+ age,
+ musicPiece,
+ composer,
+ instrument,
+ ];
+
+ console.log(fullName.trim());
+ console.log(city.trim());
+ console.log(phoneNumber.trim());
+ console.log(age);
+ console.log(musicPiece.trim());
+ console.log(composer.trim());
+ console.log(instrument.trim());
+ console.log(performanceType.trim());
+ console.log(timeLimit);
+ console.log(length);
+ console.log(recordingLink.trim());
+
+ borderColors[0] = fullName.split(" ").length - 1 == 0 ? "red" : "black";
+ setPerformanceTypeColor(performanceType == "" ? "red" : "black");
+ borderColors[7] = length > timeLimit || length == 0 ? "red" : "black";
+
+ try {
+ let url = new URL(recordingLink);
+ borderColors[8] = "black";
+ } catch (error) {
+ borderColors[8] = "red";
+ console.error(error);
+ }
+
+ let index = 1;
+
+ variables.forEach((variable) => {
+ borderColors[index] = variable == "0" || variable == 0 ? "red" : "black";
+ index++;
+ });
+
+ borderColors.forEach((color) => console.log(color));
+ setBorderColors([...borderColors]);
+ };
+
+ const [topHeight, setTopHeight] = useState(0);
+
+ return (
+
+ {
+ const { x, y, width, height } = event.nativeEvent.layout;
+ setTopHeight(height);
+ }}
+ >
+
+
+
+
+ {"Volunteer Form"}
+
+ {"\n"}
+ {
+ "Please fill in the following details about the person who will be"
+ }
+ {"performing at the concert."}
+ {"\n\n"}
+
+
+
+
+
+
+ setFullName(text)}
+ keyboardType="default"
+ borderColor={borderColors[0]}
+ >
+ setCity(text)}
+ keyboardType="default"
+ borderColor={borderColors[1]}
+ >
+ setPhoneNumber(text)}
+ keyboardType="phone-pad"
+ borderColor={borderColors[2]}
+ >
+ setAge(text)}
+ keyboardType="numeric"
+ borderColor={borderColors[3]}
+ >
+ setMusicPiece(text)}
+ keyboardType="default"
+ borderColor={borderColors[4]}
+ >
+ setComposer(text)}
+ keyboardType="default"
+ borderColor={borderColors[5]}
+ >
+ setInstrument(text)}
+ keyboardType="default"
+ borderColor={borderColors[6]}
+ >
+ onSelectionChange(text)}
+ color={performanceTypeColor}
+ />
+ setLength(text)}
+ keyboardType={"numeric"}
+ borderColor={borderColors[7]}
+ />
+ setRecordingLink(text)}
+ keyboardType="url"
+ borderColor={borderColors[8]}
+ />
+
+ validate()}>
+
+
+
+
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ paddingVertical: "7%",
+ alignItems: "stretch",
+ flexDirection: "column",
+ },
+ body: {
+ flexDirection: "column",
+ justifyContent: "space-between",
+ alignItems: "stretch",
+ paddingHorizontal: "10%",
+ },
+ form: {
+ alignItems: "stretch",
+ },
+ heading: {
+ fontSize: 45,
+ fontWeight: "bold",
+ },
+ header: {
+ alignItems: "center",
+ textAlign: "center",
+ paddingHorizontal: "5%",
+ },
+ instructions: {
+ fontSize: 20,
+ flexWrap: "wrap",
+ },
+ nextButton: {
+ alignSelf: "flex-end",
+ justifyContent: "flex-end",
+ },
+});