parent
fd706f237d
commit
e9ab15b696
7 changed files with 282 additions and 31 deletions
@ -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); |
Loading…
Reference in new issue