Looking okay now
This commit is contained in:
@ -7,7 +7,8 @@ import {
|
||||
Keyboard,
|
||||
TouchableWithoutFeedback,
|
||||
KeyboardAvoidingView,
|
||||
Platform
|
||||
Platform,
|
||||
View
|
||||
} from 'react-native';
|
||||
import { ThemedText } from '@/components/ThemedText';
|
||||
import { ThemedView } from '@/components/ThemedView';
|
||||
@ -21,6 +22,11 @@ const BASE_URL = process.env.EXPO_PUBLIC_BASE_URL;
|
||||
export default function SendMessageScreen() {
|
||||
const [message, setMessage] = useState('');
|
||||
const [userId, setUserId] = useState(null);
|
||||
const [inputHeight, setInputHeight] = useState(100);
|
||||
|
||||
const updateInputHeight = (height: number) => {
|
||||
setInputHeight(Math.max(100, height));
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getUserId();
|
||||
@ -75,20 +81,24 @@ export default function SendMessageScreen() {
|
||||
start={{ x: 0, y: 0 }}
|
||||
end={{ x: 1, y: 1 }}
|
||||
>
|
||||
<ThemedView style={styles.container}>
|
||||
<ThemedText style={styles.title}>Send a Message</ThemedText>
|
||||
<TextInput
|
||||
style={styles.input}
|
||||
value={message}
|
||||
onChangeText={setMessage}
|
||||
placeholder="Enter your message"
|
||||
placeholderTextColor="#BBB"
|
||||
multiline
|
||||
/>
|
||||
<View style={styles.container}>
|
||||
<TextInput
|
||||
style={[styles.input, { height: inputHeight }]}
|
||||
value={message}
|
||||
onChangeText={setMessage}
|
||||
placeholder="Send a message"
|
||||
placeholderTextColor="#FFFFFF"
|
||||
multiline
|
||||
numberOfLines={4}
|
||||
textAlignVertical="top"
|
||||
onContentSizeChange={(event) =>
|
||||
updateInputHeight(event.nativeEvent.contentSize.height)
|
||||
}
|
||||
/>
|
||||
<TouchableOpacity style={styles.button} onPress={sendMessage}>
|
||||
<ThemedText style={styles.buttonText}>Send Message</ThemedText>
|
||||
</TouchableOpacity>
|
||||
</ThemedView>
|
||||
</View>
|
||||
</LinearGradient>
|
||||
</TouchableWithoutFeedback>
|
||||
</KeyboardAvoidingView>
|
||||
@ -101,26 +111,21 @@ const styles = StyleSheet.create({
|
||||
alignItems: 'center',
|
||||
padding: 20,
|
||||
backgroundColor: 'transparent',
|
||||
},
|
||||
title: {
|
||||
fontSize: 48,
|
||||
lineHeight: 60,
|
||||
fontWeight: 'bold',
|
||||
marginTop: 80,
|
||||
marginBottom: 40,
|
||||
textAlign: 'center',
|
||||
width: '100%',
|
||||
},
|
||||
input: {
|
||||
width: '100%',
|
||||
height: 80,
|
||||
minHeight: 100,
|
||||
borderColor: 'transparent',
|
||||
borderWidth: 1,
|
||||
borderRadius: 10,
|
||||
padding: 10,
|
||||
marginBottom: 20,
|
||||
textAlignVertical: 'top',
|
||||
color: '#FFF',
|
||||
fontSize: 32,
|
||||
backgroundColor: 'black',
|
||||
fontSize: 42,
|
||||
textAlign: 'center',
|
||||
color: '#FFFFFF',
|
||||
fontWeight: 'bold',
|
||||
backgroundColor: 'transparent',
|
||||
},
|
||||
button: {
|
||||
backgroundColor: '#730FF8',
|
||||
|
Reference in New Issue
Block a user