diff --git a/backend/CheckInApp/bin/Debug/net7.0/CheckInApp.dll b/backend/CheckInApp/bin/Debug/net7.0/CheckInApp.dll index a77c52d..c455159 100644 Binary files a/backend/CheckInApp/bin/Debug/net7.0/CheckInApp.dll and b/backend/CheckInApp/bin/Debug/net7.0/CheckInApp.dll differ diff --git a/backend/CheckInApp/bin/Debug/net7.0/CheckInApp.pdb b/backend/CheckInApp/bin/Debug/net7.0/CheckInApp.pdb index 2c0f76f..b3d7a98 100644 Binary files a/backend/CheckInApp/bin/Debug/net7.0/CheckInApp.pdb and b/backend/CheckInApp/bin/Debug/net7.0/CheckInApp.pdb differ diff --git a/frontend/CheckInApp/App.tsx b/frontend/CheckInApp/App.tsx index ee36497..80b695c 100644 --- a/frontend/CheckInApp/App.tsx +++ b/frontend/CheckInApp/App.tsx @@ -5,96 +5,91 @@ * @format */ -import React, {FC, useEffect, useState} from 'react'; -import { - Alert, - AppState, - AppStateStatus, - Button, - StyleSheet, - Text, - View, -} from 'react-native'; +import React, { FC, useEffect, useState } from 'react'; +import { Alert, AppState, AppStateStatus, Button, Text, View } from 'react-native'; +import { UserInfo, UserService } from './user.service'; -import {UserInfo, UserService} from './user.service'; - -function forceRenderHook() { - const [count, setCount] = useState(0); - return () => setCount(count + 1); -} - -const HomeScreen: FC<{userInfo: UserInfo}> = ({userInfo}) => { - const forceRender = forceRenderHook(); +const HomeScreen: FC<{ + userInfo: UserInfo | null; + onCheckIn: () => Promise; + onCheckOut: () => Promise; +}> = ({ userInfo, onCheckIn, onCheckOut }) => { const canCheckIn = - userInfo.lastCheckIn == null || + userInfo?.lastCheckIn == null || (userInfo.lastCheckIn.timeIn != null && userInfo.lastCheckIn.timeOut != null); return ( - - + + {canCheckIn ? 'User is checked-out' : 'User is checked-in'} - + {JSON.stringify(userInfo || {}, null, 4)} {canCheckIn && ( -