Skip to content

Commit

Permalink
feat: style prop
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathChaos committed Dec 3, 2023
1 parent 3d95119 commit 0a8be71
Show file tree
Hide file tree
Showing 4 changed files with 27,045 additions and 6,094 deletions.
17 changes: 6 additions & 11 deletions lib/InteractiveTextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
ImageStyle,
ImageSourcePropType,
} from "react-native";

/**
* ? Local Imports
*/
Expand All @@ -25,17 +26,11 @@ const PLACEHOLDER_COLOR = "#757575";
const ORIGINAL_VALUE = 0;
const ANIMATED_VALUE = 1;

type CustomStyleProp = StyleProp<ViewStyle> | Array<StyleProp<ViewStyle>>;
type CustomTextStyleProp = StyleProp<TextStyle> | Array<StyleProp<TextStyle>>;
type CustomImageStyleProp =
| StyleProp<ImageStyle>
| Array<StyleProp<ImageStyle>>;

export interface IInteractiveTextInputProps extends TextInputProps {
style?: CustomStyleProp;
textInputStyle?: CustomTextStyleProp;
iconContainerStyle?: CustomStyleProp;
iconImageStyle?: CustomImageStyleProp;
style?: StyleProp<ViewStyle>;
textInputStyle?: StyleProp<TextStyle>;
iconContainerStyle?: StyleProp<ViewStyle>;
iconImageStyle?: StyleProp<ImageStyle>;
iconImageSource?: ImageSourcePropType;
ImageComponent?: any;
IconComponent?: any;
Expand Down Expand Up @@ -143,7 +138,7 @@ export default class InteractiveTextInput extends React.Component<

render() {
return (
<View style={styles.container}>
<View style={[styles.container, this.props.style]}>
{this.renderAnimatedTextInput()}
{this.renderIcon()}
</View>
Expand Down
Loading

0 comments on commit 0a8be71

Please sign in to comment.