reza fixed order tablet

master
Reza_ashrafi 3 years ago
parent cbc55c661a
commit 6e70211a72
  1. 2
      src/components/Header.js
  2. 27
      src/screens/OrderDetails/components/Book.js
  3. 64
      src/screens/OrderDetails/index.js
  4. 2
      src/screens/OrdersFollowUp/components/Order.js
  5. 2
      src/screens/OrdersFollowUp/index.js

@ -9,7 +9,7 @@ function Header({ title, description, background }) {
return ( return (
<View <View
style={[ style={[
tw(`w-full flex flex-col items-center pb-7 ${mobile ? "" : "mt-3"}`), tw(`w-full flex flex-col items-center pb-7`),
{ height: height / 4.5, backgroundColor: "#E9F0F7" }, { height: height / 4.5, backgroundColor: "#E9F0F7" },
]} ]}
> >

@ -1,6 +1,6 @@
import React from "react"; import React from "react";
import { View, Text, Dimensions, Image, Appearance } from "react-native"; import { View, Text, Dimensions, Image, Appearance } from "react-native";
import {connect} from 'react-redux';
//style //style
import tw from "tailwind-rn"; import tw from "tailwind-rn";
import fontSize from "../../../constants/fontSize"; import fontSize from "../../../constants/fontSize";
@ -10,7 +10,7 @@ import _ from "lodash";
const width = Dimensions.get("window").width; const width = Dimensions.get("window").width;
export default function Book({ book }) { function Book({ book, mobile }) {
const colorScheme = Appearance.getColorScheme(); const colorScheme = Appearance.getColorScheme();
return ( return (
<View <View
@ -27,14 +27,17 @@ export default function Book({ book }) {
source={book} source={book}
style={[ style={[
tw("rounded-md"), tw("rounded-md"),
{ width: width / 5, height: (width / 5) * (4 / 2.8) }, {
width: mobile ? width / 5 : width / 8,
height: (mobile ? width / 5 : width / 8) * (4 / 2.8),
},
]} ]}
/> />
<View style={tw("flex flex-col items-end mr-2")}> <View style={tw("flex flex-col items-end mr-2")}>
<Text <Text
style={[ style={[
{ {
fontSize: fontSize.base, fontSize: mobile ? fontSize.base : fontSize.xl2,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "bold", fontFamily: "bold",
}, },
@ -46,7 +49,7 @@ export default function Book({ book }) {
style={[ style={[
tw(" mt-2"), tw(" mt-2"),
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].gray20 + "aa", color: Colors.theme1[colorScheme].gray20 + "aa",
fontFamily: "regular", fontFamily: "regular",
}, },
@ -58,7 +61,7 @@ export default function Book({ book }) {
style={[ style={[
tw(" mt-1"), tw(" mt-1"),
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].greenBA, color: Colors.theme1[colorScheme].greenBA,
fontFamily: "regular", fontFamily: "regular",
}, },
@ -74,7 +77,7 @@ export default function Book({ book }) {
tw(" py-1 px-3 rounded-sm"), tw(" py-1 px-3 rounded-sm"),
{ {
color: "#132F52", color: "#132F52",
fontSize: fontSize.xl, fontSize: mobile ? fontSize.xl : fontSize.xl4,
backgroundColor: "#F1F1F1", backgroundColor: "#F1F1F1",
fontFamily: "bold", fontFamily: "bold",
}, },
@ -85,8 +88,8 @@ export default function Book({ book }) {
<View style={tw("flex flex-row items-center")}> <View style={tw("flex flex-row items-center")}>
<Text <Text
style={{ style={{
fontFamily: "regular", fontFamily: "bold",
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.xl2,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
}} }}
> >
@ -109,3 +112,9 @@ export default function Book({ book }) {
</View> </View>
); );
} }
const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile
})
export default connect(mapStateToProps)(Book);

@ -43,7 +43,7 @@ const status = {
2: "ارسال شده", 2: "ارسال شده",
}; };
function OrderDetails({ order }) { function OrderDetails({ order, mobile }) {
const colorScheme = Appearance.getColorScheme(); const colorScheme = Appearance.getColorScheme();
const [position, setPosition] = useState("100%"); const [position, setPosition] = useState("100%");
@ -77,14 +77,14 @@ function OrderDetails({ order }) {
> >
<View <View
style={[ style={[
tw("flex flex-row-reverse w-full justify-between items-center p-3"), tw(`flex flex-row-reverse w-full justify-between items-center ${mobile ? "p-3" : "p-4"}`),
{ backgroundColor: Colors.theme1[colorScheme].greenCF + "1a" }, { backgroundColor: Colors.theme1[colorScheme].greenCF + "1a" },
]} ]}
> >
<Text <Text
style={[ style={[
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.base : fontSize.xl,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "bold", fontFamily: "bold",
}, },
@ -97,7 +97,7 @@ function OrderDetails({ order }) {
style={[ style={[
{ {
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontSize: fontSize.sm, fontSize: mobile ? mobile ? fontSize.sm : fontSize.lg : fontSize.lg,
fontFamily: "bold", fontFamily: "bold",
}, },
]} ]}
@ -124,7 +124,7 @@ function OrderDetails({ order }) {
<Text <Text
style={[ style={[
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "bold", fontFamily: "bold",
}, },
@ -136,8 +136,8 @@ function OrderDetails({ order }) {
style={[ style={[
tw("flex-1 font-light text-right mr-2"), tw("flex-1 font-light text-right mr-2"),
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
lineHeight: 17, lineHeight: mobile ? 17 : 'auto',
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "regular", fontFamily: "regular",
}, },
@ -159,7 +159,7 @@ function OrderDetails({ order }) {
<Text <Text
style={[ style={[
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "bold", fontFamily: "bold",
}, },
@ -171,8 +171,8 @@ function OrderDetails({ order }) {
style={[ style={[
tw("font-light text-right mr-1"), tw("font-light text-right mr-1"),
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
lineHeight: 17, lineHeight: mobile ? 17 : 'auto',
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "regular", fontFamily: "regular",
}, },
@ -185,7 +185,7 @@ function OrderDetails({ order }) {
<Text <Text
style={[ style={[
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "bold", fontFamily: "bold",
}, },
@ -197,8 +197,8 @@ function OrderDetails({ order }) {
style={[ style={[
tw("text-right mr-1"), tw("text-right mr-1"),
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
lineHeight: 17, lineHeight: mobile ? 17 : 'auto',
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "regular", fontFamily: "regular",
}, },
@ -217,7 +217,7 @@ function OrderDetails({ order }) {
<Text <Text
style={[ style={[
{ {
fontSize: fontSize.sm, fontSize: mobile ? mobile ? fontSize.sm : fontSize.lg : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "bold", fontFamily: "bold",
}, },
@ -229,7 +229,7 @@ function OrderDetails({ order }) {
style={[ style={[
tw("font-light text-right mt-1"), tw("font-light text-right mt-1"),
{ {
fontSize: fontSize.sm, fontSize: mobile ? mobile ? fontSize.sm : fontSize.lg : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "regular", fontFamily: "regular",
}, },
@ -248,7 +248,7 @@ function OrderDetails({ order }) {
<Text <Text
style={[ style={[
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "bold", fontFamily: "bold",
}, },
@ -260,7 +260,7 @@ function OrderDetails({ order }) {
style={[ style={[
tw("font-light text-right mr-1"), tw("font-light text-right mr-1"),
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "regular", fontFamily: "regular",
}, },
@ -273,7 +273,7 @@ function OrderDetails({ order }) {
<Text <Text
style={[ style={[
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "bold", fontFamily: "bold",
}, },
@ -285,7 +285,7 @@ function OrderDetails({ order }) {
style={[ style={[
tw("font-light text-right mr-1"), tw("font-light text-right mr-1"),
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "regular", fontFamily: "regular",
}, },
@ -308,7 +308,7 @@ function OrderDetails({ order }) {
<Text <Text
style={[ style={[
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "bold", fontFamily: "bold",
}, },
@ -320,7 +320,7 @@ function OrderDetails({ order }) {
style={[ style={[
tw("font-light text-right mr-1"), tw("font-light text-right mr-1"),
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "regular", fontFamily: "regular",
}, },
@ -333,7 +333,7 @@ function OrderDetails({ order }) {
<Text <Text
style={[ style={[
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "bold", fontFamily: "bold",
}, },
@ -345,7 +345,7 @@ function OrderDetails({ order }) {
style={[ style={[
tw("font-light text-right mr-1"), tw("font-light text-right mr-1"),
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "regular", fontFamily: "regular",
}, },
@ -368,7 +368,7 @@ function OrderDetails({ order }) {
<Text <Text
style={[ style={[
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "bold", fontFamily: "bold",
}, },
@ -380,7 +380,7 @@ function OrderDetails({ order }) {
style={[ style={[
tw("font-light text-right mr-1"), tw("font-light text-right mr-1"),
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "regular", fontFamily: "regular",
}, },
@ -393,7 +393,7 @@ function OrderDetails({ order }) {
<Text <Text
style={[ style={[
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "bold", fontFamily: "bold",
}, },
@ -405,7 +405,7 @@ function OrderDetails({ order }) {
style={[ style={[
tw("font-light text-right mr-1"), tw("font-light text-right mr-1"),
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "regular", fontFamily: "regular",
}, },
@ -420,7 +420,7 @@ function OrderDetails({ order }) {
<Text <Text
style={[ style={[
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "bold", fontFamily: "bold",
}, },
@ -432,7 +432,7 @@ function OrderDetails({ order }) {
style={[ style={[
tw("font-light text-right mr-1"), tw("font-light text-right mr-1"),
{ {
fontSize: fontSize.sm, fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79, color: Colors.theme1[colorScheme].green79,
fontFamily: "regular", fontFamily: "regular",
}, },
@ -460,7 +460,11 @@ const styles = StyleSheet.create({
}, },
}); });
export default OrderDetails; const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile
})
export default connect(mapStateToProps)(OrderDetails);
OrderDetails.defaultProps = { OrderDetails.defaultProps = {
order: { order: {

@ -120,7 +120,7 @@ function Order({ order, mobile }) {
height: (mobile ? width / 5 : width / 7) * (4 / 3), height: (mobile ? width / 5 : width / 7) * (4 / 3),
}, },
]} ]}
/> />
))} ))}
</View> </View>
<View style={[tw("")]}> <View style={[tw("")]}>

@ -35,7 +35,7 @@ function OrdersFollowUp({ orders }) {
logo: false, logo: false,
menu: false, menu: false,
hamburgerMenu: false, hamburgerMenu: false,
title: "سفارشات", title: "سفارشات",
bookmark: false, bookmark: false,
qr: false, qr: false,
back: true, back: true,

Loading…
Cancel
Save