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: [
@@ -129,7 +128,6 @@ export function ScreenTimeTicketBrowser({
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,12 +143,13 @@ export function ScreenTimeTicketBrowser({
setCurrentSCC(null); setCurrentSCC(null);
} }
setLoading(false); setLoading(false);
}; };
return ( return (
<View style={{flex:1}}> <View style={localStyles.content}>
<ScrollView contentContainerStyle={{ flexGrow: 1 }}>
<Card>
<JobIdSearchSelect <JobIdSearchSelect
currentValue={currentSJobId} currentValue={currentSJobId}
onJobSelected={setCurrentSJobId} onJobSelected={setCurrentSJobId}
@@ -168,12 +167,22 @@ export function ScreenTimeTicketBrowser({
{error && error?.message ? ( {error && error?.message ? (
<ErrorDisplay errorMessage={error.message} /> <ErrorDisplay errorMessage={error.message} />
) : null} ) : null}
</Card>
</ScrollView>
<View style={{ flexGrow: 1, flex:1 }}>
<EmployeeClockedInList technician={currentEmployee} /> <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} />