Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "windows-gcc-x86",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "C:/MinGW/bin/gcc.exe",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "windows-gcc-x86",
"compilerArgs": [
""
]
}
],
"version": 4
}
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": true,
"cwd": "c:/Users/khush/AppData/Local/Microsoft/Windows/INetCache/IE/DKU7278T",
"program": "c:/Users/khush/AppData/Local/Microsoft/Windows/INetCache/IE/DKU7278T/build/Debug/outDebug",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
59 changes: 58 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,60 @@
{
"git.ignoreLimitWarning": true
"git.ignoreLimitWarning": true,
"C_Cpp_Runner.cCompilerPath": "gcc",
"C_Cpp_Runner.cppCompilerPath": "g++",
"C_Cpp_Runner.debuggerPath": "gdb",
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wcast-align",
"-Wconversion",
"-Wsign-conversion",
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings": [
"/W4",
"/permissive-",
"/w14242",
"/w14287",
"/w14296",
"/w14311",
"/w14826",
"/w44062",
"/w44242",
"/w14905",
"/w14906",
"/w14263",
"/w44265",
"/w14928"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer": false,
"C_Cpp_Runner.useUndefinedSanitizer": false,
"C_Cpp_Runner.useLeakSanitizer": false,
"C_Cpp_Runner.showCompilationTime": false,
"C_Cpp_Runner.useLinkTimeOptimization": false,
"C_Cpp_Runner.msvcSecureNoWarnings": false
}
35 changes: 33 additions & 2 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { createStackNavigator } from '@react-navigation/stack';
import { AuthProvider, useAuth } from './context/AuthContext';
import { ThemeProvider } from './context/ThemeContext'; // Make sure to import ThemeProvider
import MainTabNavigator from './navigation/MainTabNavigator';
import WardenTabNavigator from './navigation/WardenTabNavigator';
import LoginScreen from './screens/LoginScreen';
import RegisterScreen from './screens/RegisterScreen';
import LoadingScreen from './screens/LoadingScreen';
Expand All @@ -15,6 +16,12 @@ import LibraryScreen from './screens/LibraryScreen';
import LogBook from './screens/LogBookScreen';
import { StackScreen } from 'react-native-screens';
import GuardDashboardScreen from './screens/GuardScreen';
import WardenDashboardScreen from './screens/WardenDashboardScreen.';
import OutpassScreen from './screens/OutpassScreen';
// import EmergencyScreen from './screens/EmergencyScreen';
import ProfileScreen from './screens/ProfileScreen';


const Stack = createStackNavigator();

function RootNavigator() {
Expand All @@ -23,6 +30,20 @@ function RootNavigator() {
if (loading) {
return <LoadingScreen />;
}

// if user is not logged in

if (!user) {
return (
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name="Login" component={LoginScreen} />
<Stack.Screen name="Register" component={RegisterScreen} />
</Stack.Navigator>
)
}

// user is logged in so its safe to use user.role now otherwise error would have came

return (
<Stack.Navigator screenOptions={{ headerShown: false }}>
{user ? (
Expand All @@ -34,8 +55,18 @@ function RootNavigator() {
<Stack.Screen name="Scan" component={Scanner} />
<Stack.Screen name="Library" component={LibraryScreen} />
</>
):
(<>
) : user.role == 'warden' ? (
<>
<Stack.Screen name="WardenMain" component={WardenTabNavigator} />
{/* <Stack.Screen name="Outpass" component={OutpassScreen} /> */}
{/* <Stack.Screen name="Emergency" component={EmergencyScreen} /> */}
{/* <Stack.Screen name="Profile" component={ProfileScreen} /> */}
<Stack.Screen name="Scan" component={Scanner} />

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are here these comments when they are not being used.


</>
) : (
<>
<Stack.Screen name="GuardMain" component={GuardDashboardScreen} />
<Stack.Screen name="SAC" component={SACScreen} />
<Stack.Screen name="CreateOutpass" component={CreateOutpassScreen} />
Expand Down
11 changes: 11 additions & 0 deletions UPDATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,14 @@
- Your password will get updated and next time when you try to login you have to enter the newly setted password.



*** WARDEN SIDE ACTIVE ***

1. The warden is now able to register without any fail.
2. The warden dashboard fails to load the page but it appears with 3 tabs- Dashboard, Approvals and Profile

3. Profile page is not getting loaded still but.




2 changes: 2 additions & 0 deletions components/OutpassCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,5 @@ const styles = StyleSheet.create({
marginTop: SPACING.xs,
},
})


2 changes: 1 addition & 1 deletion components/StudentRegisterCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function StudentRegisterCard({ formData, updateFormData, departme
<Ionicons name="school-outline" size={20} color={colors.text} style={styles.inputIcon} />
<TextInput
style={[styles.input, { color: colors.text }]}
placeholder="Student ID*"
placeholder="Student ID"
placeholderTextColor={colors.text}
value={formData.studentId}
onChangeText={value => updateFormData('studentId', value)}
Expand Down
Loading