Clean up login page
This commit is contained in:
		@@ -1,5 +1,5 @@
 | 
			
		||||
import React from 'react';
 | 
			
		||||
import { StyleSheet, Pressable, PressableProps } from 'react-native';
 | 
			
		||||
import { StyleSheet, Pressable, PressableProps, DimensionValue } from 'react-native';
 | 
			
		||||
import ThemedView from '@/components/theme/default/ThemedView';
 | 
			
		||||
import { Colors } from '@/constants/Colors';
 | 
			
		||||
import { useColorScheme } from '@/hooks/useColorScheme';
 | 
			
		||||
@@ -8,8 +8,8 @@ const DEFAULT_WIDTH = 320;
 | 
			
		||||
const DEFAULT_HEIGHT = 68;
 | 
			
		||||
 | 
			
		||||
type ThemedButtonProps = PressableProps & {
 | 
			
		||||
  width?: number;
 | 
			
		||||
  height?: number;
 | 
			
		||||
  width?: DimensionValue;
 | 
			
		||||
  height?: DimensionValue;
 | 
			
		||||
  containerStyle?: object;
 | 
			
		||||
  buttonStyle?: object;
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -1,18 +1,17 @@
 | 
			
		||||
import React from 'react';
 | 
			
		||||
import { TextStyle, PressableProps } from 'react-native';
 | 
			
		||||
import { TextStyle, PressableProps, DimensionValue } from 'react-native';
 | 
			
		||||
import ThemedButton from '@/components/theme/buttons/ThemedButton';
 | 
			
		||||
import ThemedText from '@/components/theme/default/ThemedText';
 | 
			
		||||
import { Colors } from '@/constants/Colors';
 | 
			
		||||
import { useColorScheme } from '@/hooks/useColorScheme';
 | 
			
		||||
 | 
			
		||||
const DEFAULT_FONT_SIZE = 16;
 | 
			
		||||
 | 
			
		||||
// Extend ThemedButton props (which already extends PressableProps)
 | 
			
		||||
type ThemedTextButtonProps = Omit<PressableProps, 'children'> & {
 | 
			
		||||
  width?: number;
 | 
			
		||||
  height?: number;
 | 
			
		||||
  width?: DimensionValue;
 | 
			
		||||
  height?: DimensionValue;
 | 
			
		||||
  text: string;
 | 
			
		||||
  fontSize?: number;
 | 
			
		||||
  fontWeight?: 'normal' | 'semibold' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
 | 
			
		||||
  textStyle?: TextStyle;
 | 
			
		||||
  containerStyle?: object;
 | 
			
		||||
  buttonStyle?: object;
 | 
			
		||||
@@ -22,13 +21,15 @@ const ThemedTextButton: React.FC<ThemedTextButtonProps> = ({
 | 
			
		||||
  width,
 | 
			
		||||
  height,
 | 
			
		||||
  text,
 | 
			
		||||
  fontSize,
 | 
			
		||||
  fontSize = 16,
 | 
			
		||||
  fontWeight = 'normal',
 | 
			
		||||
  textStyle,
 | 
			
		||||
  containerStyle,
 | 
			
		||||
  buttonStyle,
 | 
			
		||||
  ...restProps // This includes onPress and all other Pressable props
 | 
			
		||||
}) => {
 | 
			
		||||
  const scheme = useColorScheme() ?? 'dark';
 | 
			
		||||
  if (fontWeight === 'semibold') fontWeight = '600';
 | 
			
		||||
 | 
			
		||||
  return (
 | 
			
		||||
    <ThemedButton
 | 
			
		||||
@@ -42,7 +43,9 @@ const ThemedTextButton: React.FC<ThemedTextButtonProps> = ({
 | 
			
		||||
        style={[
 | 
			
		||||
          {
 | 
			
		||||
            color: Colors[scheme].background,
 | 
			
		||||
            fontSize: fontSize ?? DEFAULT_FONT_SIZE,
 | 
			
		||||
            fontSize,
 | 
			
		||||
            lineHeight: fontSize * 1.5,
 | 
			
		||||
            fontWeight,
 | 
			
		||||
          },
 | 
			
		||||
          textStyle,
 | 
			
		||||
        ]}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user