-
Notifications
You must be signed in to change notification settings - Fork 0
/
Invite.tsx
93 lines (88 loc) · 2.47 KB
/
Invite.tsx
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import * as React from "react";
import { Image, StyleSheet, Text, TouchableOpacity, View } from "react-native";
import theme from "../../config/theme.config.json";
import config from "../../Images.config";
import * as Clipboard from "expo-clipboard";
import { showMessage } from "react-native-flash-message";
import { Chat } from "../interfaces/Chat.interface";
interface IInviteProps {
chat: Chat,
onClose: () => void
}
export default function Invite({chat, onClose}: IInviteProps) {
const copyString = async (string: string) => {
await Clipboard.setStringAsync(string).then(() => {
showMessage({
message: "Successfully copied!",
});
});
};
return (
<View style={styles.container}>
<View style={[styles.flexRow, { padding: 16 }]}>
<Text
style={{ fontSize: 24, fontWeight: "bold", color: "white" }}
>{`Invite users to ${[chat.name]}`}</Text>
<TouchableOpacity style={{ padding: 8 }} onPress={onClose}>
<Image
style={{ width: 15, height: 15 }}
source={config["close"]}
></Image>
</TouchableOpacity>
</View>
<View style={{ padding: 16, gap: 8, marginBottom: 24 }}>
<Text
style={{ fontSize: 16, fontWeight: "bold", color: theme.heading }}
>
Send your chat ID to your friend
</Text>
<View
style={[
{
padding: 4,
backgroundColor: theme.background2,
},
styles.flexRow,
]}
>
<Text style={{ padding: 12, fontSize: 18, color: "black" }}>
{chat.id}
</Text>
<TouchableOpacity
style={{
backgroundColor: theme.button,
paddingVertical: 16,
paddingHorizontal: 24,
borderRadius: 8,
}}
onPress={() => {
copyString(chat.id);
}}
>
<Text style={{ fontWeight: "bold" }}>Copy</Text>
</TouchableOpacity>
</View>
</View>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: theme.background,
position: "absolute",
width: "100%",
bottom: 0,
},
flexRow: {
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
},
// image: {
// resizeMode: "contain",
// borderRadius: 50,
// flex: 1,
// aspectRatio: 1,
// },
});