This commit is contained in:
Abin Toppo
2026-01-15 17:21:34 +05:30
parent 211ee99ae9
commit 2f42c03d58
8 changed files with 1126 additions and 18 deletions
+19 -12
View File
@@ -4,9 +4,10 @@ import Modal from 'react-native-modal';
import Animated, { useSharedValue, useAnimatedStyle, withTiming, withDelay } from 'react-native-reanimated';
import { Home, Gavel, FileText, User, LogOut, ChevronRight } from 'lucide-react-native';
import { CommonActions, useNavigation } from '@react-navigation/native';
import { useDispatch } from 'react-redux';
import { useDispatch, useSelector } from 'react-redux';
import { removeToken } from '../../Redux/Slices/Token';
import NavigationString from '../../Constant/NavigationString';
import colors from '../../Constant/Color';
const { width, height } = Dimensions.get('window');
const DRAWER_WIDTH = width * 0.78;
@@ -16,8 +17,9 @@ interface Props { visible: boolean; onClose: () => void; }
const SideDrawer: React.FC<Props> = ({ visible, onClose }) => {
const navigation: any = useNavigation();
const dispatch = useDispatch();
const userData = useSelector((state: any) => state.token?.token);
const user = { name: 'Rohit Kumar', role: 'Procurement Manager', avatar: 'https://i.pravatar.cc/150?img=12', };
const user = { name: userData?.fullName, role: userData?.role, };
const translateX = useSharedValue(-DRAWER_WIDTH);
useEffect(() => {
@@ -31,6 +33,11 @@ const SideDrawer: React.FC<Props> = ({ visible, onClose }) => {
}));
const menuItems = [
{
label: 'Profile',
icon: User,
onPress: () => navigation.navigate(NavigationString.Profile),
},
{
label: 'Home',
icon: Home,
@@ -45,12 +52,8 @@ const SideDrawer: React.FC<Props> = ({ visible, onClose }) => {
label: 'Tenders',
icon: FileText,
onPress: () => navigation.navigate(NavigationString.Tender),
}
// {
// label: 'Profile',
// icon: User,
// onPress: () => { },
// },
},
];
return (
@@ -75,7 +78,9 @@ const SideDrawer: React.FC<Props> = ({ visible, onClose }) => {
<X size={20} color="#111827" />
</TouchableOpacity> */}
<Image source={{ uri: user.avatar }} style={styles.avatar} />
<View style={styles.avatar}>
<User size={40} color={colors.black} strokeWidth={2} />
</View>
<Text style={styles.userName}>{user.name}</Text>
<Text style={styles.userRole}>{user.role}</Text>
@@ -180,9 +185,11 @@ const styles = StyleSheet.create({
},
avatar: {
width: 72,
height: 72,
borderRadius: 36,
justifyContent:'center',
alignItems:'center',
backgroundColor:colors.primary,
padding:25,
borderRadius:60,
marginBottom: 10,
},