Skip to content

Commit

Permalink
fix: fix input style prop typing
Browse files Browse the repository at this point in the history
  • Loading branch information
mustapha-ghlissi committed Jul 18, 2024
1 parent e0bc52e commit 88a7d95
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
10 changes: 9 additions & 1 deletion example/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@ function App(): React.JSX.Element {
</View>
<View style={styles.content}>
<Text style={styles.label}>Advanced OTP</Text>
<OTP onConfirm={(code: number) => console.log(code)} length={6} />
<OTP
onConfirm={(code: number) => console.log(code)}
length={6}
inputStyle={{
height: 48,
width: 48,
borderRadius: 48,
}}
/>
</View>
</SafeAreaView>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/OTP.types.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {ViewStyle} from 'react-native';
import { TextStyle, StyleProp, ViewStyle } from 'react-native';

export type OTPProps = {
length?: number;
fillBorderColor?: string;
enabledFillShadow?: boolean;
cursorColor?: string;
selectionColor?: string;
inputStyle?: ViewStyle;
inputStyle?: TextStyle | StyleProp<ViewStyle>;
onConfirm: (code: number) => void;
};
6 changes: 3 additions & 3 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
declare module '@mustapha-ghlissi/react-native-otp' {
import React from 'react';
import {ViewStyle} from 'react-native';
import { TextStyle, StyleProp, ViewStyle } from 'react-native';

export type OTPProps = {
length?: number;
fillBorderColor?: string;
enabledFillShadow?: boolean;
cursorColor?: string;
selectionColor?: string;
inputStyle?: ViewStyle;
inputStyle?: TextStyle | StyleProp<ViewStyle>;
onConfirm: (code: number) => void;
};

const OTP: React.FC<OTPProps>;
export default OTP;
}

0 comments on commit 88a7d95

Please sign in to comment.