Skip to content

Commit

Permalink
feat(#49): User Story: As a new rider, I want to provide my personal …
Browse files Browse the repository at this point in the history
…information to create an account.

- refactoring
- deleting no neded stuff from the driver
  • Loading branch information
chriscoderdr committed Nov 6, 2024
1 parent bfe825d commit 87f12fd
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 572 deletions.
3 changes: 0 additions & 3 deletions apps/rider-app/app/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import {
} from 'react-native-morro-taxi-rn-components';

export default function Home() {
// // useBackgroundLocation(); // TODO: Implement useBackgroundLocation hook
// useForegroundLocation();

return (
<View style={{ flex: 1 }}>
<PermissionBlocker>
Expand Down
5 changes: 0 additions & 5 deletions apps/rider-app/app/signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,10 @@ import { useSelector } from 'react-redux';
export default function SignUp() {
const dispatch = useAppDispatch();
const isLoading = useSelector((state: RootState) => state.auth.loading);
const error = useSelector((state: RootState) => state.auth.error);
const user = useSelector((state: RootState) => state.auth.user);
const router = useRouter();

const onRegisterUser = (data: IRegisterUser) => {
dispatch(registerUser({ ...data }));
console.log('Registering user:', data);
console.log('Error:', error);
console.log(`user: ${user}`);
};

const onGoToLogin = () => {
Expand Down
26 changes: 0 additions & 26 deletions apps/rider-app/constants/Colors.ts

This file was deleted.

1 change: 0 additions & 1 deletion apps/rider-app/hooks/useColorScheme.ts

This file was deleted.

8 changes: 0 additions & 8 deletions apps/rider-app/hooks/useColorScheme.web.ts

This file was deleted.

22 changes: 0 additions & 22 deletions apps/rider-app/hooks/useThemeColor.ts

This file was deleted.

27 changes: 0 additions & 27 deletions apps/rider-app/src/api/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,6 @@ export interface LoginResponse extends ApiResponse {
refreshToken: string;
}

export interface AcceptRequestData {
rideRequestId: string;
}

export interface AcceptRequestResponse extends ApiResponse {
rideRequestId: string;
riderName: string;
riderPhone: string;
pickupLocation: {
type: 'Point';
coordinates: [number, number];
};
dropOffLocation: {
type: 'Point';
coordinates: [number, number];
};
}

export interface StartRequestData {
rideRequestId: string;
}

export interface StartRequestResponse extends ApiResponse {
rideRequestId: string;
status: 'started';
}

interface Location {
latitude: number;
longitude: number;
Expand Down
8 changes: 2 additions & 6 deletions apps/rider-app/src/store/index.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import { apiSlice } from '@/src/store/slices/api-slice';
import authReducer from '@/src/store/slices/auth-slice';
import mqttReducer from '@/src/store/slices/mqtt-slice';
import rideRequestReducer from '@/src/store/slices/ride-request-slice';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { combineReducers, configureStore } from '@reduxjs/toolkit';
import { persistReducer, persistStore } from 'redux-persist';

const persistConfig = {
key: 'root',
storage: AsyncStorage,
blacklist: ['mqtt', apiSlice.reducerPath]
blacklist: [apiSlice.reducerPath]
};

const reducer = combineReducers({
[apiSlice.reducerPath]: apiSlice.reducer,
auth: authReducer,
rideRequest: rideRequestReducer,
mqtt: mqttReducer
auth: authReducer
});

const persistedReducer = persistReducer(persistConfig, reducer);
Expand Down

This file was deleted.

70 changes: 0 additions & 70 deletions apps/rider-app/src/store/middleware/timeout-middleware.ts

This file was deleted.

2 changes: 1 addition & 1 deletion apps/rider-app/src/store/slices/auth-slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const registerUser = createAsyncThunk<
console.log(`debugging: ${JSON.stringify(response)}`);
return response;
} catch (response) {
console.log(`debuging error: ${JSON.stringify(response)}`);
console.log(`debuging error: ${JSON.stringify(response)}`); // TODO: refactor into a function
const status = response?.status;
let errorMessage = '';
switch (status) {
Expand Down
54 changes: 0 additions & 54 deletions apps/rider-app/src/store/slices/mqtt-slice.ts

This file was deleted.

Loading

0 comments on commit 87f12fd

Please sign in to comment.