import React from "react"; import { StyleSheet, TouchableWithoutFeedback } from "react-native"; import PropTypes from "prop-types"; import { Block, Text } from "galio-framework"; import Icon from "./Icon"; import { argonTheme } from "../constants"; export default class Notification extends React.Component { render() { const { body, color, iconColor, iconFamily, iconName, iconSize, onPress, style, system, time, title, transparent } = this.props; const iconContainer = [ styles.iconContainer, { backgroundColor: color || argonTheme.COLORS.PRIMARY }, system && { width: 34, height: 34 }, !system && styles.iconShadow ]; const container = [ styles.card, !transparent && { backgroundColor: argonTheme.COLORS.WHITE }, !transparent && styles.cardShadow, system && { height: 78 }, style ]; return ( {system && ( {title} {time} )} {body} {!system && ( {time} )} ); } } Notification.propTypes = { body: PropTypes.string, color: PropTypes.string, iconColor: PropTypes.string, iconFamily: PropTypes.string, iconName: PropTypes.string, iconSize: PropTypes.number, onPress: PropTypes.func, style: PropTypes.object, system: PropTypes.bool, time: PropTypes.string, title: PropTypes.string, transparent: PropTypes.bool, }; const styles = StyleSheet.create({ iconContainer: { width: 46, height: 46, borderRadius: 23, marginTop: 2 }, iconShadow: { shadowColor: "black", shadowOffset: { width: 0, height: 4 }, shadowRadius: 4, shadowOpacity: 0.1, elevation: 2 }, card: { zIndex: 2, height: 127, borderRadius: 6 }, cardShadow: { shadowColor: argonTheme.COLORS.BLACK, shadowOffset: { width: 0, height: 2 }, shadowRadius: 4, shadowOpacity: 0.1, elevation: 2 } });