UNPKG

kia-ml

Version:

Kia

32 lines (27 loc) 738 B
import * as React from "react"; import { View, Text } from "react-native"; import * as styles from "./toast-style"; import { color } from "../../theme"; export function Toast(props) { const generateBG = () => { const type = props.type || 'info'; switch (type) { case 'info': return color.accent; case 'error': return color.error; case 'warning': return color.palette.orange; } return color.accent; }; return /*#__PURE__*/React.createElement(View, { style: styles.baseView }, /*#__PURE__*/React.createElement(Text, { numberOfLines: 1, style: { ...styles.text, backgroundColor: generateBG() } }, props.text)); } //# sourceMappingURL=toast.js.map