From dbd5641cd2c813882c0899521156b51fd64fa309 Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Fri, 13 May 2022 11:31:01 +0430 Subject: [PATCH] reza fixed some change --- src/components/Or.js | 39 +++++++++++++----- src/screens/Activation/index.js | 13 ++++-- src/screens/Contact/layouts/Tickets.js | 57 +++++++++++++++++++------- 3 files changed, 81 insertions(+), 28 deletions(-) diff --git a/src/components/Or.js b/src/components/Or.js index 8d86309..865937b 100644 --- a/src/components/Or.js +++ b/src/components/Or.js @@ -1,20 +1,39 @@ -import React, {useState} from 'react'; -import {View, Text, Dimensions} from 'react-native'; -import tw from 'tailwind-rn'; +import React, { useState } from "react"; +import { connect } from "react-redux"; +import { View, Text, Dimensions } from "react-native"; -const width = Dimensions.get('window').width; +const width = Dimensions.get("window").width; -function Or(props) { +//style +import tw from "tailwind-rn"; +import fontSize from "../constants/fontSize"; + +function Or({ mobile }) { return ( + style={[tw("w-full flex flex-row justify-between items-center my-3")]} + > - یا + style={{ width: "43%", height: 1, backgroundColor: "#EFEFEF" }} + > + + یا + + style={{ width: "43%", height: 1, backgroundColor: "#EFEFEF" }} + > ); } -export default Or; +const mapStateToProps = (state) => ({ + mobile: state.publicApi.mobile, +}); + +export default connect(mapStateToProps)(Or); diff --git a/src/screens/Activation/index.js b/src/screens/Activation/index.js index 1fe3c8f..ab89dd5 100644 --- a/src/screens/Activation/index.js +++ b/src/screens/Activation/index.js @@ -33,9 +33,9 @@ import bgQr from "./assets/QR.png"; //variables const ios = Platform.OS === "ios"; -const { height } = Dimensions.get("window"); +const { height, width } = Dimensions.get("window"); -function Activation({ add, mobile, theme, route }) { +function Activation({ add, mobile, theme, route, orientation }) { const [value, setValue] = useState(route?.params?.data || ""); const navigation = useNavigation(); const insets = useSafeAreaInsets(); @@ -57,7 +57,13 @@ function Activation({ add, mobile, theme, route }) { ({ mobile: state.publicApi.mobile, + orientation: state.publicApi.orientation, theme: state.publicApi.theme, }); diff --git a/src/screens/Contact/layouts/Tickets.js b/src/screens/Contact/layouts/Tickets.js index 7f756ea..b76cab1 100644 --- a/src/screens/Contact/layouts/Tickets.js +++ b/src/screens/Contact/layouts/Tickets.js @@ -68,7 +68,7 @@ export const Tickets = ({ theme }) => { style={tw("px-4 pt-4 flex")} > {tickets.map((ticket, index) => ( - + ))} ) : ( @@ -88,9 +88,14 @@ export const Tickets = ({ theme }) => { ); }; -const Ticket = ({ ticket }) => { +const Ticket = ({ ticket, theme }) => { const navigation = useNavigation(); const { title, message, isNew, date, target, isAnswered } = ticket; + + const light = React.useMemo(() => { + return theme === "light"; + }, [theme]); + return ( { { borderWidth: 1, borderColor: isNew - ? Colors.theme1.greenCF + "88" + ? Colors.theme1.greenCF + (light ? "88" : "") : Colors.theme1.grayCC, backgroundColor: isNew ? Colors.theme1.greenCF + "11" @@ -111,7 +116,11 @@ const Ticket = ({ ticket }) => { style={{ fontFamily: "bold", fontSize: fontSize.tiny, - color: Colors.theme1.green79, + color: light + ? Colors.theme1.green79 + : isNew + ? Colors.theme1.greenCF + : Colors.theme1.white, textAlign: "left", }} > @@ -122,7 +131,11 @@ const Ticket = ({ ticket }) => { fontFamily: "bold", textAlign: "right", fontSize: fontSize.lg, - color: Colors.theme1.green79, + color: light + ? Colors.theme1.green79 + : isNew + ? Colors.theme1.greenCF + : Colors.theme1.white, }} > {title} @@ -132,7 +145,11 @@ const Ticket = ({ ticket }) => { fontFamily: "regular", textAlign: "right", fontSize: fontSize.lg, - color: Colors.theme1.gray20, + color: light + ? Colors.theme1.green79 + : isNew + ? Colors.theme1.greenCF + : Colors.theme1.white, marginTop: 5, }} > @@ -144,7 +161,11 @@ const Ticket = ({ ticket }) => { fontFamily: "light", textAlign: "right", fontSize: fontSize.sm, - color: Colors.theme1.green79, + color: light + ? Colors.theme1.green79 + : isNew + ? Colors.theme1.greenCF + : Colors.theme1.white, }} > {target} @@ -152,17 +173,23 @@ const Ticket = ({ ticket }) => { {isAnswered ? "پاسخ داده شده" : "بدون پاسخ"}