Fix TypeScript compilation errors across components, selectors, and profile module
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
type GestureResponderEvent,
|
||||
type StyleProp,
|
||||
type ViewStyle,
|
||||
type TextStyle,
|
||||
} from 'react-native';
|
||||
import LinearGradient from 'react-native-linear-gradient';
|
||||
|
||||
@@ -24,6 +25,7 @@ interface ButtonProps {
|
||||
loading?: boolean;
|
||||
fullWidth?: boolean;
|
||||
style?: StyleProp<ViewStyle>;
|
||||
textStyle?: StyleProp<TextStyle>;
|
||||
leftAccessory?: React.ReactNode;
|
||||
}
|
||||
|
||||
@@ -35,6 +37,7 @@ const ButtonComponent = ({
|
||||
loading = false,
|
||||
fullWidth = true,
|
||||
style,
|
||||
textStyle,
|
||||
leftAccessory,
|
||||
}: ButtonProps) => {
|
||||
const theme = useTheme();
|
||||
@@ -94,6 +97,7 @@ const ButtonComponent = ({
|
||||
letterSpacing: variant === 'cyber' ? 2 : 0,
|
||||
textTransform: variant === 'cyber' ? 'uppercase' : 'none',
|
||||
},
|
||||
textStyle,
|
||||
]}
|
||||
>
|
||||
{title}
|
||||
|
||||
@@ -51,9 +51,13 @@ const parseDDMMYYYY = (str: string | undefined): Date | null => {
|
||||
if (!str) return null;
|
||||
const parts = str.split('/');
|
||||
if (parts.length !== 3) return null;
|
||||
const d = parseInt(parts[0], 10);
|
||||
const m = parseInt(parts[1], 10) - 1;
|
||||
const y = parseInt(parts[2], 10);
|
||||
const part0 = parts[0];
|
||||
const part1 = parts[1];
|
||||
const part2 = parts[2];
|
||||
if (!part0 || !part1 || !part2) return null;
|
||||
const d = parseInt(part0, 10);
|
||||
const m = parseInt(part1, 10) - 1;
|
||||
const y = parseInt(part2, 10);
|
||||
if (isNaN(d) || isNaN(m) || isNaN(y)) return null;
|
||||
return new Date(y, m, d);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user