frontend: adapt input and buttons colors
Pedro Lucas Porcellis porcellis@eletrotupi.com · 5 months ago
fa5bcca41e5cdfcb856af45b84338a6fd1760069 Browse filesParents
4780abaChanged files
2
Additions
+4
Deletions
-9
frontend/components/ui/Button.tsx
1 1
import React from 'react';
2 2
import {
3 3
TouchableOpacity,
4 4
Text,
5 5
StyleSheet,
50 50
return primaryColor;
51 51
}
52 52
};
53 53
54 54
const getTextColor = () => {
55 -
if (disabled) return useThemeColor({ light: '#9ca3af', dark: '#6b7280' }, 'text');
55 +
if (disabled) return useThemeColor({}, 'text');
56 56
switch (variant) {
57 57
case 'primary':
58 -
return '#fff';
59 58
case 'secondary':
60 59
case 'outline':
61 60
case 'ghost':
62 61
return textColor;
63 62
default:
149 148
},
150 149
text: {
151 150
fontWeight: '600',
152 151
},
153 152
});
frontend/components/ui/Input.tsx
1 1
import React from 'react';
2 2
import {
3 3
TextInput,
4 4
TextInputProps,
5 5
StyleSheet,
26 26
style,
27 27
...props
28 28
}) => {
29 29
const [showPassword, setShowPassword] = React.useState(false);
30 30
const textColor = useThemeColor({}, 'text');
31 -
const backgroundColor = useThemeColor({ light: '#f5f5f5', dark: '#2a2a2a' }, 'background');
32 -
const borderColor = useThemeColor({ light: '#e0e0e0', dark: '#404040' }, 'border');
31 +
const backgroundColor = useThemeColor({}, 'inputBackgroundColor');
32 +
const borderColor = useThemeColor({}, 'inputBorderColor');
33 33
const errorColor = '#ef4444';
34 34
const placeholderColor = useThemeColor({ light: '#9ca3af', dark: '#6b7280' }, 'placeholder');
35 35
36 36
const keyboardType = type === 'email' ? 'email-address' : 'default';
37 37
const secureTextEntry = type === 'password' && !showPassword;
96 96
paddingHorizontal: 12,
97 97
paddingRight: 44,
98 98
borderWidth: 1,
99 99
borderRadius: 8,
100 100
fontSize: 16,
101 -
...Platform.select({
102 -
web: {
103 -
outlineStyle: 'none',
104 -
},
105 -
}),
106 101
},
107 102
passwordToggle: {
108 103
position: 'absolute',
109 104
right: 12,
110 105
top: 13,
111 106
},
112 107
error: {
113 108
fontSize: 12,
114 109
marginTop: 4,
115 110
},
116 -
}); 111 +
});