added style to copmonents for phone being sideways

This commit is contained in:
jfrye122
2023-05-17 11:44:35 -04:00
parent c3cc3fc8b9
commit 921a6ab763
2 changed files with 38 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { View, Text } from "react-native"; import { View, Text, StyleSheet, ScrollView } from "react-native";
import axios from "axios"; import axios from "axios";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { employeeGetRatesStart } from "../../redux/employee/employee.actions"; import { employeeGetRatesStart } from "../../redux/employee/employee.actions";
@@ -10,7 +10,7 @@ import {
selectGettingRates, selectGettingRates,
selectSignInError, selectSignInError,
} from "../../redux/employee/employee.selectors"; } from "../../redux/employee/employee.selectors";
import { Button } from "react-native-paper"; import { Button, Card } from "react-native-paper";
//temp //temp
import { useQuery } from "@apollo/client"; import { useQuery } from "@apollo/client";
@@ -97,7 +97,6 @@ export function ScreenTimeTicketBrowser({
if (currentSJobId) if (currentSJobId)
console.log("jobid or currentSJobId", currentSJobId?.value); console.log("jobid or currentSJobId", currentSJobId?.value);
const tempVariablesObj = { const tempVariablesObj = {
variables: { variables: {
timeTicketInput: [ timeTicketInput: [
@@ -126,10 +125,9 @@ export function ScreenTimeTicketBrowser({
}; };
console.info( console.info(
"INSERT_NEW_TIME_TICKET, variables for clockin. : ", "INSERT_NEW_TIME_TICKET, variables for clockin. : ",
tempVariablesObj?.variables?.timeTicketInput[0] tempVariablesObj?.variables?.timeTicketInput[0]
); );
const result = await insertTimeTicket(tempVariablesObj); const result = await insertTimeTicket(tempVariablesObj);
console.log("insertTimeTicket, result :", result); console.log("insertTimeTicket, result :", result);
@@ -145,35 +143,46 @@ export function ScreenTimeTicketBrowser({
setCurrentSCC(null); setCurrentSCC(null);
} }
setLoading(false); setLoading(false);
}; };
return ( return (
<View style={{flex:1}}> <View style={localStyles.content}>
<JobIdSearchSelect <ScrollView contentContainerStyle={{ flexGrow: 1 }}>
currentValue={currentSJobId} <Card>
onJobSelected={setCurrentSJobId} <JobIdSearchSelect
convertedOnly={!currentBodyshop.tt_allow_post_to_invoiced} currentValue={currentSJobId}
notExported={!currentBodyshop.tt_allow_post_to_invoiced} onJobSelected={setCurrentSJobId}
/> convertedOnly={!currentBodyshop.tt_allow_post_to_invoiced}
<CostCenterSelect notExported={!currentBodyshop.tt_allow_post_to_invoiced}
currentValue={currentSCC} />
currentRatesNCostCenters={currentRatesNCostCenters} <CostCenterSelect
onValueSelected={setCurrentSCC} currentValue={currentSCC}
/> currentRatesNCostCenters={currentRatesNCostCenters}
<Button mode="outlined" loading={loading} onPress={handleFinish}> onValueSelected={setCurrentSCC}
<Text>Clock In</Text> />
</Button> <Button mode="outlined" loading={loading} onPress={handleFinish}>
{error && error?.message ? ( <Text>Clock In</Text>
<ErrorDisplay errorMessage={error.message} /> </Button>
) : null} {error && error?.message ? (
<ErrorDisplay errorMessage={error.message} />
<EmployeeClockedInList technician={currentEmployee} /> ) : null}
</Card>
</ScrollView>
<View style={{ flexGrow: 1, flex:1 }}>
<EmployeeClockedInList technician={currentEmployee} />
</View>
</View> </View>
); );
} }
const localStyles = StyleSheet.create({
content: {
display: "flex",
flex: 2,
},
});
export default connect( export default connect(
mapStateToProps, mapStateToProps,
mapDispatchToProps mapDispatchToProps

View File

@@ -4,7 +4,7 @@ import { StyleSheet, Text, View, ScrollView } from "react-native";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { createStructuredSelector } from "reselect"; import { createStructuredSelector } from "reselect";
import { Button, TextInput } from "react-native-paper"; import { Button, TextInput, Card } from "react-native-paper";
import { CostCenterSelect } from "../Selects/select-cost-center"; import { CostCenterSelect } from "../Selects/select-cost-center";
import { import {
selectCurrentEmployee, selectCurrentEmployee,
@@ -120,6 +120,7 @@ export function TimeTicketClockOff({
return ( return (
<View style={localStyles.content}> <View style={localStyles.content}>
<ScrollView contentContainerStyle={{ flexGrow: 1 }}> <ScrollView contentContainerStyle={{ flexGrow: 1 }}>
<Card>
<Formik <Formik
initialValues={{ initialValues={{
costcenter: { currentSCC }, costcenter: { currentSCC },
@@ -162,6 +163,7 @@ export function TimeTicketClockOff({
</View> </View>
)} )}
</Formik> </Formik>
</Card>
</ScrollView> </ScrollView>
<View style={{ flexGrow: 1 }}> <View style={{ flexGrow: 1 }}>
<LaborAllocationsTable jobId={currentTmTicketJobId} /> <LaborAllocationsTable jobId={currentTmTicketJobId} />