Clean up stuff
This commit is contained in:
parent
67179593cb
commit
b9802f7b1f
@ -134,11 +134,13 @@ const ProfileScreen = () => {
|
|||||||
onChangeText={(text) => setProfile(prev => ({ ...prev, full_name: text }))}
|
onChangeText={(text) => setProfile(prev => ({ ...prev, full_name: text }))}
|
||||||
placeholder="Enter your full name"
|
placeholder="Enter your full name"
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
|
fontSize={20}
|
||||||
editable={!updating}
|
editable={!updating}
|
||||||
autoCapitalize='words'
|
autoCapitalize='words'
|
||||||
textContentType='name'
|
textContentType='name'
|
||||||
maxLength={50}
|
maxLength={50}
|
||||||
returnKeyType='done'
|
returnKeyType='done'
|
||||||
|
secureTextEntry={false}
|
||||||
/>
|
/>
|
||||||
</ThemedView>
|
</ThemedView>
|
||||||
|
|
||||||
@ -183,30 +185,33 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
formSection: {
|
formSection: {
|
||||||
marginBottom: 20,
|
marginBottom: 20,
|
||||||
|
width: '100%',
|
||||||
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
marginBottom: 8,
|
marginBottom: 8,
|
||||||
fontSize: 16,
|
fontSize: 18,
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
|
alignSelf: 'flex-start',
|
||||||
|
marginLeft: '5%',
|
||||||
},
|
},
|
||||||
input: {
|
input: {
|
||||||
fontSize: 16,
|
|
||||||
paddingVertical: 12,
|
paddingVertical: 12,
|
||||||
paddingHorizontal: 10,
|
paddingHorizontal: 10,
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
marginBottom: 20,
|
marginBottom: 20,
|
||||||
width: '100%',
|
|
||||||
},
|
},
|
||||||
disabledInput: {
|
disabledInput: {
|
||||||
opacity: 0.7,
|
opacity: 0.7,
|
||||||
},
|
},
|
||||||
saveButton: {
|
saveButton: {
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
alignItems: 'center',
|
marginTop: 20,
|
||||||
marginBottom: 10,
|
marginBottom: 10,
|
||||||
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
logoutButton: {
|
logoutButton: {
|
||||||
marginTop: 30,
|
marginTop: 10,
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
// components/status/StatusCard.tsx
|
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import {
|
import {
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
Modal,
|
Modal,
|
||||||
TouchableOpacity,
|
|
||||||
TouchableWithoutFeedback,
|
TouchableWithoutFeedback,
|
||||||
KeyboardAvoidingView,
|
KeyboardAvoidingView,
|
||||||
Platform,
|
Platform,
|
||||||
@ -66,6 +64,11 @@ export default function StatusCard({ visible, user, onClose, onUpdate }: StatusC
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleCancel = () => {
|
||||||
|
setNewStatus('');
|
||||||
|
onClose();
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
animationType="slide"
|
animationType="slide"
|
||||||
@ -87,14 +90,14 @@ export default function StatusCard({ visible, user, onClose, onUpdate }: StatusC
|
|||||||
<View style={styles.userInfoContainer}>
|
<View style={styles.userInfoContainer}>
|
||||||
<ProfileAvatar
|
<ProfileAvatar
|
||||||
url={user.profiles.avatar_url}
|
url={user.profiles.avatar_url}
|
||||||
size={60}
|
size={75}
|
||||||
disabled={true}
|
disabled={true}
|
||||||
/>
|
/>
|
||||||
<ThemedText style={styles.userName}>
|
<ThemedText style={styles.userName}>
|
||||||
{user.profiles.full_name}
|
{user.profiles.full_name}
|
||||||
</ThemedText>
|
</ThemedText>
|
||||||
<ThemedText style={styles.currentStatus}>
|
<ThemedText style={styles.currentStatus}>
|
||||||
Current: {user.status}
|
{user.status}
|
||||||
</ThemedText>
|
</ThemedText>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
@ -104,7 +107,10 @@ export default function StatusCard({ visible, user, onClose, onUpdate }: StatusC
|
|||||||
value={newStatus}
|
value={newStatus}
|
||||||
onChangeText={setNewStatus}
|
onChangeText={setNewStatus}
|
||||||
placeholder="What's happening?"
|
placeholder="What's happening?"
|
||||||
|
fontSize={18}
|
||||||
maxLength={80}
|
maxLength={80}
|
||||||
|
width='95%'
|
||||||
|
height={80}
|
||||||
multiline
|
multiline
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
editable={!updating}
|
editable={!updating}
|
||||||
@ -126,13 +132,16 @@ export default function StatusCard({ visible, user, onClose, onUpdate }: StatusC
|
|||||||
style={styles.updateButton}
|
style={styles.updateButton}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TouchableOpacity
|
<ThemedTextButton
|
||||||
style={styles.cancelButton}
|
text='Cancel'
|
||||||
onPress={onClose}
|
onPress={handleCancel}
|
||||||
|
backgroundColor='red'
|
||||||
disabled={updating}
|
disabled={updating}
|
||||||
>
|
textColor='white'
|
||||||
<ThemedText style={styles.cancelText}>Cancel</ThemedText>
|
width='100%'
|
||||||
</TouchableOpacity>
|
fontSize={18}
|
||||||
|
fontWeight='500'
|
||||||
|
/>
|
||||||
</ThemedView>
|
</ThemedView>
|
||||||
</KeyboardAvoidingView>
|
</KeyboardAvoidingView>
|
||||||
</Modal>
|
</Modal>
|
||||||
@ -142,7 +151,6 @@ export default function StatusCard({ visible, user, onClose, onUpdate }: StatusC
|
|||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
modalOverlay: {
|
modalOverlay: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
||||||
},
|
},
|
||||||
keyboardAvoidingView: {
|
keyboardAvoidingView: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
@ -169,47 +177,41 @@ const styles = StyleSheet.create({
|
|||||||
marginBottom: 20,
|
marginBottom: 20,
|
||||||
},
|
},
|
||||||
userName: {
|
userName: {
|
||||||
fontSize: 18,
|
fontSize: 20,
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
marginTop: 10,
|
marginTop: 10,
|
||||||
},
|
},
|
||||||
currentStatus: {
|
currentStatus: {
|
||||||
fontSize: 16,
|
fontSize: 18,
|
||||||
marginTop: 5,
|
marginTop: 5,
|
||||||
opacity: 0.7,
|
opacity: 0.7,
|
||||||
},
|
},
|
||||||
inputContainer: {
|
inputContainer: {
|
||||||
marginBottom: 20,
|
marginBottom: 10,
|
||||||
|
alignItems: 'center',
|
||||||
|
padding: 10,
|
||||||
},
|
},
|
||||||
inputLabel: {
|
inputLabel: {
|
||||||
fontSize: 16,
|
fontSize: 18,
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
marginBottom: 8,
|
marginBottom: 8,
|
||||||
|
alignSelf: 'flex-start',
|
||||||
|
marginLeft: '5%',
|
||||||
},
|
},
|
||||||
input: {
|
input: {
|
||||||
fontSize: 16,
|
|
||||||
paddingVertical: 12,
|
paddingVertical: 12,
|
||||||
paddingHorizontal: 10,
|
paddingHorizontal: 10,
|
||||||
borderRadius: 8,
|
minHeight: 100,
|
||||||
minHeight: 80,
|
|
||||||
textAlignVertical: 'top',
|
textAlignVertical: 'top',
|
||||||
},
|
},
|
||||||
charCount: {
|
charCount: {
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
alignSelf: 'flex-end',
|
alignSelf: 'flex-end',
|
||||||
marginTop: 4,
|
marginTop: 5,
|
||||||
opacity: 0.6,
|
opacity: 0.6,
|
||||||
},
|
},
|
||||||
updateButton: {
|
updateButton: {
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
marginBottom: 15,
|
marginBottom: 15,
|
||||||
},
|
},
|
||||||
cancelButton: {
|
|
||||||
alignItems: 'center',
|
|
||||||
padding: 10,
|
|
||||||
},
|
|
||||||
cancelText: {
|
|
||||||
fontSize: 16,
|
|
||||||
color: '#FF3B30',
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
@ -4,9 +4,6 @@ import ThemedView from '@/components/theme/default/ThemedView';
|
|||||||
import { Colors } from '@/constants/Colors';
|
import { Colors } from '@/constants/Colors';
|
||||||
import { useColorScheme } from '@/hooks/useColorScheme';
|
import { useColorScheme } from '@/hooks/useColorScheme';
|
||||||
|
|
||||||
const DEFAULT_WIDTH = 320;
|
|
||||||
const DEFAULT_HEIGHT = 50;
|
|
||||||
|
|
||||||
type ThemedTextInputProps = TextInputProps & {
|
type ThemedTextInputProps = TextInputProps & {
|
||||||
width?: DimensionValue;
|
width?: DimensionValue;
|
||||||
height?: DimensionValue;
|
height?: DimensionValue;
|
||||||
@ -15,8 +12,8 @@ type ThemedTextInputProps = TextInputProps & {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const ThemedTextInput: React.FC<ThemedTextInputProps> = ({
|
const ThemedTextInput: React.FC<ThemedTextInputProps> = ({
|
||||||
width = DEFAULT_WIDTH,
|
width='90%',
|
||||||
height = DEFAULT_HEIGHT,
|
height=50,
|
||||||
fontSize = 16,
|
fontSize = 16,
|
||||||
containerStyle,
|
containerStyle,
|
||||||
style,
|
style,
|
||||||
@ -29,9 +26,9 @@ const ThemedTextInput: React.FC<ThemedTextInputProps> = ({
|
|||||||
style={[
|
style={[
|
||||||
styles.inputContainer,
|
styles.inputContainer,
|
||||||
{
|
{
|
||||||
|
borderColor: Colors[scheme].accent,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
borderColor: Colors[scheme].accent,
|
|
||||||
},
|
},
|
||||||
containerStyle,
|
containerStyle,
|
||||||
]}
|
]}
|
||||||
@ -43,7 +40,6 @@ const ThemedTextInput: React.FC<ThemedTextInputProps> = ({
|
|||||||
color: Colors[scheme].text,
|
color: Colors[scheme].text,
|
||||||
backgroundColor: Colors[scheme].background,
|
backgroundColor: Colors[scheme].background,
|
||||||
fontSize,
|
fontSize,
|
||||||
lineHeight: fontSize * 1.5,
|
|
||||||
},
|
},
|
||||||
style,
|
style,
|
||||||
]}
|
]}
|
||||||
@ -65,7 +61,6 @@ const styles = StyleSheet.create({
|
|||||||
input: {
|
input: {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
borderRadius: 8,
|
|
||||||
paddingHorizontal: 15,
|
paddingHorizontal: 15,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user