Added app reducer, fixed package issues, begun camera screen updates

This commit is contained in:
Patrick Fic
2020-11-09 18:43:59 -08:00
parent 86744ff29a
commit ab1e04f564
22 changed files with 653 additions and 68 deletions

View File

@@ -47,6 +47,37 @@
</concept_node> </concept_node>
</children> </children>
</folder_node> </folder_node>
<folder_node>
<name>camera</name>
<children>
<folder_node>
<name>titles</name>
<children>
<concept_node>
<name>cameratab</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
</children>
</folder_node>
</children>
</folder_node>
<folder_node> <folder_node>
<name>general</name> <name>general</name>
<children> <children>

View File

@@ -18,7 +18,7 @@ const mapStateToProps = createStructuredSelector({
export function JobListComponent({ bodyshop }) { export function JobListComponent({ bodyshop }) {
const { loading, error, data, refetch } = useQuery(QUERY_ALL_ACTIVE_JOBS, { const { loading, error, data, refetch } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
variables: { variables: {
statuses: bodyshop.md_ro_statuses.open_statuses || ["Open", "Open*"], statuses: bodyshop.md_ro_statuses.active_statuses || ["Open", "Open*"],
}, },
skip: !bodyshop, skip: !bodyshop,
}); });

View File

@@ -18,7 +18,7 @@ export default function JobNotes({ job, loading, refetch }) {
<Text>Job is not defined.</Text> <Text>Job is not defined.</Text>
</Card>; </Card>;
} }
console.log("job.notes :>> ", job.notes);
const onRefresh = async () => { const onRefresh = async () => {
return refetch(); return refetch();
}; };

View File

@@ -7,16 +7,36 @@ import {
MaterialCommunityIcons, MaterialCommunityIcons,
} from "@expo/vector-icons"; } from "@expo/vector-icons";
import { useNavigation } from "@react-navigation/native"; import { useNavigation } from "@react-navigation/native";
import * as FileSystem from "expo-file-system";
import * as Permissions from "expo-permissions";
import * as MediaLibrary from "expo-media-library";
export default function ScreenCamera() { export default function ScreenCamera() {
const navigation = useNavigation(); const navigation = useNavigation();
const [hasPermission, setHasPermission] = useState(null); const [hasPermission, setHasPermission] = useState(null);
const [rollPermision, setRollPermission] = useState(null);
const [type, setType] = useState(Camera.Constants.Type.back); const [type, setType] = useState(Camera.Constants.Type.back);
const cameraRef = useRef(null); const cameraRef = useRef(null);
useEffect(() => { useEffect(() => {
(async () => { (async () => {
//Ensure local photo direcotry exists.
console.log(
"ScreenCamera -> FileSystem.documentDirectory ",
FileSystem.documentDirectory
);
await FileSystem.makeDirectoryAsync(
FileSystem.documentDirectory + "photos"
).catch((e) => {
console.log(e, "Directoryc already exists");
});
const { status } = await Camera.requestPermissionsAsync(); const { status } = await Camera.requestPermissionsAsync();
setHasPermission(status === "granted"); setHasPermission(status === "granted");
// camera roll
const { cam_roll } = await Permissions.askAsync(Permissions.CAMERA_ROLL);
setRollPermission(cam_roll === "granted");
})(); })();
}, []); }, []);
@@ -31,8 +51,29 @@ export default function ScreenCamera() {
const handleTakePicture = async () => { const handleTakePicture = async () => {
console.log("Taking the picture!"); console.log("Taking the picture!");
if (cameraRef.current) { if (cameraRef.current) {
let photo = await cameraRef.current.takePictureAsync(); const options = {
console.log("The Photo", photo); //quality: 0.5,
//base64: true,
//skipProcessing: true,
};
let photo = await cameraRef.current.takePictureAsync(options);
console.log("ScreenCamera -> photo", photo);
const filename = new Date().getTime() + ".jpg";
await FileSystem.copyAsync({
from: photo.uri,
to: FileSystem.documentDirectory + "photos/" + filename,
});
console.log(
"List of Files",
await FileSystem.readDirectoryAsync(FileSystem.documentDirectory),
await FileSystem.readDirectoryAsync(
FileSystem.documentDirectory + "photos"
)
);
//const asset = await MediaLibrary.createAssetAsync(photo.uri);
} }
}; };

View File

@@ -75,11 +75,25 @@ const JobStackNavigator = ({ navigation }) => (
i18n.t("joblist.labels.detail"), i18n.t("joblist.labels.detail"),
})} })}
/> />
<JobStack.Screen name="JobCamera" component={ScreenCamera} /> <JobStack.Screen
name="JobCamera"
options={{ headerShown: false }}
component={ScreenCamera}
/>
<JobStack.Screen name="MediaCache" component={ScreenMediaCache} /> <JobStack.Screen name="MediaCache" component={ScreenMediaCache} />
</JobStack.Navigator> </JobStack.Navigator>
); );
const CameraStackNavigator = ({ navigation }) => (
<JobStack.Navigator initialRouteName="TabCamera">
<JobStack.Screen
name="TabCamera"
options={{ headerShown: false }}
component={ScreenCamera}
/>
<JobStack.Screen name="MediaCache" component={ScreenMediaCache} />
</JobStack.Navigator>
);
const MessagingStackNavigator = ({ navigation }) => ( const MessagingStackNavigator = ({ navigation }) => (
<MessagingStack.Navigator> <MessagingStack.Navigator>
<MessagingStack.Screen <MessagingStack.Screen
@@ -102,6 +116,8 @@ const BottomTabsNavigator = () => (
iconName = "ios-list"; iconName = "ios-list";
} else if (route.name === "MessagingTab") { } else if (route.name === "MessagingTab") {
iconName = "ios-chatboxes"; iconName = "ios-chatboxes";
} else if (route.name === "CameraTab") {
iconName = "ios-camera";
} }
return <Ionicons name={iconName} size={size} color={color} />; return <Ionicons name={iconName} size={size} color={color} />;
}, },
@@ -116,6 +132,11 @@ const BottomTabsNavigator = () => (
options={{ title: i18n.t("joblist.titles.jobtab") }} options={{ title: i18n.t("joblist.titles.jobtab") }}
component={JobStackNavigator} component={JobStackNavigator}
/> />
<BottomTabs.Screen
name="CameraTab"
options={{ title: i18n.t("camera.titles.cameratab") }}
component={CameraStackNavigator}
/>
<BottomTabs.Screen <BottomTabs.Screen
name="MessagingTab" name="MessagingTab"
options={{ title: i18n.t("messaging.titles.messagingtab") }} options={{ title: i18n.t("messaging.titles.messagingtab") }}

View File

@@ -1,16 +1,247 @@
import React from "react"; // import React, { useEffect } from "react";
import { View, Text } from "react-native"; // import * as FileSystem from "expo-file-system";
import * as FileSystem from "expo-file-system"; // import { Button, Image, View, Text } from "react-native";
// import * as ImagePicker from "expo-image-picker";
// import Constants from "expo-constants";
// import * as Permissions from "expo-permissions";
export default function ScreenMediaCache() { // export default function ScreenMediaCache() {
console.log("DocDir", FileSystem.documentDirectory); // FileSystem.readDirectoryAsync(FileSystem.documentDirectory).then((p) => {
// console.log(p);
// });
FileSystem.readDirectoryAsync(FileSystem.documentDirectory).then((p) => { // useEffect(() => {
console.log(p); // (async () => {
}); // if (Constants.platform.ios) {
return ( // const { status } = await Permissions.askAsync(Permissions.CAMERA_ROLL);
<View> // if (status !== "granted") {
<Text>This is the media cache screen.</Text> // alert("Sorry, we need camera roll permissions to make this work!");
</View> // }
); // }
// })();
// }, []);
// return (
// <View>
// <Text>This is the media cache screen.</Text>
// <Button title="Pick an Image from Album" />
// {image && (
// <Image source={{ uri: image }} style={{ width: 200, height: 200 }} />
// )}
// </View>
// );
// }
import React, { Component } from "react";
import {
ActivityIndicator,
Button,
Clipboard,
Image,
Share,
StatusBar,
StyleSheet,
Text,
TouchableOpacity,
View,
} from "react-native";
import { Constants } from "expo";
import * as Permissions from "expo-permissions";
import * as ImagePicker from "expo-image-picker";
export default class App extends Component {
state = {
image: null,
uploading: false,
};
render() {
let { image } = this.state;
return (
<View style={styles.container}>
<StatusBar barStyle="default" />
<Text style={styles.exampleText}>
Example: Upload ImagePicker result
</Text>
<Button
onPress={this._pickImage}
title="Pick an image from camera roll"
/>
<Button onPress={this._takePhoto} title="Take a photo" />
{this._maybeRenderImage()}
{this._maybeRenderUploadingOverlay()}
</View>
);
}
_maybeRenderUploadingOverlay = () => {
if (this.state.uploading) {
return (
<View style={[StyleSheet.absoluteFill, styles.maybeRenderUploading]}>
<ActivityIndicator color="#fff" size="large" />
</View>
);
}
};
_maybeRenderImage = () => {
let { image } = this.state;
if (!image) {
return;
}
return (
<View style={styles.maybeRenderContainer}>
<View style={styles.maybeRenderImageContainer}>
<Image source={{ uri: image }} style={styles.maybeRenderImage} />
</View>
<Text
onPress={this._copyToClipboard}
onLongPress={this._share}
style={styles.maybeRenderImageText}
>
{image}
</Text>
</View>
);
};
_share = () => {
Share.share({
message: this.state.image,
title: "Check out this photo",
url: this.state.image,
});
};
_copyToClipboard = () => {
Clipboard.setString(this.state.image);
alert("Copied image URL to clipboard");
};
_takePhoto = async () => {
const { status: cameraPerm } = await Permissions.askAsync(
Permissions.CAMERA
);
const { status: cameraRollPerm } = await Permissions.askAsync(
Permissions.CAMERA_ROLL
);
// only if user allows permission to camera AND camera roll
if (cameraPerm === "granted" && cameraRollPerm === "granted") {
let pickerResult = await ImagePicker.launchCameraAsync({
allowsMultipleSelection: true,
quality: 0.8,
//allowsEditing: true,
aspect: [4, 3],
});
if (!pickerResult.cancelled) {
this.setState({ image: pickerResult.uri });
}
this.uploadImageAsync(pickerResult.uri);
}
};
_pickImage = async () => {
const { status: cameraRollPerm } = await Permissions.askAsync(
Permissions.CAMERA_ROLL
);
// only if user allows permission to camera roll
if (cameraRollPerm === "granted") {
let pickerResult = await ImagePicker.launchImageLibraryAsync({
allowsEditing: true,
base64: true,
aspect: [4, 3],
});
if (!pickerResult.cancelled) {
this.setState({ image: pickerResult.uri });
}
this.uploadImageAsync(pickerResult.uri);
}
};
uploadImageAsync(pictureuri) {
let apiUrl = "http://123.123.123.123/ABC";
var data = new FormData();
data.append("file", {
uri: pictureuri,
name: "file",
type: "image/jpg",
});
fetch(apiUrl, {
headers: {
Accept: "application/json",
"Content-Type": "multipart/form-data",
},
method: "POST",
body: data,
})
.then((response) => {
console.log("succ ");
console.log(response);
})
.catch((err) => {
console.log("err ");
console.log(err);
});
}
} }
const styles = StyleSheet.create({
container: {
alignItems: "center",
flex: 1,
justifyContent: "center",
},
exampleText: {
fontSize: 20,
marginBottom: 20,
marginHorizontal: 15,
textAlign: "center",
},
maybeRenderUploading: {
alignItems: "center",
backgroundColor: "rgba(0,0,0,0.4)",
justifyContent: "center",
},
maybeRenderContainer: {
borderRadius: 3,
elevation: 2,
marginTop: 30,
shadowColor: "rgba(0,0,0,1)",
shadowOpacity: 0.2,
shadowOffset: {
height: 4,
width: 4,
},
shadowRadius: 5,
width: 250,
},
maybeRenderImageContainer: {
borderTopLeftRadius: 3,
borderTopRightRadius: 3,
overflow: "hidden",
},
maybeRenderImage: {
height: 250,
width: 250,
},
maybeRenderImageText: {
paddingHorizontal: 10,
paddingVertical: 10,
},
});

View File

@@ -42,15 +42,15 @@ const wsLink = new WebSocketLink({
const errorLink = onError( const errorLink = onError(
({ graphQLErrors, networkError, operation, forward }) => { ({ graphQLErrors, networkError, operation, forward }) => {
console.log(graphQLErrors); console.error(graphQLErrors);
if (graphQLErrors) if (graphQLErrors)
graphQLErrors.forEach(({ message, locations, path }) => graphQLErrors.forEach(({ message, locations, path }) =>
console.log( console.error(
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}` `[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`
) )
); );
if (networkError) if (networkError)
console.log(`[Network error]: ${JSON.stringify(networkError)}`); console.error(`[Network error]: ${JSON.stringify(networkError)}`);
console.log(operation.getContext()); console.log(operation.getContext());
} }
); );

View File

@@ -126,7 +126,7 @@ export const QUERY_JOB_COSTING_DETAILS = gql`
ded_amt ded_amt
ded_status ded_status
depreciation_taxes depreciation_taxes
federal_tax_payable
other_amount_payable other_amount_payable
towing_payable towing_payable
storage_payable storage_payable
@@ -143,7 +143,7 @@ export const QUERY_JOB_COSTING_DETAILS = gql`
parts_tax_rates parts_tax_rates
job_totals job_totals
labor_rate_desc labor_rate_desc
rate_atp
rate_la1 rate_la1
rate_la2 rate_la2
rate_la3 rate_la3
@@ -289,7 +289,7 @@ export const GET_JOB_BY_PK = gql`
ded_amt ded_amt
ded_status ded_status
depreciation_taxes depreciation_taxes
federal_tax_payable
other_amount_payable other_amount_payable
towing_payable towing_payable
storage_payable storage_payable
@@ -329,7 +329,7 @@ export const GET_JOB_BY_PK = gql`
ownr_ph1 ownr_ph1
} }
labor_rate_desc labor_rate_desc
rate_atp
rate_la1 rate_la1
rate_la2 rate_la2
rate_la3 rate_la3
@@ -716,7 +716,7 @@ export const QUERY_ALL_JOB_FIELDS = gql`
est_ph1 est_ph1
est_st est_st
est_zip est_zip
federal_tax_payable
federal_tax_rate federal_tax_rate
g_bett_amt g_bett_amt
ins_addr1 ins_addr1
@@ -791,7 +791,7 @@ export const QUERY_ALL_JOB_FIELDS = gql`
plate_st plate_st
po_number po_number
policy_no policy_no
rate_atp
rate_la1 rate_la1
rate_la2 rate_la2
rate_la3 rate_la3
@@ -981,7 +981,7 @@ export const QUERY_JOB_CLOSE_DETAILS = gql`
ded_amt ded_amt
ded_status ded_status
depreciation_taxes depreciation_taxes
federal_tax_payable
other_amount_payable other_amount_payable
towing_payable towing_payable
storage_payable storage_payable
@@ -1007,7 +1007,7 @@ export const QUERY_JOB_CLOSE_DETAILS = gql`
ownr_zip ownr_zip
ownr_ctry ownr_ctry
ownr_ph1 ownr_ph1
rate_atp
rate_la1 rate_la1
rate_la2 rate_la2
rate_la3 rate_la3
@@ -1065,10 +1065,6 @@ export const generate_UPDATE_JOB_KANBAN = (
newChildId, newChildId,
newChildParent newChildParent
) => { ) => {
// console.log("oldChildId", oldChildId, "oldChildNewParent", oldChildNewParent);
// console.log("Moved", movedId, movedNewParent, movedNewStatus);
// console.log("new", newChildId, newChildParent);
const oldChildQuery = ` const oldChildQuery = `
updateOldChild: update_jobs(where: { id: { _eq: "${oldChildId}" } }, updateOldChild: update_jobs(where: { id: { _eq: "${oldChildId}" } },
_set: {kanbanparent: ${ _set: {kanbanparent: ${

View File

@@ -20,7 +20,10 @@
"expo-camera": "~9.0.0", "expo-camera": "~9.0.0",
"expo-file-system": "~9.2.0", "expo-file-system": "~9.2.0",
"expo-font": "~8.3.0", "expo-font": "~8.3.0",
"expo-image-picker": "~9.1.1",
"expo-localization": "~9.0.0", "expo-localization": "~9.0.0",
"expo-media-library": "~9.2.1",
"expo-permissions": "~9.3.0",
"expo-status-bar": "~1.0.2", "expo-status-bar": "~1.0.2",
"firebase": "7.9.0", "firebase": "7.9.0",
"formik": "^2.2.3", "formik": "^2.2.3",

21
redux/app/app.actions.js Normal file
View File

@@ -0,0 +1,21 @@
import AppActionTypes from "./app.types";
export const setCameraJobId = (jobId) => ({
type: AppActionTypes.SET_CAMERA_JOB_ID,
payload: jobId,
});
export const documentUploadStart = (jobId) => ({
type: AppActionTypes.DOCUMENT_UPLOAD_START,
payload: jobId,
});
export const documentUploadSuccess = (jobId) => ({
type: AppActionTypes.DOCUMNET_UPLOAD_SUCCESS,
payload: jobId,
});
export const documentUploadFailure = (error) => ({
type: AppActionTypes.DOCUMENT_UPLOAD_FAILURE,
payload: error,
});

39
redux/app/app.reducer.js Normal file
View File

@@ -0,0 +1,39 @@
import AppActionTypes from "./app.types";
const INITIAL_STATE = {
cameraJobId: null,
documentUploadInProgress: null,
documentUploadError: null,
};
const appReducer = (state = INITIAL_STATE, action) => {
switch (action.type) {
case AppActionTypes.SET_CAMERA_JOB_ID:
return {
...state,
cameraJobId: action.payload,
};
case AppActionTypes.DOCUMENT_UPLOAD_START:
return {
...state,
documentUploadError: null,
documentUploadInProgress: action.payload,
};
case AppActionTypes.DOCUMNET_UPLOAD_SUCCESS:
return {
...state,
documentUploadError: null,
documentUploadInProgress: null,
};
case AppActionTypes.DOCUMENT_UPLOAD_FAILURE:
return {
...state,
documentUploadError: action.payload,
documentUploadInProgress: null,
};
default:
return state;
}
};
export default appReducer;

158
redux/app/app.sagas.js Normal file
View File

@@ -0,0 +1,158 @@
import {
all,
//call, put, takeLatest
} from "redux-saga/effects";
// import {
// auth,
// getCurrentUser,
// updateCurrentUser,
// } from "../../firebase/firebase.utils";
// import {
// sendPasswordResetFailure,
// sendPasswordResetSuccess,
// signInFailure,
// signInSuccess,
// signOutFailure,
// signOutSuccess,
// unauthorizedUser,
// updateUserDetailsSuccess,
// validatePasswordResetFailure,
// validatePasswordResetSuccess,
// setBodyshop,
// } from "./user.actions";
// import UserActionTypes from "./user.types";
// import { client } from "../../graphql/client";
// import { QUERY_BODYSHOP } from "../../graphql/bodyshop.queries";
// export function* onEmailSignInStart() {
// yield takeLatest(UserActionTypes.EMAIL_SIGN_IN_START, signInWithEmail);
// }
// export function* signInWithEmail({ payload: { email, password } }) {
// try {
// //logImEXEvent("redux_sign_in_attempt", { user: email });
// const { user } = yield auth.signInWithEmailAndPassword(email, password);
// yield put(
// signInSuccess({
// uid: user.uid,
// email: user.email,
// displayName: user.displayName,
// photoURL: user.photoURL,
// authorized: true,
// })
// );
// } catch (error) {
// yield put(signInFailure(error));
// //logImEXEvent("redux_sign_in_failure", { user: email, error });
// }
// }
// export function* onCheckUserSession() {
// yield takeLatest(UserActionTypes.CHECK_USER_SESSION, isUserAuthenticated);
// }
// export function* isUserAuthenticated() {
// try {
// //logImEXEvent("redux_auth_check");
// const user = yield getCurrentUser();
// if (!user) {
// yield put(unauthorizedUser());
// return;
// }
// yield put(
// signInSuccess({
// uid: user.uid,
// email: user.email,
// displayName: user.displayName,
// photoURL: user.photoURL,
// authorized: true,
// })
// );
// } catch (error) {
// yield put(signInFailure(error));
// }
// }
// export function* onSignOutStart() {
// yield takeLatest(UserActionTypes.SIGN_OUT_START, signOutStart);
// }
// export function* signOutStart() {
// try {
// //logImEXEvent("redux_sign_out");
// yield auth.signOut();
// yield put(signOutSuccess());
// } catch (error) {
// yield put(signOutFailure(error.message));
// }
// }
// export function* onUpdateUserDetails() {
// yield takeLatest(UserActionTypes.UPDATE_USER_DETAILS, updateUserDetails);
// }
// export function* updateUserDetails(userDetails) {
// try {
// yield updateCurrentUser(userDetails.payload);
// yield put(updateUserDetailsSuccess(userDetails.payload));
// } catch (error) {
// //yield put(signOutFailure(error.message));
// //TODO error handling
// }
// }
// export function* onSignInSuccess() {
// yield takeLatest(UserActionTypes.SIGN_IN_SUCCESS, signInSuccessSaga);
// }
// export function* signInSuccessSaga({ payload }) {
// try {
// const shop = yield client.query({ query: QUERY_BODYSHOP });
// yield put(setBodyshop(shop.data.bodyshops[0]));
// } catch (error) {
// console.log("UH-OH. Couldn't get shop details.", error);
// }
// }
// export function* onSendPasswordResetStart() {
// yield takeLatest(
// UserActionTypes.SEND_PASSWORD_RESET_EMAIL_START,
// sendPasswordResetEmail
// );
// }
// export function* sendPasswordResetEmail({ payload }) {
// try {
// yield auth.sendPasswordResetEmail(payload, {
// url: "https://imex.online/passwordreset",
// });
// yield put(sendPasswordResetSuccess());
// } catch (error) {
// yield put(sendPasswordResetFailure(error.message));
// }
// }
// export function* onValidatePasswordResetStart() {
// yield takeLatest(
// UserActionTypes.VALIDATE_PASSWORD_RESET_START,
// validatePasswordResetStart
// );
// }
// export function* validatePasswordResetStart({ payload: { password, code } }) {
// try {
// yield auth.confirmPasswordReset(code, password);
// yield put(validatePasswordResetSuccess());
// } catch (error) {
// yield put(validatePasswordResetFailure(error.message));
// }
// }
export function* appSagas() {
yield all([
// call(onEmailSignInStart),
// call(onCheckUserSession),
// call(onSignOutStart),
// call(onUpdateUserDetails),
// call(onSignInSuccess),
// call(onSendPasswordResetStart),
// call(onValidatePasswordResetStart),
]);
}

View File

@@ -0,0 +1,16 @@
import { createSelector } from "reselect";
const selectApp = (state) => state.app;
export const selectCurrentCameraJobId = createSelector(
[selectApp],
(user) => app.cameraJobId
);
export const selectDocumentUploadInProgress = createSelector(
[selectApp],
(user) => app.documentUploadInProgress
);
export const selectDocumentUploadError = createSelector(
[selectApp],
(user) => app.documentUploadError
);

7
redux/app/app.types.js Normal file
View File

@@ -0,0 +1,7 @@
const AppActionTypes = {
SET_CAMERA_JOB_ID: "SET_CAMERA_JOB_ID",
DOCUMENT_UPLOAD_START: "DOCUMENT_UPLOAD_START",
DOCUMNET_UPLOAD_SUCCESS: "DOCUMNET_UPLOAD_SUCCESS",
DOCUMENT_UPLOAD_FAILURE: "DOCUMENT_UPLOAD_FAILURE",
};
export default AppActionTypes;

View File

@@ -1,30 +1,21 @@
import AsyncStorage from "@react-native-community/async-storage";
import { combineReducers } from "redux"; import { combineReducers } from "redux";
import { persistReducer } from "redux-persist"; import { persistReducer } from "redux-persist";
import AsyncStorage from "@react-native-community/async-storage"; import appReducer from "./app/app.reducer";
import userReducer from "./user/user.reducer"; import userReducer from "./user/user.reducer";
// import messagingReducer from "./messaging/messaging.reducer";
// import emailReducer from "./email/email.reducer";
// import modalsReducer from "./modals/modals.reducer";
// import applicationReducer from "./application/application.reducer";
// import techReducer from "./tech/tech.reducer";
const persistConfig = { const persistConfig = {
key: "root", key: "root",
storage: AsyncStorage, storage: AsyncStorage,
whitelist: [], whitelist: [],
blacklist: ["user"], blacklist: ["user", "app"],
// whitelist: ["messaging", "tech", "application"], // whitelist: ["messaging", "tech", "application"],
// blacklist: ["user", "email", "modals"], // blacklist: ["user", "email", "modals"],
}; };
const rootReducer = combineReducers({ const rootReducer = combineReducers({
user: userReducer, user: userReducer,
// messaging: messagingReducer, app: appReducer,
// email: emailReducer,
// modals: modalsReducer,
// application: applicationReducer,
// tech: techReducer,
}); });
export default persistReducer(persistConfig, rootReducer); export default persistReducer(persistConfig, rootReducer);

View File

@@ -1,19 +1,7 @@
import { all, call } from "redux-saga/effects"; import { all, call } from "redux-saga/effects";
import { appSagas } from "./app/app.sagas";
import { userSagas } from "./user/user.sagas"; import { userSagas } from "./user/user.sagas";
// import { messagingSagas } from "./messaging/messaging.sagas";
// import { emailSagas } from "./email/email.sagas";
// import { modalsSagas } from "./modals/modals.sagas";
// import { applicationSagas } from "./application/application.sagas";
// import { techSagas } from "./tech/tech.sagas";
export default function* rootSaga() { export default function* rootSaga() {
yield all([ yield all([call(userSagas), call(appSagas)]);
call(userSagas),
// call(messagingSagas),
// call(emailSagas),
// call(modalsSagas),
// call(applicationSagas),
// call(techSagas),
]);
} }

View File

@@ -10,14 +10,23 @@ const sagaMiddleWare = createSagaMiddleware();
const middlewares = [sagaMiddleWare]; const middlewares = [sagaMiddleWare];
if (process.env.NODE_ENV === "development") { if (process.env.NODE_ENV === "development") {
middlewares.push( middlewares
createLogger({ .push
collapsed: true, // createLogger({
}) // collapsed: true,
); // })
();
} }
const enhancer = compose( //Add in for React Native Debugger.
const composeEnhancers =
typeof window === "object" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
// Specify extensions options like name, actionsBlacklist, actionsCreators, serialize...
})
: compose;
const enhancer = composeEnhancers(
applyMiddleware(...middlewares) applyMiddleware(...middlewares)
// other store enhancers if any // other store enhancers if any
); );

View File

@@ -106,7 +106,7 @@ export function* signInSuccessSaga({ payload }) {
yield put(setBodyshop(shop.data.bodyshops[0])); yield put(setBodyshop(shop.data.bodyshops[0]));
} catch (error) { } catch (error) {
console.log("UHOH. Couldn't get shop details.", error); console.log("UH-OH. Couldn't get shop details.", error);
} }
} }

View File

@@ -3,6 +3,11 @@
"app": { "app": {
"title": "ImEX Mobile" "title": "ImEX Mobile"
}, },
"camera": {
"titles": {
"cameratab": "Camera"
}
},
"general": { "general": {
"actions": { "actions": {
"signout": "Sign Out" "signout": "Sign Out"

View File

@@ -3,6 +3,11 @@
"app": { "app": {
"title": "" "title": ""
}, },
"camera": {
"titles": {
"cameratab": ""
}
},
"general": { "general": {
"actions": { "actions": {
"signout": "" "signout": ""

View File

@@ -3,6 +3,11 @@
"app": { "app": {
"title": "" "title": ""
}, },
"camera": {
"titles": {
"cameratab": ""
}
},
"general": { "general": {
"actions": { "actions": {
"signout": "" "signout": ""

View File

@@ -3242,6 +3242,14 @@ expo-font@~8.3.0:
fbjs "1.0.0" fbjs "1.0.0"
fontfaceobserver "^2.1.0" fontfaceobserver "^2.1.0"
expo-image-picker@~9.1.1:
version "9.1.1"
resolved "https://registry.yarnpkg.com/expo-image-picker/-/expo-image-picker-9.1.1.tgz#42abe9deb595fa9f9d8ac0d2ba8aad2cd6f69581"
integrity sha512-Etz2OQhRflfx+xFbSdma8QLZsnV/yq0M/yqYlsi3/RLiWAQYM/D/VmRfDDPiG10gm+KX3Xb5iKplNjPrWeTuQg==
dependencies:
expo-permissions "~9.3.0"
uuid "7.0.2"
expo-keep-awake@~8.3.0: expo-keep-awake@~8.3.0:
version "8.3.0" version "8.3.0"
resolved "https://registry.yarnpkg.com/expo-keep-awake/-/expo-keep-awake-8.3.0.tgz#11bb8073dfe453259926855c81d9f35db03a79b9" resolved "https://registry.yarnpkg.com/expo-keep-awake/-/expo-keep-awake-8.3.0.tgz#11bb8073dfe453259926855c81d9f35db03a79b9"
@@ -3273,6 +3281,11 @@ expo-location@~9.0.0:
resolved "https://registry.yarnpkg.com/expo-location/-/expo-location-9.0.1.tgz#adf93b8adf5e9dcf9570cba1d66c8e3831329156" resolved "https://registry.yarnpkg.com/expo-location/-/expo-location-9.0.1.tgz#adf93b8adf5e9dcf9570cba1d66c8e3831329156"
integrity sha512-yl4V2IelxrjG1h3nshkyILwghysNJvvEuR4Of0U7oYAsBrT0cq8NxFuaDemRvqt9Yb19wVFNMoVtYFNpthcqpQ== integrity sha512-yl4V2IelxrjG1h3nshkyILwghysNJvvEuR4Of0U7oYAsBrT0cq8NxFuaDemRvqt9Yb19wVFNMoVtYFNpthcqpQ==
expo-media-library@~9.2.1:
version "9.2.1"
resolved "https://registry.yarnpkg.com/expo-media-library/-/expo-media-library-9.2.1.tgz#11583e40087d77cf16e70bb7db0048d2bd1938b5"
integrity sha512-A9AAGI1200P0oULoXA7U7wQ91zgPWl9GWo5H9EQvVDHp1ABX8tf2qTOad6Y0KotHYWVMIyfsVXzVYAbjJ9LxPQ==
expo-permissions@~9.3.0: expo-permissions@~9.3.0:
version "9.3.0" version "9.3.0"
resolved "https://registry.yarnpkg.com/expo-permissions/-/expo-permissions-9.3.0.tgz#b90c7e9e411d306c1c7ba2bae18d5c53c201affd" resolved "https://registry.yarnpkg.com/expo-permissions/-/expo-permissions-9.3.0.tgz#b90c7e9e411d306c1c7ba2bae18d5c53c201affd"
@@ -3298,7 +3311,7 @@ expo-status-bar@~1.0.2:
resolved "https://registry.yarnpkg.com/expo-status-bar/-/expo-status-bar-1.0.2.tgz#2441a77c56be31597898337b0d086981f2adefd8" resolved "https://registry.yarnpkg.com/expo-status-bar/-/expo-status-bar-1.0.2.tgz#2441a77c56be31597898337b0d086981f2adefd8"
integrity sha512-5313u744GcLzCadxIPXyTkYw77++UXv1dXCuhYDxDbtsEf93iMra7WSvzyE8a7mRQLIIPRuGnBOdrL/V1C7EOQ== integrity sha512-5313u744GcLzCadxIPXyTkYw77++UXv1dXCuhYDxDbtsEf93iMra7WSvzyE8a7mRQLIIPRuGnBOdrL/V1C7EOQ==
expo@^39.0.0: expo@^39.0.4:
version "39.0.4" version "39.0.4"
resolved "https://registry.yarnpkg.com/expo/-/expo-39.0.4.tgz#320b7453ac055fc37c64942d5ba442f4e2781993" resolved "https://registry.yarnpkg.com/expo/-/expo-39.0.4.tgz#320b7453ac055fc37c64942d5ba442f4e2781993"
integrity sha512-lyd7VSg0DG+I2CwWtOHwhmMwgANoqggqU1ooWRdO4KdWPYA8hWMMsLC2vBBBemKv3PPwxhl9hhzFxtjJ/MaR7g== integrity sha512-lyd7VSg0DG+I2CwWtOHwhmMwgANoqggqU1ooWRdO4KdWPYA8hWMMsLC2vBBBemKv3PPwxhl9hhzFxtjJ/MaR7g==
@@ -6953,6 +6966,11 @@ utils-merge@1.0.1:
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=
uuid@7.0.2:
version "7.0.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-7.0.2.tgz#7ff5c203467e91f5e0d85cfcbaaf7d2ebbca9be6"
integrity sha512-vy9V/+pKG+5ZTYKf+VcphF5Oc6EFiu3W8Nv3P3zIh0EqVI80ZxOzuPfe9EHjkFNvf8+xuTHVeei4Drydlx4zjw==
uuid@^3.3.2, uuid@^3.4.0: uuid@^3.3.2, uuid@^3.4.0:
version "3.4.0" version "3.4.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"