import React, { FunctionComponent } from 'react'; import { SafeAreaView, StyleSheet, Text, TextStyle, ViewStyle, } from 'react-native'; import { IStyledProps } from './types'; interface IProps extends IStyledProps { msg: string; } interface IPannerStyleProps { container?: ViewStyle; pannerText?: TextStyle; } export const WarningPanner: FunctionComponent = ({ msg, style }) => { const mergedStyle = { ...defaultStyles, ...style }; return ( {msg} ); }; const defaultStyles: IPannerStyleProps = StyleSheet.create({ container: { backgroundColor: 'orange', justifyContent: 'center', alignItems: 'center', flexDirection: 'row', height: 30, }, pannerText: { color: 'white', marginRight: 10, fontSize: 18, }, });