-
-
Notifications
You must be signed in to change notification settings - Fork 154
Expand file tree
/
Copy pathMessage.tsx
More file actions
39 lines (35 loc) · 924 Bytes
/
Message.tsx
File metadata and controls
39 lines (35 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React from "react";
import { StyleSheet, Text, View } from "react-native";
import type { MessageProps } from "../../../../components/Message/types";
/**
* Fork of original Message component. Created in order not to break existing e2e tests (requires assets re-generation).
*/
export default function Message({ text, sender }: MessageProps) {
return (
<View style={sender ? styles.senderContainer : styles.recipientContainer}>
<Text style={styles.message}>{text}</Text>
</View>
);
}
const container = {
borderRadius: 10,
padding: 10,
margin: 10,
marginVertical: 5,
maxWidth: "80%" as const,
};
const styles = StyleSheet.create({
senderContainer: {
alignSelf: "flex-end",
backgroundColor: "#F8F8FC",
...container,
},
recipientContainer: {
alignSelf: "flex-start",
backgroundColor: "#64D2FF",
...container,
},
message: {
color: "#000000",
},
});