clean up of files

This commit is contained in:
jfrye122
2023-05-15 17:09:50 -04:00
parent b9cb922a39
commit b13e84b8e1
2 changed files with 77 additions and 104 deletions

View File

@@ -1,69 +1,29 @@
import { Ionicons } from "@expo/vector-icons";
import { useNavigation } from "@react-navigation/native";
import React from "react";
import { useTranslation } from "react-i18next";
import { Button, Card, Text } from "react-native-paper";
import { connect, useSelector, useDispatch } from "react-redux";
import { createSelector, createStructuredSelector } from "reselect";
import { connect } from "react-redux";
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
import { DateTimeFormatter } from "../../util/DateFormater";
// import { setTimeTicketJobId } from "../../redux/timetickets/timetickets.actions";
import { setTmTicketJobId } from "../../redux/app/app.actions";
import { logImEXEvent } from "../../firebase/firebase.analytics";
import { employeeSignInStart } from "../../redux/employee/employee.actions";
import { useRef } from "react";
// const selectNumCompletedTodos = createSelector(
// (state) => state.timeTickets,
// (timeTickets) => timeTickets.timeTicketJobId
// );
//const mapStateToProps = createStructuredSelector({});
// // setTimeTicketJobId: (jobId) =>dispatch(setTimeTicketJobId({jobId})),
//employeeSignInStart:(idjob) => dispatch(employeeSignInStart(idjob)),
const mapDispatchToProps = (dispatch) => ({
setTmTicketJobIdRedux: (jobId) => dispatch(setTmTicketJobId(jobId)),
});
export function ClockedinListItem({ setTmTicketJobIdRedux, ticket }) {
console.log("ClockedinListItem, ticket", ticket);
console.log("ClockedinListItem, setTmTicketJobId", setTmTicketJobId);
const { t } = useTranslation();
const navigation = useNavigation();
console.log("ClockedinListItem, ticket job id", ticket.job.id);
const jbId = ticket.job.id;
console.log("ClockedinListItem, jbId: ", jbId);
// const te = useRef(jbId);
const makeNavToTimeTicketClockOff = () => (
console.log(
"*** THIS IS THE ONE WE ARE TESTING. ClockedinListItem, makeNavToTimeTicketClockOff, setTmTicketJobId :",
setTmTicketJobIdRedux
),
//console.log("ClockedinListItem, makeNavToTimeTicketClockOff, jobId :", jbId)
// console.log("makeNavToTimeTicketClockOff, checkHasDispatchCall:",setTmTicketJobIdRedux),
setTmTicketJobIdRedux(ticket.job.id),
//,
navigation.navigate("TimeTicketClockOff")
navigation.navigate("TimeTicketClockOff", {
// jobId: ticket.jobid, //item.id,
timeTicketId:ticket.id,
//completedCallback: refetch,
})
);
// const onPress = (ticket, setCameraJobId) => {
// console.log("ClockedinListItem, onPress called");
// console.log("ClockedinListItem, ticket", ticket);
// setTimeTicketJobId(ticket.jobid);
// // logImEXEvent("imexmobile_view_job_detail");
// navigation.push("TimeTicketClockOff", {
// jobId: ticket.jobid, //item.id,
// timeTicketId: ticket.id,
// //completedCallback: refetch,
// });
// // navigation.push("JobDetail", {
// // jobId: item.id,
// // timeTicketId: item.ro_number || t("general.labels.na"),
// // job: item,
// // });
// // () => {navigation.navigate("TimeTicketClockOff");}
// };
return (
<Card style={{ margin: 8 }}>
@@ -90,64 +50,11 @@ export function ClockedinListItem({ setTmTicketJobIdRedux, ticket }) {
</Text>
</Card.Content>
<Card.Actions>
{/* <TechClockOffButton
jobId={ticket.jobid}
timeTicketId={ticket.id}
completedCallback={refetch}
/> */}
<Button
// key={ticket.id}
mode="outlined"
onPress={makeNavToTimeTicketClockOff}
// {
// logImEXEvent("imexmobile_setcamerajobid_row");
// // setTmTicketJobId(ticket.id);
// // console.log("ticket.jobid is :",ticket.jobid );
// // console.log("setTimeTicketJobId is :",setTimeTicketJobId );
// // console.log("ham is :",setTimeTicketJobId );
// // if (typeof ham === 'undefined') {
// // console.error("yo dog, setTimeTicketJobId is undefined!");
// // return;
// // }
// const { id, jobid } = e;
// console.log("ticket.jobid is :", ticket.jobid);
// setTmTicketJobId(ticket.jobid);
// // setTimeTicketJobId(ticket.jobid);
// //navigation.navigate("TimeTicketClockOff");
// }}
>
<Button mode="outlined" onPress={makeNavToTimeTicketClockOff} >
Clock Out
</Button>
</Card.Actions>
</Card>
// <List.Item
// onPress={onPress}
// title={<Title>{item.ro_number || t("general.labels.na")}</Title>}
// descriptionNumberOfLines={2}
// description={`${item.ownr_fn || ""} ${item.ownr_ln || ""} ${
// item.ownr_co_nm || ""
// } - ${item.v_model_yr || ""} ${item.v_make_desc || ""} ${
// item.v_model_desc || ""
// }`}
// right={({ style }) => (
// <Button
// style={[style, { alignSelf: "center" }]}
// onPress={() => {
// logImEXEvent("imexmobile_setcamerajobid_row");
// setCameraJobId(item.id);
// setCameraJob(item);
// navigation.navigate("MediaBrowserTab");
// }}
// >
// <Ionicons
// style={[style, { alignSelf: "center" }]}
// name="ios-add"
// size={32}
// color="dodgerblue"
// />
// </Button>
// )}
// />
);
}