From 62bd85e65d540bcc056f481743856bd958ad02fd Mon Sep 17 00:00:00 2001 From: COURTES Guillaume <guillaumecourtes88@gmail.com> Date: Sat, 19 Jun 2021 18:50:54 +0200 Subject: [PATCH] fix chat text --- .../ChatApp/components/MessagesScreen.js | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/react-native/ChatApp/components/MessagesScreen.js b/react-native/ChatApp/components/MessagesScreen.js index 4d4f8bd5e..95b7d732d 100644 --- a/react-native/ChatApp/components/MessagesScreen.js +++ b/react-native/ChatApp/components/MessagesScreen.js @@ -1,7 +1,8 @@ import React from 'react'; import { View, Text, StyleSheet, ActivityIndicator } from 'react-native'; -import { GiftedChat, utils, Bubble } from 'react-native-gifted-chat'; +import { GiftedChat, utils, Bubble, Send } from 'react-native-gifted-chat'; import AsyncStorage from '@react-native-async-storage/async-storage'; +import FontAwesome5 from 'react-native-vector-icons/FontAwesome5'; const { isSameUser, isSameDay } = utils @@ -215,6 +216,22 @@ class MessagesScreen extends React.Component { } } + renderSend(props) { + return ( + <Send + {...props} + containerStyle={{ + height: 45, + width: 45, + justifyContent: 'center', + alignItems: 'center', + }} + > + <FontAwesome5 name={'paper-plane'} solid color={'dodgerblue'} size={25} /> + </Send> + ); + } + render() { if (this.state.isLoading) return ( @@ -232,6 +249,8 @@ class MessagesScreen extends React.Component { _id: this.state.user.id, }} locale={'fr'} + placeholder="Écrivez un message..." + renderSend={this.renderSend} /> ) } -- GitLab