From caaf11377734a26058229aa747ad50c53c960741 Mon Sep 17 00:00:00 2001 From: AngelV3rgs Date: Mon, 17 Jul 2023 11:58:12 +0800 Subject: [PATCH] added dropdown,user icon and user status --- .../DrawerSettings/CustomDrawerContent.tsx | 3 ++- src/routes/UserInfo/UserInfo.tsx | 22 ++++++++++++------- src/styles.tsx | 14 ++++++++++-- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/components/DrawerSettings/CustomDrawerContent.tsx b/src/components/DrawerSettings/CustomDrawerContent.tsx index dccc2cb..21df007 100644 --- a/src/components/DrawerSettings/CustomDrawerContent.tsx +++ b/src/components/DrawerSettings/CustomDrawerContent.tsx @@ -16,6 +16,7 @@ import { RootState } from "../../features/redux/Store/Store"; import LogoutIcon from "../../icons/LogoutIcon/LogoutIcon"; import { clear } from "../../features/redux/slices/AuthSlice/AuthSlice"; import AsyncStorage from "@react-native-async-storage/async-storage"; +import UserIcon from "../../icons/UserIcon/UserIcon"; export default function CustomDrawerContent(props: {}) { const navigation = useNavigation(); @@ -103,7 +104,7 @@ export default function CustomDrawerContent(props: {}) { navigation.navigate("UserInfo"); }} > - + UserInfo {/* diff --git a/src/routes/UserInfo/UserInfo.tsx b/src/routes/UserInfo/UserInfo.tsx index 9fcdece..4dbfe4d 100644 --- a/src/routes/UserInfo/UserInfo.tsx +++ b/src/routes/UserInfo/UserInfo.tsx @@ -22,13 +22,16 @@ 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 ImagePicker from 'react-native-image-picker'; +import DropdownIcon from "../../icons/DropdownIcon/DropdownIcon"; export default function UserInfo() { const navigation = useNavigation(); const [isEditable, setIsEditable] = useState(false); - const options = ["Prog1", "Prog2", "Networking", "Database"]; - + const options = ["", "", "", ""]; + const [isActive, setIsActive] = useState(false); + const toggleUserActive = () => { + setIsActive(!isActive); + }; //const dispatch = useDispatch(); // const creds = useSelector((state: RootState) => state.auth.creds); const [user, setUser] = useState({ @@ -41,11 +44,14 @@ export default function UserInfo() { return ( - + Kurt Toledo - Kurt Toledo - Student - + + + + Student {isActive ? 'Active' : 'Inactive'} + + { console.log(selectedItem, index) }} - renderDropdownIcon={() => + renderDropdownIcon={() => } buttonTextStyle={{ diff --git a/src/styles.tsx b/src/styles.tsx index d8d7c67..67877a5 100644 --- a/src/styles.tsx +++ b/src/styles.tsx @@ -105,7 +105,7 @@ const styles = StyleSheet.create({ profile: { height: 80, width: 80, - marginLeft: 10, + alignSelf: 'center', }, input: { height: 40, @@ -129,7 +129,17 @@ const styles = StyleSheet.create({ fontSize: font_sizes.small, fontWeight: "bold", }, - + button: { + padding: 10, + backgroundColor: colors.blue_2, + borderRadius: 5, + }, + activeText: { + color: 'green', + }, + inactiveText: { + color: 'white', + }, });