11import React , { useState } from 'react' ;
2- import { StyleProp , Text , TouchableWithoutFeedback , View , ViewStyle , StyleSheet } from 'react-native' ;
2+ import { StyleProp , Text , TouchableWithoutFeedback , View , ViewStyle , TextStyle , StyleSheet } from 'react-native' ;
33import Icon from '../Icon' ;
44import Marquee , { MarqueeProps } from './Marquee' ;
55
@@ -9,6 +9,7 @@ export type NoticeBarProps = {
99 onPress ?: any ;
1010 icon ?: any ;
1111 action ?: any ;
12+ textStyle ?: StyleProp < TextStyle > ;
1213 style ?: StyleProp < ViewStyle > ;
1314 marqueeProps ?: MarqueeProps ;
1415} ;
@@ -25,7 +26,8 @@ export default (props: NoticeBarProps) => {
2526 setShow ( false ) ;
2627 }
2728 } ;
28- let { children, mode, icon, style, action, marqueeProps } = props ;
29+ let { children, mode, icon, style, action, marqueeProps, textStyle } = props ;
30+
2931 let operationDom : any = null ;
3032 icon = typeof icon === 'undefined' ? < Icon name = "notification" color = "#f4333c" size = { 15 } /> : icon ;
3133 if ( mode === 'closable' ) {
@@ -41,7 +43,7 @@ export default (props: NoticeBarProps) => {
4143 < View style = { [ styles . notice , style ] } >
4244 { icon && < View style = { styles . left15 } > { icon } </ View > }
4345 < View style = { [ styles . container , icon ? styles . left6 : styles . left15 ] } >
44- < Marquee style = { styles . content } text = { children } { ...marqueeProps } />
46+ < Marquee style = { [ styles . content , textStyle ] } text = { children } { ...marqueeProps } />
4547 </ View >
4648 { operationDom }
4749 </ View >
0 commit comments