mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2025-05-17 03:48:06 +08:00
removed unused libraries
This commit is contained in:
parent
e8ef9e10c8
commit
f400110222
3 changed files with 229 additions and 121 deletions
|
@ -12,16 +12,10 @@ import { useState, useEffect } from "react";
|
|||
import Button from "../../components/Button/Button";
|
||||
import { useNavigation } from "@react-navigation/native";
|
||||
import { RootDrawerParamList } from "../../interfaces/Interfaces";
|
||||
import SignupIcon from "../../icons/SignupIcon/SignupIcon";
|
||||
import { UserRegister } from "../../components/Api/Api";
|
||||
import IsNumber from "../../components/IsNumber/IsNumber";
|
||||
import ParseError from "../../components/ParseError/ParseError";
|
||||
import AnimatedContainer from "../../components/AnimatedContainer/AnimatedContainer";
|
||||
import {TouchableOpacity, Image} from "react-native";
|
||||
import { TouchableOpacity, Image } from "react-native";
|
||||
import { ScrollView } from "react-native-gesture-handler";
|
||||
import Select, { SelectConfig, SelectItem } from '@redmin_delishaj/react-native-select';
|
||||
import DropDownPicker from 'react-native-dropdown-picker'
|
||||
import SelectDropdown from 'react-native-select-dropdown'
|
||||
import SelectDropdown from "react-native-select-dropdown";
|
||||
import DropdownIcon from "../../icons/DropdownIcon/DropdownIcon";
|
||||
|
||||
export default function UserInfo() {
|
||||
|
@ -33,25 +27,35 @@ export default function UserInfo() {
|
|||
setIsActive(!isActive);
|
||||
};
|
||||
//const dispatch = useDispatch();
|
||||
// const creds = useSelector((state: RootState) => state.auth.creds);
|
||||
// const creds = useSelector((state: RootState) => state.auth.creds);
|
||||
const [user, setUser] = useState({
|
||||
first_name: "",
|
||||
last_name: "",
|
||||
year_level: "",
|
||||
semester: "",
|
||||
course: "",
|
||||
});
|
||||
});
|
||||
return (
|
||||
<ScrollView style={styles.background}>
|
||||
<AnimatedContainer>
|
||||
<Text style={{...styles.text_white_medium, ...{fontSize: 32}}}>Kurt Toledo</Text>
|
||||
<View>
|
||||
<Image source={require("./image/3135715.png")} style={styles.profile} />
|
||||
<TouchableOpacity onPress={toggleUserActive} style={styles.button}>
|
||||
<Text style={[styles.text, isActive ? styles.activeText : styles.inactiveText]}>
|
||||
Student {isActive ? 'Active' : 'Inactive'}
|
||||
<Text style={{ ...styles.text_white_medium, ...{ fontSize: 32 } }}>
|
||||
Kurt Toledo
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
<View>
|
||||
<Image
|
||||
source={require("./image/3135715.png")}
|
||||
style={styles.profile}
|
||||
/>
|
||||
<TouchableOpacity onPress={toggleUserActive} style={styles.button}>
|
||||
<Text
|
||||
style={[
|
||||
styles.text,
|
||||
isActive ? styles.activeText : styles.inactiveText,
|
||||
]}
|
||||
>
|
||||
Student {isActive ? "Active" : "Inactive"}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
<View
|
||||
style={{
|
||||
|
@ -64,35 +68,37 @@ export default function UserInfo() {
|
|||
}}
|
||||
/>
|
||||
<View style={styles.formGroup}>
|
||||
<View style={{ width: 70 }}>
|
||||
<Text style= {styles.text}>First Name</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1 }}>
|
||||
<TextInput style={[styles.input, !isEditable && styles.input]}
|
||||
editable={isEditable}
|
||||
onChange= {(
|
||||
e: NativeSyntheticEvent<TextInputChangeEventData>
|
||||
): void => {
|
||||
setUser ({...user, first_name: e.nativeEvent.text});
|
||||
}}
|
||||
<View style={{ width: 70 }}>
|
||||
<Text style={styles.text}>First Name</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1 }}>
|
||||
<TextInput
|
||||
style={[styles.input, !isEditable && styles.input]}
|
||||
editable={isEditable}
|
||||
onChange={(
|
||||
e: NativeSyntheticEvent<TextInputChangeEventData>
|
||||
): void => {
|
||||
setUser({ ...user, first_name: e.nativeEvent.text });
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<View style={styles.formGroup}>
|
||||
<View style={{ width: 70 }}>
|
||||
<Text style= {styles.text}>Last Name</Text>
|
||||
<View style={styles.formGroup}>
|
||||
<View style={{ width: 70 }}>
|
||||
<Text style={styles.text}>Last Name</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1 }}>
|
||||
<TextInput
|
||||
style={[styles.input, !isEditable && styles.input]}
|
||||
editable={isEditable}
|
||||
onChange={(
|
||||
e: NativeSyntheticEvent<TextInputChangeEventData>
|
||||
): void => {
|
||||
setUser({ ...user, first_name: e.nativeEvent.text });
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ flex: 1 }}>
|
||||
<TextInput style= {[styles.input, !isEditable && styles.input]}
|
||||
editable={isEditable}
|
||||
onChange= {(
|
||||
e: NativeSyntheticEvent<TextInputChangeEventData>
|
||||
): void => {
|
||||
setUser ({...user, first_name: e.nativeEvent.text});
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<View
|
||||
style={{
|
||||
paddingVertical: 4,
|
||||
|
@ -104,50 +110,53 @@ export default function UserInfo() {
|
|||
}}
|
||||
/>
|
||||
<View style={styles.formGroup}>
|
||||
<View style={{ width: 70 }}>
|
||||
<Text style= {styles.text}>Year Level</Text>
|
||||
<View style={{ width: 70 }}>
|
||||
<Text style={styles.text}>Year Level</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1 }}>
|
||||
<TextInput
|
||||
style={[styles.input, !isEditable && styles.input]}
|
||||
editable={isEditable}
|
||||
onChange={(
|
||||
e: NativeSyntheticEvent<TextInputChangeEventData>
|
||||
): void => {
|
||||
setUser({ ...user, first_name: e.nativeEvent.text });
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ flex: 1 }}>
|
||||
<TextInput style= {[styles.input, !isEditable && styles.input]}
|
||||
editable={isEditable}
|
||||
onChange= {(
|
||||
e: NativeSyntheticEvent<TextInputChangeEventData>
|
||||
): void => {
|
||||
setUser ({...user, first_name: e.nativeEvent.text});
|
||||
}}
|
||||
/>
|
||||
<View style={styles.formGroup}>
|
||||
<View style={{ width: 70 }}>
|
||||
<Text style={styles.text}>Semester</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1 }}>
|
||||
<TextInput
|
||||
style={[styles.input, !isEditable && styles.input]}
|
||||
editable={isEditable}
|
||||
onChange={(
|
||||
e: NativeSyntheticEvent<TextInputChangeEventData>
|
||||
): void => {
|
||||
setUser({ ...user, first_name: e.nativeEvent.text });
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<View style={styles.formGroup}>
|
||||
<View style={{ width: 70 }}>
|
||||
<Text style= {styles.text}>Semester</Text>
|
||||
<View style={styles.formGroup}>
|
||||
<View style={{ width: 70 }}>
|
||||
<Text style={styles.text}>Course</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1 }}>
|
||||
<TextInput
|
||||
style={[styles.input, !isEditable && styles.input]}
|
||||
editable={isEditable}
|
||||
onChange={(
|
||||
e: NativeSyntheticEvent<TextInputChangeEventData>
|
||||
): void => {
|
||||
setUser({ ...user, first_name: e.nativeEvent.text });
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ flex: 1 }}>
|
||||
<TextInput style={[styles.input, !isEditable && styles.input]}
|
||||
editable={isEditable}
|
||||
onChange= {(
|
||||
e: NativeSyntheticEvent<TextInputChangeEventData>
|
||||
): void => {
|
||||
setUser ({...user, first_name: e.nativeEvent.text});
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<View style={styles.formGroup}>
|
||||
<View style={{ width: 70 }}>
|
||||
<Text style= {styles.text}>Course</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1 }}>
|
||||
<TextInput style={[styles.input, !isEditable && styles.input]}
|
||||
editable={isEditable}
|
||||
onChange= {(
|
||||
e: NativeSyntheticEvent<TextInputChangeEventData>
|
||||
): void => {
|
||||
setUser ({...user, first_name: e.nativeEvent.text});
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<View
|
||||
style={{
|
||||
paddingVertical: 4,
|
||||
|
@ -159,41 +168,40 @@ export default function UserInfo() {
|
|||
}}
|
||||
/>
|
||||
<View style={styles.formGroup}>
|
||||
<View style={{ width: 80 }}>
|
||||
<Text style= {styles.text}>Subject</Text>
|
||||
<View style={{ width: 80 }}>
|
||||
<Text style={styles.text}>Subject</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1 }}>
|
||||
<SelectDropdown
|
||||
onSelect={(selectedItem, index) => {
|
||||
console.log(selectedItem, index);
|
||||
}}
|
||||
renderDropdownIcon={() => <DropdownIcon size={32} />}
|
||||
buttonTextStyle={{
|
||||
color: "white",
|
||||
}}
|
||||
dropdownStyle={{
|
||||
backgroundColor: "#E3963E",
|
||||
}}
|
||||
data={options}
|
||||
buttonStyle={{
|
||||
width: "90%",
|
||||
marginLeft: 10,
|
||||
backgroundColor: "#E3963E",
|
||||
borderRadius: 8,
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ flex: 1 }}>
|
||||
<SelectDropdown
|
||||
onSelect={(selectedItem, index) =>{
|
||||
console.log(selectedItem, index)
|
||||
}}
|
||||
renderDropdownIcon={() =><DropdownIcon size={32} />
|
||||
|
||||
}
|
||||
buttonTextStyle={{
|
||||
color: "white"
|
||||
}}
|
||||
dropdownStyle={{
|
||||
backgroundColor: "#E3963E",
|
||||
}}
|
||||
data={options}
|
||||
buttonStyle={{
|
||||
width: "90%",
|
||||
marginLeft: 10,
|
||||
backgroundColor: "#E3963E",
|
||||
borderRadius: 8
|
||||
}}
|
||||
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<TouchableOpacity
|
||||
style={styles.button_template}
|
||||
onPress={() => setIsEditable(!isEditable)}
|
||||
>
|
||||
<Text style={styles.text_white_small}>{isEditable ? "Save" : "Edit Profile"}</Text>
|
||||
</TouchableOpacity>
|
||||
</AnimatedContainer>
|
||||
<Text style={styles.text_white_small}>
|
||||
{isEditable ? "Save" : "Edit Profile"}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
</AnimatedContainer>
|
||||
</ScrollView>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue