Skip to content

Commit

Permalink
Task fix builds (#53)
Browse files Browse the repository at this point in the history
* - fix builds

* - refactoring and bug fixing

* - refactoring driver app to use components from morrotaxi shared components

* - refactoring driver app to use shared components

* - refactoring driver app to use shared mapview

* - refactoring
  • Loading branch information
chriscoderdr authored Nov 10, 2024
1 parent 7a37db4 commit b2ba784
Show file tree
Hide file tree
Showing 192 changed files with 1,585 additions and 4,069 deletions.
4 changes: 3 additions & 1 deletion apps/driver-app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ web-build/
# The following patterns were generated by expo-cli

expo-env.d.ts
# @end expo-cli
# @end expo-cli

.env
3 changes: 2 additions & 1 deletion apps/driver-app/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down Expand Up @@ -26,7 +27,7 @@
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="myapp"/>
<data android:scheme="morrotaxidriverapp"/>
<data android:scheme="com.chriscoder.driverapp"/>
<data android:scheme="exp+driver-app"/>
</intent-filter>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions apps/driver-app/android/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources>
<color name="splashscreen_background">#ffffff</color>
<color name="splashscreen_background">#181A20</color>
<color name="iconBackground">#ffffff</color>
<color name="colorPrimary">#023c69</color>
<color name="colorPrimaryDark">#ffffff</color>
<color name="colorPrimaryDark">#181A20</color>
</resources>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">driver-app</string>
<string name="app_name">MorroTaxi Driver</string>
<string name="expo_splash_screen_resize_mode" translatable="false">contain</string>
<string name="expo_splash_screen_status_bar_translucent" translatable="false">false</string>
<string name="expo_system_ui_user_interface_style" translatable="false">automatic</string>
Expand Down
2 changes: 1 addition & 1 deletion apps/driver-app/android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<item name="android:editTextStyle">@style/ResetEditText</item>
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="android:statusBarColor">#ffffff</item>
<item name="android:statusBarColor">#181A20</item>
</style>
<style name="ResetEditText" parent="@android:style/Widget.EditText">
<item name="android:padding">0dp</item>
Expand Down
2 changes: 1 addition & 1 deletion apps/driver-app/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ EX_DEV_CLIENT_NETWORK_INSPECTOR=true
expo.useLegacyPackaging=false

expoRNMapboxMapsImpl=mapbox
expoRNMapboxMapsVersion=11.3.0
expoRNMapboxMapsVersion=11.7.1
MAPBOX_DOWNLOADS_TOKEN=sk.eyJ1IjoiY2dvbWV6bWVuZGV6IiwiYSI6ImNtMndhbDAwZjAzMXQyanNkMHF2NjR3bmUifQ.f6E28fydW9bkhLBP7L_lCQ
2 changes: 1 addition & 1 deletion apps/driver-app/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if (getRNMinorVersion() >= 75) {
}
}

rootProject.name = 'driver-app'
rootProject.name = 'MorroTaxi Driver'

dependencyResolutionManagement {
versionCatalogs {
Expand Down
27 changes: 14 additions & 13 deletions apps/driver-app/app.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
{
"expo": {
"name": "driver-app",
"name": "MorroTaxi Driver",
"slug": "driver-app",
"bundleidentifier": "com.chriscoder.driverapp",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "morrotaxidriverapp",
"userInterfaceStyle": "automatic",
"associatedDomains": [
"applinks:taxi.chriscoder.com"
],

"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
"backgroundColor": "#181A20"
},
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.chriscoder.driverapp",
"infoPlist": {
"UIBackgroundModes": [
"location",
"fetch",
"remote-notification"
]
"UIBackgroundModes": ["location", "fetch"],
"NSAppTransportSecurity": {
"NSAllowsArbitraryLoads": true
}
}
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/images/app-icon.png",
"foregroundImage": "./assets/images/icon.png",
"backgroundColor": "#ffffff"
},
"permissions": [
"ACCESS_FINE_LOCATION",
"ACCESS_COARSE_LOCATION",
"ACCESS_BACKGROUND_LOCATION"
],
"package": "com.chriscoder.driverapp"
},
"web": {
Expand All @@ -44,7 +45,7 @@
"@rnmapbox/maps",
{
"RNMapboxMapsImpl": "mapbox",
"RNMapboxMapsVersion": "11.3.0",
"RNMapboxMapsVersion": "11.7.1",
"RNMapboxMapsDownloadToken": "sk.eyJ1IjoiY2dvbWV6bWVuZGV6IiwiYSI6ImNtMndhbDAwZjAzMXQyanNkMHF2NjR3bmUifQ.f6E28fydW9bkhLBP7L_lCQ"
}
],
Expand Down
32 changes: 28 additions & 4 deletions apps/driver-app/app/login.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
import LoginForm from '@/src/components/login-form';
import ScrollableFormContainer from '@/src/components/scrollable-form-container';
import { useAppDispatch } from '@/src/hooks/use-app-dispatch';
import { RootState } from '@/src/store';
import { loginDriver } from '@/src/store/slices/auth-slice';
import { useRouter } from 'expo-router';
import {
LoginForm,
ScrollableFormContainer,
ILoginUser
} from 'react-native-morro-taxi-rn-components';
import { useSelector } from 'react-redux';

export default function Login() {
const dispatch = useAppDispatch();
const isLoading = useSelector((state: RootState) => state.auth.loading);
const router = useRouter();

const onLoginUser = (data: ILoginUser) => {
dispatch(loginDriver({ ...data }));
};

const onGoToRegister = () => {
router.navigate('/signup');
};

return (
<ScrollableFormContainer>
<LoginForm />
<LoginForm
onGoToRegister={onGoToRegister}
isLoading={isLoading}
loginUser={onLoginUser}
/>
</ScrollableFormContainer>
);
}
}
24 changes: 14 additions & 10 deletions apps/driver-app/app/main.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
import MapView from '@/src/components/map-view';
import PermissionBlocker from '@/src/components/permission-blocker';
import { PermissionBlocker } from 'react-native-morro-taxi-rn-components';
import RideRequestDashboard from '@/src/components/ride-request-dashboard';
import StatusCard from '@/src/components/status-card';
import useForegroundLocation from '@/src/hooks/use-foreground-location';
import { View } from 'react-native';

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

return (
<View style={{ flex: 1 }}>
<PermissionBlocker>
<StatusCard />
<MapView />
<RideRequestDashboard />
</PermissionBlocker>
</View>
<PermissionBlocker
title="Permissions Required"
subtitle="To receive ride requests and navigate to passengers, we need access to notifications, location, and background location. Please enable these permissions in your settings to start accepting rides."
alertTitle="Permissions Required"
alertSubtitle="We need location, background location, and notification permissions to provide ride services."
requireLocation
requireNotification
requireBackgroundLocation
>
<StatusCard />
<MapView />
<RideRequestDashboard />
</PermissionBlocker>
);
}
32 changes: 28 additions & 4 deletions apps/driver-app/app/signup.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
import ScrollableFormContainer from '@/src/components/scrollable-form-container';
import SignUpForm from '@/src/components/sign-up-form';
import { useAppDispatch } from '@/src/hooks/use-app-dispatch';
import { RootState } from '@/src/store';
import { registerDriver } from '@/src/store/slices/auth-slice';
import { useRouter } from 'expo-router';
import {
IRegisterUser,
ScrollableFormContainer,
SignUpForm
} from 'react-native-morro-taxi-rn-components';
import { useSelector } from 'react-redux';

export default function SignUp() {
const dispatch = useAppDispatch();
const isLoading = useSelector((state: RootState) => state.auth.loading);
const router = useRouter();

const onRegisterUser = (data: IRegisterUser) => {
dispatch(registerDriver({ ...data }));
};

const onGoToLogin = () => {
router.navigate('/login');
};

return (
<ScrollableFormContainer>
<SignUpForm />
<SignUpForm
isLoading={isLoading}
registerUser={onRegisterUser}
onGoToLogin={onGoToLogin}
/>
</ScrollableFormContainer>
);
}
}
Binary file removed apps/driver-app/assets/images/app-icon.jpg
Binary file not shown.
Binary file modified apps/driver-app/assets/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/driver-app/assets/images/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b2ba784

Please sign in to comment.