web-ridge / react-native-paper-tabs

Smooth and fast cross platform Material Design Tabs for React Native Paper
https://reactnativepapertabs.com
MIT License
189 stars 34 forks source link

adding badgeStyle props #71

Open cyril36 opened 3 months ago

cyril36 commented 3 months ago

Hello,

I have added a badgeStyle props as commented in the issue https://github.com/web-ridge/react-native-paper-tabs/issues/67

I wanted to include all the badgeProps in this props as in the example : badgeProps={mybadgeProps}

but i dont know what kind of interface type i should use :

export interface TabScreenProps {
   label: string;
   icon?: IconSource;
   badge?: string | number | boolean;
   badgeProps?: ???;
   children: any;
   onPress?: (event: GestureResponderEvent) => void;
   onPressIn?: (event: GestureResponderEvent) => void;

I dont know much Typescript so if you want me to add more props and not just the style i can do a new PR later but i would appreciate if you can indicate me the type of the props i should put.

Meanwhile i hope this PR will be useful and thank you for this nice library ;)

cyril36 commented 3 months ago

After taking a break the obvious come to my mind and knew how to create this badgeProps and felt stupid about asking :D

I have updated the badgeStyle to badgeProps without including children as you already do it with the badge prop. I also kept your default value if the size is not mentioned in the badgeProps. I have also updated the readme with how to use the badgeProps prop Let me know if any update is needed