Skip to content

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sohantalukder committed Jan 7, 2025
1 parent 17befd4 commit dac426a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 22 deletions.
Binary file modified .DS_Store
Binary file not shown.
6 changes: 3 additions & 3 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
TextStyle,
ViewStyle,
} from 'react-native';
import {CountryCode, EachCountry} from './lib/constants/types';
import { CountryCode, EachCountry } from './lib/constants/types';

/**
* Props for the RNPhoneInput component.
Expand Down Expand Up @@ -52,7 +52,7 @@ interface RNPhoneInputProps {
* @param value - The selected country's details excluding `countryCode` and `callingCode`.
*/
onSelectCountryCode?: (
value: Omit<EachCountry, 'countryCode' | 'callingCode'>,
value: Omit<EachCountry, 'countryCode' | 'callingCode'>
) => void;

/**
Expand Down Expand Up @@ -105,4 +105,4 @@ interface RNPhoneInputRef {
*/
defaultValue?: (text: string) => void;
}
export type {RNPhoneInputProps,RNPhoneInputRef};
export type { RNPhoneInputProps, RNPhoneInputRef };
22 changes: 10 additions & 12 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,15 @@ import {
Image,
useColorScheme,
} from 'react-native';
import {forwardRef, useImperativeHandle, useState} from 'react';
import { forwardRef, useImperativeHandle, useState } from 'react';
import constants from './lib/constants/constants';

Check failure on line 10 in src/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Cannot find module './lib/constants/constants' or its corresponding type declarations.
import Picker from './lib/country-picker/Picker';

Check failure on line 11 in src/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Cannot find module './lib/country-picker/Picker' or its corresponding type declarations.
import assets from './lib/assets/assets';

Check failure on line 12 in src/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Cannot find module './lib/assets/assets' or its corresponding type declarations.
import styles from './styles';
import type { RNPhoneInputProps, RNPhoneInputRef } from './index.d';
import type {CountryCode, EachCountry} from './lib/constants/types';
import type { CountryCode, EachCountry } from './lib/constants/types';

Check failure on line 15 in src/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Cannot find module './lib/constants/types' or its corresponding type declarations.

const RNPhoneInput = forwardRef<
RNPhoneInputRef,
RNPhoneInputProps
>(
const RNPhoneInput = forwardRef<RNPhoneInputRef, RNPhoneInputProps>(
(
{
downArrowIcon,
Expand All @@ -33,17 +30,17 @@ const RNPhoneInput = forwardRef<
codeTextStyle,
iconContainerStyle,
},
ref,
ref
) => {
const [country, setCountry] = useState<EachCountry>(
constants[defaultCountry || 'BD'],
constants[defaultCountry || 'BD']
);
const [value, setValue] = useState<string>(defaultValue || '');
const scheme = useColorScheme();
const openBottomSheet = () => {
global.openCountryModal({

Check failure on line 41 in src/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.
component: Picker as any,
componentProps: {onSelect: onSelect},
componentProps: { onSelect: onSelect },
});
};
useImperativeHandle(ref, () => ({
Expand Down Expand Up @@ -77,7 +74,8 @@ const RNPhoneInput = forwardRef<
<TouchableOpacity
activeOpacity={0.7}
onPress={openBottomSheet}
style={[styles.flexRow, iconContainerStyle]}>
style={[styles.flexRow, iconContainerStyle]}
>
<Text style={styles.ft28}>{country.icon}</Text>
{downArrowIcon && (
<Image
Expand Down Expand Up @@ -110,7 +108,7 @@ const RNPhoneInput = forwardRef<
</View>
</View>
);
},
}
);
export type {RNPhoneInputProps, RNPhoneInputRef, CountryCode};
export type { RNPhoneInputProps, RNPhoneInputRef, CountryCode };
export default RNPhoneInput;
2 changes: 1 addition & 1 deletion src/styles.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {DimensionValue} from 'react-native';
import { DimensionValue } from 'react-native';

type ContainerStyle = {
flexDirection: 'row';
Expand Down
12 changes: 6 additions & 6 deletions src/styles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {StyleSheet} from 'react-native';
import { StyleSheet } from 'react-native';
import Styles from './styles.d';
const styles: Styles = StyleSheet.create({
container: {
Expand All @@ -12,11 +12,11 @@ const styles: Styles = StyleSheet.create({
paddingHorizontal: 22,
flexShrink: 1,
},
flexRow: {flexDirection: 'row', alignItems: 'center', gap: 8},
gap10: {gap: 10},
ft28: {fontSize: 28},
ft16: {fontSize: 16, color: 'black'},
width75: {width: '75%'},
flexRow: { flexDirection: 'row', alignItems: 'center', gap: 8 },
gap10: { gap: 10 },
ft28: { fontSize: 28 },
ft16: { fontSize: 16, color: 'black' },
width75: { width: '75%' },
});

export default styles;

0 comments on commit dac426a

Please sign in to comment.