diff --git a/navigation/index.js b/navigation/index.js index ac4bcd0..cf1647c 100644 --- a/navigation/index.js +++ b/navigation/index.js @@ -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 ( + ); diff --git a/package.json b/package.json index e552754..8167f9f 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/src/redux/actions/comment.js b/src/redux/actions/comment.js index a2a1323..258279c 100644 --- a/src/redux/actions/comment.js +++ b/src/redux/actions/comment.js @@ -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 }); }, }; diff --git a/src/screens/Contact/layouts/Ticket.js b/src/screens/Contact/layouts/Ticket.js index cc410f3..1a46155 100644 --- a/src/screens/Contact/layouts/Ticket.js +++ b/src/screens/Contact/layouts/Ticket.js @@ -91,7 +91,7 @@ export const Ticket = ({ back: true, }} /> - + {!status ? ( <> { + const navigation = useNavigation(); + + const ticket = React.useMemo(() => { + return { + title: "موضوع تیکت", + message: "دریافت اشتباه کتاب های ارسالی از سامانه سفارشات", + target: "دپارتمان فروش و بازاریابی", + date: "1400/09/12", + isNew: true, + isAnswered: true, + answer : { + + } + }; + + + }, [theme]); + return ( + + + + + + + ); +}; + +const Ticket = ({ ticket }) => { + const { title, message, isNew, date, target, isAnswered } = ticket; + return ( + + + {date} + + + {title} + + + {message} + + + + {target} + + + {isAnswered ? "پاسخ داده شده" : "بدون پاسخ"} + + + + ); +}; + +const mapStateToProps = (state) => ({ + theme: state.publicApi.theme, +}); + +const mapDispatchToProps = {}; + +export default connect(mapStateToProps, mapDispatchToProps)(TicketStatus); diff --git a/src/screens/Contact/layouts/Tickets.js b/src/screens/Contact/layouts/Tickets.js index 42f8d00..7f756ea 100644 --- a/src/screens/Contact/layouts/Tickets.js +++ b/src/screens/Contact/layouts/Tickets.js @@ -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 ( { }} /> {tickets.length ? ( - } - keyExtractor={(item, index) => { - return index; - }} - /> + + {tickets.map((ticket, index) => ( + + ))} + ) : ( )} @@ -66,6 +88,90 @@ export const Tickets = ({ tickets = [], theme }) => { ); }; +const Ticket = ({ ticket }) => { + const navigation = useNavigation(); + const { title, message, isNew, date, target, isAnswered } = ticket; + return ( + navigation.push("TicketStatus")} + > + + {date} + + + {title} + + + {message} + + + + {target} + + + {isAnswered ? "پاسخ داده شده" : "بدون پاسخ"} + + + + ); +}; + const mapStateToProps = (state) => ({ theme: state.publicApi.theme, }); diff --git a/yarn.lock b/yarn.lock index 960e9d2..ff61a17 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"