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

@ -9,7 +9,7 @@ function Header({ title, description, background }) {
return (
<View
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" },
]}
>

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

@ -43,7 +43,7 @@ const status = {
2: "ارسال شده",
};
function OrderDetails({ order }) {
function OrderDetails({ order, mobile }) {
const colorScheme = Appearance.getColorScheme();
const [position, setPosition] = useState("100%");
@ -77,14 +77,14 @@ function OrderDetails({ order }) {
>
<View
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" },
]}
>
<Text
style={[
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.base : fontSize.xl,
color: Colors.theme1[colorScheme].green79,
fontFamily: "bold",
},
@ -97,7 +97,7 @@ function OrderDetails({ order }) {
style={[
{
color: Colors.theme1[colorScheme].green79,
fontSize: fontSize.sm,
fontSize: mobile ? mobile ? fontSize.sm : fontSize.lg : fontSize.lg,
fontFamily: "bold",
},
]}
@ -124,7 +124,7 @@ function OrderDetails({ order }) {
<Text
style={[
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "bold",
},
@ -136,8 +136,8 @@ function OrderDetails({ order }) {
style={[
tw("flex-1 font-light text-right mr-2"),
{
fontSize: fontSize.sm,
lineHeight: 17,
fontSize: mobile ? fontSize.sm : fontSize.lg,
lineHeight: mobile ? 17 : 'auto',
color: Colors.theme1[colorScheme].green79,
fontFamily: "regular",
},
@ -159,7 +159,7 @@ function OrderDetails({ order }) {
<Text
style={[
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "bold",
},
@ -171,8 +171,8 @@ function OrderDetails({ order }) {
style={[
tw("font-light text-right mr-1"),
{
fontSize: fontSize.sm,
lineHeight: 17,
fontSize: mobile ? fontSize.sm : fontSize.lg,
lineHeight: mobile ? 17 : 'auto',
color: Colors.theme1[colorScheme].green79,
fontFamily: "regular",
},
@ -185,7 +185,7 @@ function OrderDetails({ order }) {
<Text
style={[
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "bold",
},
@ -197,8 +197,8 @@ function OrderDetails({ order }) {
style={[
tw("text-right mr-1"),
{
fontSize: fontSize.sm,
lineHeight: 17,
fontSize: mobile ? fontSize.sm : fontSize.lg,
lineHeight: mobile ? 17 : 'auto',
color: Colors.theme1[colorScheme].green79,
fontFamily: "regular",
},
@ -217,7 +217,7 @@ function OrderDetails({ order }) {
<Text
style={[
{
fontSize: fontSize.sm,
fontSize: mobile ? mobile ? fontSize.sm : fontSize.lg : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "bold",
},
@ -229,7 +229,7 @@ function OrderDetails({ order }) {
style={[
tw("font-light text-right mt-1"),
{
fontSize: fontSize.sm,
fontSize: mobile ? mobile ? fontSize.sm : fontSize.lg : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "regular",
},
@ -248,7 +248,7 @@ function OrderDetails({ order }) {
<Text
style={[
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "bold",
},
@ -260,7 +260,7 @@ function OrderDetails({ order }) {
style={[
tw("font-light text-right mr-1"),
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "regular",
},
@ -273,7 +273,7 @@ function OrderDetails({ order }) {
<Text
style={[
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "bold",
},
@ -285,7 +285,7 @@ function OrderDetails({ order }) {
style={[
tw("font-light text-right mr-1"),
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "regular",
},
@ -308,7 +308,7 @@ function OrderDetails({ order }) {
<Text
style={[
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "bold",
},
@ -320,7 +320,7 @@ function OrderDetails({ order }) {
style={[
tw("font-light text-right mr-1"),
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "regular",
},
@ -333,7 +333,7 @@ function OrderDetails({ order }) {
<Text
style={[
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "bold",
},
@ -345,7 +345,7 @@ function OrderDetails({ order }) {
style={[
tw("font-light text-right mr-1"),
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "regular",
},
@ -368,7 +368,7 @@ function OrderDetails({ order }) {
<Text
style={[
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "bold",
},
@ -380,7 +380,7 @@ function OrderDetails({ order }) {
style={[
tw("font-light text-right mr-1"),
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "regular",
},
@ -393,7 +393,7 @@ function OrderDetails({ order }) {
<Text
style={[
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "bold",
},
@ -405,7 +405,7 @@ function OrderDetails({ order }) {
style={[
tw("font-light text-right mr-1"),
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "regular",
},
@ -420,7 +420,7 @@ function OrderDetails({ order }) {
<Text
style={[
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
fontFamily: "bold",
},
@ -432,7 +432,7 @@ function OrderDetails({ order }) {
style={[
tw("font-light text-right mr-1"),
{
fontSize: fontSize.sm,
fontSize: mobile ? fontSize.sm : fontSize.lg,
color: Colors.theme1[colorScheme].green79,
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 = {
order: {

Loading…
Cancel
Save