Finish cleaning up theme stuff
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
import { StyleSheet, ViewProps, View, DimensionValue } from 'react-native';
|
||||
import { StyleSheet, ViewProps, DimensionValue } from 'react-native';
|
||||
import ThemedView from '@/components/theme/default/ThemedView';
|
||||
import ThemedTextInput from '@/components/theme/inputs/ThemedTextInput';
|
||||
import { Ionicons } from '@expo/vector-icons';
|
||||
import { ThemedTextInput } from '@/components/theme';
|
||||
import { Colors } from '@/constants/Colors';
|
||||
import { useColorScheme } from '@/hooks/useColorScheme';
|
||||
|
||||
@ -23,15 +24,10 @@ const ThemedSearchBar: React.FC<ThemedSearchBarProps> = ({
|
||||
...restProps
|
||||
}) => {
|
||||
const scheme = useColorScheme() ?? 'dark';
|
||||
|
||||
|
||||
return (
|
||||
<View style={[styles.container, { width }, style]} {...restProps}>
|
||||
<Ionicons
|
||||
name="search"
|
||||
size={20}
|
||||
color={Colors[scheme].text}
|
||||
style={styles.icon}
|
||||
/>
|
||||
<ThemedView style={[styles.container, { width }, style]} {...restProps}>
|
||||
<Ionicons name='search' size={20} color={Colors[scheme].text} style={styles.icon} />
|
||||
<ThemedTextInput
|
||||
placeholder={placeholder}
|
||||
value={value}
|
||||
@ -40,7 +36,7 @@ const ThemedSearchBar: React.FC<ThemedSearchBarProps> = ({
|
||||
width={width}
|
||||
style={styles.input}
|
||||
/>
|
||||
</View>
|
||||
</ThemedView>
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -5,16 +5,14 @@ import { useColorScheme } from '@/hooks/useColorScheme';
|
||||
|
||||
type ThemedSwitchProps = SwitchProps;
|
||||
|
||||
const ThemedSwitch: React.FC<ThemedSwitchProps> = ({
|
||||
...props
|
||||
}) => {
|
||||
const ThemedSwitch: React.FC<ThemedSwitchProps> = ({ ...props }) => {
|
||||
const scheme = useColorScheme() ?? 'dark';
|
||||
|
||||
|
||||
return (
|
||||
<Switch
|
||||
trackColor={{
|
||||
false: Colors[scheme].border,
|
||||
true: Colors[scheme].tint + '80'
|
||||
trackColor={{
|
||||
false: Colors[scheme].border,
|
||||
true: Colors[scheme].tint + '80',
|
||||
}}
|
||||
thumbColor={props.value ? Colors[scheme].tint : Colors[scheme].card}
|
||||
ios_backgroundColor={Colors[scheme].border}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { StyleSheet, TextInput, TextInputProps, DimensionValue } from 'react-native';
|
||||
import { ThemedView } from '@/components/theme';
|
||||
import ThemedView from '@/components/theme/default/ThemedView';
|
||||
import { Colors } from '@/constants/Colors';
|
||||
import { useColorScheme } from '@/hooks/useColorScheme';
|
||||
|
||||
@ -9,7 +9,7 @@ const DEFAULT_HEIGHT = 50;
|
||||
|
||||
type ThemedTextInputProps = TextInputProps & {
|
||||
width?: DimensionValue;
|
||||
height?: DimensionValue
|
||||
height?: DimensionValue;
|
||||
containerStyle?: object;
|
||||
};
|
||||
|
||||
@ -21,19 +21,13 @@ const ThemedTextInput: React.FC<ThemedTextInputProps> = ({
|
||||
...restProps
|
||||
}) => {
|
||||
const scheme = useColorScheme() ?? 'dark';
|
||||
|
||||
|
||||
return (
|
||||
<ThemedView
|
||||
style={[
|
||||
styles.inputContainer,
|
||||
{ width, height },
|
||||
containerStyle,
|
||||
]}
|
||||
>
|
||||
<ThemedView style={[styles.inputContainer, { width, height }, containerStyle]}>
|
||||
<TextInput
|
||||
style={[
|
||||
styles.input,
|
||||
{
|
||||
{
|
||||
color: Colors[scheme].text,
|
||||
backgroundColor: Colors[scheme].background,
|
||||
},
|
||||
|
Reference in New Issue
Block a user