reza fixed something

master
Reza_ashrafi 3 years ago
parent fd706f237d
commit e9ab15b696
  1. 4
      navigation/index.js
  2. 1
      package.json
  3. 8
      src/redux/actions/comment.js
  4. 2
      src/screens/Contact/layouts/Ticket.js
  5. 156
      src/screens/Contact/layouts/TicketStatus.js
  6. 130
      src/screens/Contact/layouts/Tickets.js
  7. 12
      yarn.lock

@ -43,6 +43,7 @@ import Rules from "../src/screens/Rules/index";
import MyCourses from "../src/screens/Profile/components/MyCourses";
import Ticket from "../src/screens/Contact/layouts/Ticket";
import Tickets from "../src/screens/Contact/layouts/Tickets";
import TicketStatus from "../src/screens/Contact/layouts/TicketStatus";
import MoreBlog from "../src/screens/Blogs/layouts/More";
//style
@ -58,7 +59,7 @@ const BottomTabNavigator = ({ theme, userProducts }) => {
setHeaderShown(false);
}, 600);
}, []);
return (
<Tab.Navigator
initialRouteName="HomeTab"
@ -624,6 +625,7 @@ const Navigation = ({
<Stack.Screen name="Info" component={Info} />
<Stack.Screen name="Ticket" component={Ticket} />
<Stack.Screen name="Tickets" component={Tickets} />
<Stack.Screen name="TicketStatus" component={TicketStatus} />
</Stack.Navigator>
</NavigationContainer>
);

@ -54,7 +54,6 @@
"react-navigation-stack": "^2.10.4",
"react-redux": "^7.2.6",
"redux": "^4.1.2",
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.4.1",
"tailwind-rn": "^3.0.1"

@ -18,14 +18,14 @@ const comment = {
del:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.delete("ar/delete", data);
await proxy.get("ar/list", data2, { dispatch });
await proxy.delete("comment/delete", data);
await proxy.get("comment/list", data2, { dispatch });
},
update:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.put("ar/update", data);
await proxy.get("ar/list", data2, { dispatch });
await proxy.put("comment/update", data);
await proxy.get("comment/list", data2, { dispatch });
},
};

@ -91,7 +91,7 @@ export const Ticket = ({
back: true,
}}
/>
<ScrollView style={tw("flex-1 px-4")}>
<ScrollView style={tw("flex-1 px-4 pt-4")}>
{!status ? (
<>
<CustomTextInput

@ -0,0 +1,156 @@
import React from "react";
import {
SafeAreaView,
View,
StatusBar,
Platform,
ScrollView,
Text,
Pressable,
} from "react-native";
import { connect } from "react-redux";
import { useNavigation } from "@react-navigation/native";
//components
import Navbar from "../../../components/Navbar";
//style
import tw from "tailwind-rn";
import Colors from "../../../constants/Colors";
import fontSize from "../../../constants/fontSize";
export const TicketStatus = ({ theme }) => {
const navigation = useNavigation();
const ticket = React.useMemo(() => {
return {
title: "موضوع تیکت",
message: "دریافت اشتباه کتاب های ارسالی از سامانه سفارشات",
target: "دپارتمان فروش و بازاریابی",
date: "1400/09/12",
isNew: true,
isAnswered: true,
answer : {
}
};
}, [theme]);
return (
<SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
position: "relative",
flex: 1,
}}
>
<Navbar
headerOptions={{
logo: false,
menu: false,
hamburgerMenu: false,
title: "",
bookmark: false,
qr: false,
back: true,
}}
/>
<ScrollView
contentContainerStyle={{ paddingBottom: 100 }}
style={tw("px-4 pt-4 flex")}
>
</ScrollView>
</SafeAreaView>
);
};
const Ticket = ({ ticket }) => {
const { title, message, isNew, date, target, isAnswered } = ticket;
return (
<Pressable
style={[
tw("flex py-4 px-2 mb-5 rounded-md"),
{
borderWidth: 1,
borderColor: isNew
? Colors.theme1.greenCF + "88"
: Colors.theme1.grayCC,
backgroundColor: isNew
? Colors.theme1.greenCF + "11"
: Colors.theme1.gray20 + "0a",
},
]}
>
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.tiny,
color: Colors.theme1.green79,
textAlign: "left",
}}
>
{date}
</Text>
<Text
style={{
fontFamily: "bold",
textAlign: "right",
fontSize: fontSize.lg,
color: Colors.theme1.green79,
}}
>
{title}
</Text>
<Text
style={{
fontFamily: "regular",
textAlign: "right",
fontSize: fontSize.lg,
color: Colors.theme1.gray20,
marginTop: 5,
}}
>
{message}
</Text>
<View style={tw("flex flex-row-reverse justify-between mt-4")}>
<Text
style={{
fontFamily: "light",
textAlign: "right",
fontSize: fontSize.sm,
color: Colors.theme1.green79,
}}
>
{target}
</Text>
<Text
style={{
borderRadius: 4,
padding: 4,
fontFamily: "regular",
fontSize: fontSize.sm,
borderWidth: 1,
borderColor: isAnswered
? Colors.theme1.greenFF + "66"
: Colors.theme1.gray20 + "22",
backgroundColor: isAnswered
? Colors.theme1.greenFF + "22"
: Colors.theme1.gray20 + "11",
color: isAnswered ? Colors.theme1.green79 : Colors.theme1.gray20,
}}
>
{isAnswered ? "پاسخ داده شده" : "بدون پاسخ"}
</Text>
</View>
</Pressable>
);
};
const mapStateToProps = (state) => ({
theme: state.publicApi.theme,
});
const mapDispatchToProps = {};
export default connect(mapStateToProps, mapDispatchToProps)(TicketStatus);

@ -1,13 +1,14 @@
import React, { useMemo, useEffect, useCallback } from "react";
import React from "react";
import {
SafeAreaView,
View,
StatusBar,
Platform,
FlatList,
ScrollView,
Text,
Pressable,
} from "react-native";
import { connect } from "react-redux";
import { userProduct, comment, file, form } from "../../../redux/actions";
import { useNavigation } from "@react-navigation/native";
//components
import CustomPressable from "../../../components/Pressable";
@ -19,8 +20,29 @@ import tw from "tailwind-rn";
import Colors from "../../../constants/Colors";
import fontSize from "../../../constants/fontSize";
export const Tickets = ({ tickets = [], theme }) => {
export const Tickets = ({ theme }) => {
const navigation = useNavigation();
const tickets = React.useMemo(() => {
return [
{
title: "موضوع تیکت",
message: "دریافت اشتباه کتاب های ارسالی از سامانه سفارشات",
target: "دپارتمان فروش و بازاریابی",
date: "1400/09/12",
isNew: true,
isAnswered: true,
},
{
title: "موضوع تیکت",
message: "دریافت اشتباه کتاب های ارسالی از سامانه سفارشات",
target: "دپارتمان فروش و بازاریابی",
date: "1400/09/12",
isNew: false,
isAnswered: false,
},
];
}, [theme]);
return (
<SafeAreaView
style={{
@ -41,14 +63,14 @@ export const Tickets = ({ tickets = [], theme }) => {
}}
/>
{tickets.length ? (
<FlatList
data={tickets}
style={tw("px-4 flex-1")}
renderItems={({ item }) => <Ticket ticket={item} />}
keyExtractor={(item, index) => {
return index;
}}
/>
<ScrollView
contentContainerStyle={{ paddingBottom: 100 }}
style={tw("px-4 pt-4 flex")}
>
{tickets.map((ticket, index) => (
<Ticket ticket={ticket} key={index} />
))}
</ScrollView>
) : (
<Empty text="هیچ تیکتی وجود ندارد." />
)}
@ -66,6 +88,90 @@ export const Tickets = ({ tickets = [], theme }) => {
);
};
const Ticket = ({ ticket }) => {
const navigation = useNavigation();
const { title, message, isNew, date, target, isAnswered } = ticket;
return (
<Pressable
style={[
tw("flex py-4 px-2 mb-5 rounded-md"),
{
borderWidth: 1,
borderColor: isNew
? Colors.theme1.greenCF + "88"
: Colors.theme1.grayCC,
backgroundColor: isNew
? Colors.theme1.greenCF + "11"
: Colors.theme1.gray20 + "0a",
},
]}
onPress={() => navigation.push("TicketStatus")}
>
<Text
style={{
fontFamily: "bold",
fontSize: fontSize.tiny,
color: Colors.theme1.green79,
textAlign: "left",
}}
>
{date}
</Text>
<Text
style={{
fontFamily: "bold",
textAlign: "right",
fontSize: fontSize.lg,
color: Colors.theme1.green79,
}}
>
{title}
</Text>
<Text
style={{
fontFamily: "regular",
textAlign: "right",
fontSize: fontSize.lg,
color: Colors.theme1.gray20,
marginTop: 5,
}}
>
{message}
</Text>
<View style={tw("flex flex-row-reverse justify-between mt-4")}>
<Text
style={{
fontFamily: "light",
textAlign: "right",
fontSize: fontSize.sm,
color: Colors.theme1.green79,
}}
>
{target}
</Text>
<Text
style={{
borderRadius: 4,
padding : 4,
fontFamily: "regular",
fontSize: fontSize.sm,
borderWidth : 1,
borderColor: isAnswered
? Colors.theme1.greenFF + '66'
: Colors.theme1.gray20 + '22',
backgroundColor: isAnswered
? Colors.theme1.greenFF + '22'
: Colors.theme1.gray20 + '11',
color: isAnswered ? Colors.theme1.green79 : Colors.theme1.gray20
}}
>
{isAnswered ? "پاسخ داده شده" : "بدون پاسخ"}
</Text>
</View>
</Pressable>
);
};
const mapStateToProps = (state) => ({
theme: state.publicApi.theme,
});

@ -2713,11 +2713,6 @@ decode-uri-component@^0.2.0:
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=
deep-diff@^0.3.5:
version "0.3.8"
resolved "https://registry.yarnpkg.com/deep-diff/-/deep-diff-0.3.8.tgz#c01de63efb0eec9798801d40c7e0dae25b582c84"
integrity sha1-wB3mPvsO7JeYgB1Ax+Da4ltYLIQ=
deepmerge@^3.2.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-3.3.0.tgz#d3c47fd6f3a93d517b14426b0628a17b0125f5f7"
@ -5763,13 +5758,6 @@ redent@^3.0.0:
indent-string "^4.0.0"
strip-indent "^3.0.0"
redux-logger@^3.0.6:
version "3.0.6"
resolved "https://registry.yarnpkg.com/redux-logger/-/redux-logger-3.0.6.tgz#f7555966f3098f3c88604c449cf0baf5778274bf"
integrity sha1-91VZZvMJjzyIYExEnPC69XeCdL8=
dependencies:
deep-diff "^0.3.5"
redux-persist@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/redux-persist/-/redux-persist-6.0.0.tgz#b4d2972f9859597c130d40d4b146fecdab51b3a8"

Loading…
Cancel
Save