reza fixed some change

master
Reza_ashrafi 3 years ago
parent 6730829161
commit dbd5641cd2
  1. 39
      src/components/Or.js
  2. 13
      src/screens/Activation/index.js
  3. 57
      src/screens/Contact/layouts/Tickets.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 (
<View
style={[tw('w-full flex flex-row justify-between items-center my-3')]}>
style={[tw("w-full flex flex-row justify-between items-center my-3")]}
>
<View
style={{width: '43%', height: 1, backgroundColor: '#EFEFEF'}}></View>
<Text style={{fontSize: width / 27, color: '#C2C2C2'}}>یا</Text>
style={{ width: "43%", height: 1, backgroundColor: "#EFEFEF" }}
></View>
<Text
style={{
fontSize: mobile ? fontSize.base : fontSize.lg,
color: "#C2C2C2",
marginVertical: 10,
}}
>
یا
</Text>
<View
style={{width: '43%', height: 1, backgroundColor: '#EFEFEF'}}></View>
style={{ width: "43%", height: 1, backgroundColor: "#EFEFEF" }}
></View>
</View>
);
}
export default Or;
const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile,
});
export default connect(mapStateToProps)(Or);

@ -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 }) {
<ScrollView style={tw("flex-1")}>
<KeyboardAvoidingView
behavior={"padding"}
style={{ height: height - insets.bottom * 2.5 }}
style={{
height: mobile
? height - insets.bottom * 2.5
: orientation === "portrait"
? height - insets.bottom * 2.5
: width - insets.bottom * 2.5,
}}
>
<TouchableWithoutFeedback>
<View
@ -159,6 +165,7 @@ Activation.defaultProps = {
const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile,
orientation: state.publicApi.orientation,
theme: state.publicApi.theme,
});

@ -68,7 +68,7 @@ export const Tickets = ({ theme }) => {
style={tw("px-4 pt-4 flex")}
>
{tickets.map((ticket, index) => (
<Ticket ticket={ticket} key={index} />
<Ticket ticket={ticket} key={index} theme={theme} />
))}
</ScrollView>
) : (
@ -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 (
<Pressable
style={[
@ -98,7 +103,7 @@ const Ticket = ({ ticket }) => {
{
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 }) => {
<Text
style={{
borderRadius: 4,
padding : 4,
padding: 4,
fontFamily: "regular",
fontSize: fontSize.sm,
borderWidth : 1,
borderColor: isAnswered
? Colors.theme1.greenFF + '66'
: Colors.theme1.gray20 + '22',
borderWidth: 1,
borderColor: isNew
? Colors.theme1.greenCF + (light ? "88" : "")
: Colors.theme1.grayCC,
backgroundColor: isAnswered
? Colors.theme1.greenFF + '22'
: Colors.theme1.gray20 + '11',
color: isAnswered ? Colors.theme1.green79 : Colors.theme1.gray20
? Colors.theme1.greenFF + "22"
: Colors.theme1.gray20 + "11",
color: isAnswered
? light
? Colors.theme1.green79
: Colors.theme1.greenCF
: light
? Colors.theme1.gray20
: Colors.theme1.white,
}}
>
{isAnswered ? "پاسخ داده شده" : "بدون پاسخ"}

Loading…
Cancel
Save