Adjusted camera stack and app reducer.
This commit is contained in:
@@ -6,25 +6,40 @@ import { useTranslation } from "react-i18next";
|
||||
import { StyleSheet, Text, View } from "react-native";
|
||||
import { TouchableOpacity } from "react-native-gesture-handler";
|
||||
import Swipeable from "react-native-gesture-handler/Swipeable";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { setCameraJob, setCameraJobId } from "../../redux/app/app.actions";
|
||||
import styles from "../styles";
|
||||
|
||||
const RenderRightAction = (props) => {
|
||||
const navigation = useNavigation();
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<TouchableOpacity
|
||||
style={[styles.swipe_view, styles.swipe_view_blue]}
|
||||
onPress={() => navigation.push("JobCamera")}
|
||||
>
|
||||
<Ionicons name="ios-camera" size={24} color="white" />
|
||||
<Text style={styles.swipe_text}>{t("joblist.actions.swipecamera")}</Text>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
};
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setCameraJobId: (id) => dispatch(setCameraJobId(id)),
|
||||
setCameraJob: (job) => dispatch(setCameraJob(job)),
|
||||
});
|
||||
|
||||
export default function JobListItem({ item }) {
|
||||
export function JobListItem({ setCameraJob, setCameraJobId, item }) {
|
||||
const navigation = useNavigation();
|
||||
|
||||
const RenderRightAction = (props) => {
|
||||
const navigation = useNavigation();
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<TouchableOpacity
|
||||
style={[styles.swipe_view, styles.swipe_view_blue]}
|
||||
onPress={() => {
|
||||
setCameraJobId(item.id);
|
||||
setCameraJob(item);
|
||||
navigation.navigate("TabCamera");
|
||||
}}
|
||||
>
|
||||
<Ionicons name="ios-camera" size={24} color="white" />
|
||||
<Text style={styles.swipe_text}>
|
||||
{t("joblist.actions.swipecamera")}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
};
|
||||
const onPress = () => {
|
||||
navigation.push("JobDetail", {
|
||||
jobId: item.id,
|
||||
@@ -73,3 +88,4 @@ const localStyles = StyleSheet.create({
|
||||
marginLeft: 15,
|
||||
},
|
||||
});
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(JobListItem);
|
||||
|
||||
Reference in New Issue
Block a user