/**
* 通知消息渲染项目组件
* @邠心vbe on 2023/08/17
*/
import React from 'react';
import { Pressable, StyleSheet, View } from 'react-native';
import TextView from '../../components/TextView';
const IconType = ({type, style, size=32, color=colorAccent}) => {
switch (type) {
case "Applications":
return (
)
case "Admin":
return (
)
case "Charging":
return (
)
case "Wallet":
return (
)
case "Announcement":
return (
)
case "Review":
return (
)
case "Promotion":
return (
)
default:
return (
)
}
}
export default ItemAlert = ({item, index, separators, onPress, onLongPress}) => {
const getDotColor = () => {
if (item.readStatus) {
if (item?.notificationTitle.indexOf("Low") >= 0/* || item.notificationType == "Announcement"*/) {
return "#F09327";
} else {
return colorAccent;
}
} else {
return "#FF3B30";
}
}
return (
{/* */}
{item.notificationTitle}
{" " + item.createTime}
{item.notificationText}
{ !item.readStatus &&
}
)
}
const styles = StyleSheet.create({
notyItemView: {
padding: 16,
flexDirection: 'row'
},
unotyItemView: {
padding: 16,
flexDirection: 'row',
backgroundColor: "#F0F0F0"
},
iconType: {
marginRight: 12
},
readIcon: {
top: 2,
left: -5,
width: 7,
height: 6,
position: 'absolute'
},
itemContent: {
flex: 1
},
textTitle: {
flex: 1,
color: textPrimary,
fontSize: 14,
fontWeight: 'bold',
paddingBottom: 4
},
textDate: {
color: textSecondary,
fontSize: 10,
lineHeight: 10,
paddingBottom: 4
},
unread: {
fontWeight: 'bold'
},
textMessage: {
color: textPrimary,
fontSize: 10
}
})