be-components 5.1.8 → 5.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/Components/Icons.js +28 -1
- package/lib/commonjs/Components/Icons.js.map +1 -1
- package/lib/commonjs/Components/Themed.js +13 -1
- package/lib/commonjs/Components/Themed.js.map +1 -1
- package/lib/commonjs/SocialComponents/FormattedTextInput/components/TagSelector.js +47 -24
- package/lib/commonjs/SocialComponents/FormattedTextInput/components/TagSelector.js.map +1 -1
- package/lib/commonjs/SocialComponents/FormattedTextInput/index.js +41 -8
- package/lib/commonjs/SocialComponents/FormattedTextInput/index.js.map +1 -1
- package/lib/commonjs/SocialComponents/GifSelector/NativeSelector.js +14 -0
- package/lib/commonjs/SocialComponents/GifSelector/NativeSelector.js.map +1 -0
- package/lib/commonjs/SocialComponents/GifSelector/WebSelector.js +123 -0
- package/lib/commonjs/SocialComponents/GifSelector/WebSelector.js.map +1 -0
- package/lib/commonjs/SocialComponents/GroupChat/components/GroupMessageCard.js +89 -0
- package/lib/commonjs/SocialComponents/GroupChat/components/GroupMessageCard.js.map +1 -0
- package/lib/commonjs/SocialComponents/GroupChat/index.js +426 -0
- package/lib/commonjs/SocialComponents/GroupChat/index.js.map +1 -0
- package/lib/commonjs/SocialComponents/ImageRenderer.js +55 -0
- package/lib/commonjs/SocialComponents/ImageRenderer.js.map +1 -0
- package/lib/commonjs/SocialComponents/InputBar/components/ActionSelector.js +219 -0
- package/lib/commonjs/SocialComponents/InputBar/components/ActionSelector.js.map +1 -0
- package/lib/commonjs/SocialComponents/InputBar/index.js +59 -5
- package/lib/commonjs/SocialComponents/InputBar/index.js.map +1 -1
- package/lib/commonjs/SocialComponents/PostCard/components/ArticleCard.js +2 -0
- package/lib/commonjs/SocialComponents/PostCard/components/ArticleCard.js.map +1 -0
- package/lib/commonjs/SocialComponents/PostCard/components/ImageList.js +37 -25
- package/lib/commonjs/SocialComponents/PostCard/components/ImageList.js.map +1 -1
- package/lib/commonjs/SocialComponents/PostCard/index.js +148 -70
- package/lib/commonjs/SocialComponents/PostCard/index.js.map +1 -1
- package/lib/commonjs/SocialComponents/Poster/index.js +325 -0
- package/lib/commonjs/SocialComponents/Poster/index.js.map +1 -0
- package/lib/commonjs/SocialComponents/SocialOrderCard.js +8 -3
- package/lib/commonjs/SocialComponents/SocialOrderCard.js.map +1 -1
- package/lib/commonjs/SocialComponents/SocialOrdersList.js +20 -2
- package/lib/commonjs/SocialComponents/SocialOrdersList.js.map +1 -1
- package/lib/commonjs/SocialComponents/UrlPreviewCard.js +115 -0
- package/lib/commonjs/SocialComponents/UrlPreviewCard.js.map +1 -0
- package/lib/commonjs/SocialComponents/api/index.js +383 -0
- package/lib/commonjs/SocialComponents/api/index.js.map +1 -1
- package/lib/commonjs/SocialComponents/index.js +14 -0
- package/lib/commonjs/SocialComponents/index.js.map +1 -1
- package/lib/module/Components/Icons.js +28 -1
- package/lib/module/Components/Icons.js.map +1 -1
- package/lib/module/Components/Themed.js +13 -1
- package/lib/module/Components/Themed.js.map +1 -1
- package/lib/module/SocialComponents/FormattedTextInput/components/TagSelector.js +48 -25
- package/lib/module/SocialComponents/FormattedTextInput/components/TagSelector.js.map +1 -1
- package/lib/module/SocialComponents/FormattedTextInput/index.js +41 -8
- package/lib/module/SocialComponents/FormattedTextInput/index.js.map +1 -1
- package/lib/module/SocialComponents/GifSelector/NativeSelector.js +7 -0
- package/lib/module/SocialComponents/GifSelector/NativeSelector.js.map +1 -0
- package/lib/module/SocialComponents/GifSelector/WebSelector.js +125 -0
- package/lib/module/SocialComponents/GifSelector/WebSelector.js.map +1 -0
- package/lib/module/SocialComponents/GroupChat/components/GroupMessageCard.js +82 -0
- package/lib/module/SocialComponents/GroupChat/components/GroupMessageCard.js.map +1 -0
- package/lib/module/SocialComponents/GroupChat/index.js +418 -0
- package/lib/module/SocialComponents/GroupChat/index.js.map +1 -0
- package/lib/module/SocialComponents/ImageRenderer.js +48 -0
- package/lib/module/SocialComponents/ImageRenderer.js.map +1 -0
- package/lib/module/SocialComponents/InputBar/components/ActionSelector.js +210 -0
- package/lib/module/SocialComponents/InputBar/components/ActionSelector.js.map +1 -0
- package/lib/module/SocialComponents/InputBar/index.js +58 -6
- package/lib/module/SocialComponents/InputBar/index.js.map +1 -1
- package/lib/module/SocialComponents/PostCard/components/ArticleCard.js +2 -0
- package/lib/module/SocialComponents/PostCard/components/ArticleCard.js.map +1 -0
- package/lib/module/SocialComponents/PostCard/components/ImageList.js +37 -25
- package/lib/module/SocialComponents/PostCard/components/ImageList.js.map +1 -1
- package/lib/module/SocialComponents/PostCard/index.js +148 -70
- package/lib/module/SocialComponents/PostCard/index.js.map +1 -1
- package/lib/module/SocialComponents/Poster/index.js +316 -0
- package/lib/module/SocialComponents/Poster/index.js.map +1 -0
- package/lib/module/SocialComponents/SocialOrderCard.js +8 -3
- package/lib/module/SocialComponents/SocialOrderCard.js.map +1 -1
- package/lib/module/SocialComponents/SocialOrdersList.js +21 -3
- package/lib/module/SocialComponents/SocialOrdersList.js.map +1 -1
- package/lib/module/SocialComponents/UrlPreviewCard.js +106 -0
- package/lib/module/SocialComponents/UrlPreviewCard.js.map +1 -0
- package/lib/module/SocialComponents/api/index.js +383 -0
- package/lib/module/SocialComponents/api/index.js.map +1 -1
- package/lib/module/SocialComponents/index.js +3 -1
- package/lib/module/SocialComponents/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/Components/Icons.d.ts +5 -0
- package/lib/typescript/lib/commonjs/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/Themed.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/FormattedTextInput/components/TagSelector.d.ts +2 -1
- package/lib/typescript/lib/commonjs/SocialComponents/FormattedTextInput/components/TagSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/FormattedTextInput/index.d.ts +6 -1
- package/lib/typescript/lib/commonjs/SocialComponents/FormattedTextInput/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/GifSelector/NativeSelector.d.ts +4 -0
- package/lib/typescript/lib/commonjs/SocialComponents/GifSelector/NativeSelector.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/SocialComponents/GifSelector/WebSelector.d.ts +4 -0
- package/lib/typescript/lib/commonjs/SocialComponents/GifSelector/WebSelector.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/SocialComponents/GroupChat/components/GroupMessageCard.d.ts +11 -0
- package/lib/typescript/lib/commonjs/SocialComponents/GroupChat/components/GroupMessageCard.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/SocialComponents/GroupChat/index.d.ts +14 -0
- package/lib/typescript/lib/commonjs/SocialComponents/GroupChat/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/SocialComponents/ImageRenderer.d.ts +11 -0
- package/lib/typescript/lib/commonjs/SocialComponents/ImageRenderer.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/SocialComponents/InputBar/components/ActionSelector.d.ts +9 -0
- package/lib/typescript/lib/commonjs/SocialComponents/InputBar/components/ActionSelector.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/SocialComponents/InputBar/index.d.ts +3 -1
- package/lib/typescript/lib/commonjs/SocialComponents/InputBar/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/PostCard/components/ArticleCard.d.ts +1 -0
- package/lib/typescript/lib/commonjs/SocialComponents/PostCard/components/ArticleCard.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/SocialComponents/PostCard/components/ImageList.d.ts +1 -2
- package/lib/typescript/lib/commonjs/SocialComponents/PostCard/components/ImageList.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/PostCard/index.d.ts +4 -1
- package/lib/typescript/lib/commonjs/SocialComponents/PostCard/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/Poster/index.d.ts +9 -0
- package/lib/typescript/lib/commonjs/SocialComponents/Poster/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/SocialComponents/SocialOrderCard.d.ts +2 -1
- package/lib/typescript/lib/commonjs/SocialComponents/SocialOrderCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/SocialOrdersList.d.ts +2 -1
- package/lib/typescript/lib/commonjs/SocialComponents/SocialOrdersList.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/UrlPreviewCard.d.ts +9 -0
- package/lib/typescript/lib/commonjs/SocialComponents/UrlPreviewCard.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/SocialComponents/api/index.d.ts +89 -0
- package/lib/typescript/lib/commonjs/SocialComponents/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/index.d.ts +2 -0
- package/lib/typescript/lib/module/Components/Icons.d.ts +5 -0
- package/lib/typescript/lib/module/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/Themed.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/FormattedTextInput/components/TagSelector.d.ts +3 -2
- package/lib/typescript/lib/module/SocialComponents/FormattedTextInput/components/TagSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/FormattedTextInput/index.d.ts +6 -1
- package/lib/typescript/lib/module/SocialComponents/FormattedTextInput/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/GifSelector/NativeSelector.d.ts +4 -0
- package/lib/typescript/lib/module/SocialComponents/GifSelector/NativeSelector.d.ts.map +1 -0
- package/lib/typescript/lib/module/SocialComponents/GifSelector/WebSelector.d.ts +13 -0
- package/lib/typescript/lib/module/SocialComponents/GifSelector/WebSelector.d.ts.map +1 -0
- package/lib/typescript/lib/module/SocialComponents/GroupChat/components/GroupMessageCard.d.ts +11 -0
- package/lib/typescript/lib/module/SocialComponents/GroupChat/components/GroupMessageCard.d.ts.map +1 -0
- package/lib/typescript/lib/module/SocialComponents/GroupChat/index.d.ts +14 -0
- package/lib/typescript/lib/module/SocialComponents/GroupChat/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/SocialComponents/ImageRenderer.d.ts +11 -0
- package/lib/typescript/lib/module/SocialComponents/ImageRenderer.d.ts.map +1 -0
- package/lib/typescript/lib/module/SocialComponents/InputBar/components/ActionSelector.d.ts +10 -0
- package/lib/typescript/lib/module/SocialComponents/InputBar/components/ActionSelector.d.ts.map +1 -0
- package/lib/typescript/lib/module/SocialComponents/InputBar/index.d.ts +3 -1
- package/lib/typescript/lib/module/SocialComponents/InputBar/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/PostCard/components/ArticleCard.d.ts +1 -0
- package/lib/typescript/lib/module/SocialComponents/PostCard/components/ArticleCard.d.ts.map +1 -0
- package/lib/typescript/lib/module/SocialComponents/PostCard/components/ImageList.d.ts +1 -2
- package/lib/typescript/lib/module/SocialComponents/PostCard/components/ImageList.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/PostCard/index.d.ts +4 -1
- package/lib/typescript/lib/module/SocialComponents/PostCard/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/Poster/index.d.ts +11 -0
- package/lib/typescript/lib/module/SocialComponents/Poster/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/SocialComponents/SocialOrderCard.d.ts +3 -2
- package/lib/typescript/lib/module/SocialComponents/SocialOrderCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/SocialOrdersList.d.ts +2 -1
- package/lib/typescript/lib/module/SocialComponents/SocialOrdersList.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/UrlPreviewCard.d.ts +9 -0
- package/lib/typescript/lib/module/SocialComponents/UrlPreviewCard.d.ts.map +1 -0
- package/lib/typescript/lib/module/SocialComponents/api/index.d.ts +89 -0
- package/lib/typescript/lib/module/SocialComponents/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/index.d.ts +3 -1
- package/lib/typescript/lib/module/SocialComponents/index.d.ts.map +1 -1
- package/lib/typescript/src/Components/Icons.d.ts +1 -0
- package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/src/Components/Themed.d.ts +1 -0
- package/lib/typescript/src/Components/Themed.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/FormattedTextInput/components/TagSelector.d.ts +2 -1
- package/lib/typescript/src/SocialComponents/FormattedTextInput/components/TagSelector.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/FormattedTextInput/index.d.ts +6 -1
- package/lib/typescript/src/SocialComponents/FormattedTextInput/index.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/GifSelector/NativeSelector.d.ts +4 -0
- package/lib/typescript/src/SocialComponents/GifSelector/NativeSelector.d.ts.map +1 -0
- package/lib/typescript/src/SocialComponents/GifSelector/WebSelector.d.ts +11 -0
- package/lib/typescript/src/SocialComponents/GifSelector/WebSelector.d.ts.map +1 -0
- package/lib/typescript/src/SocialComponents/GroupChat/components/GroupMessageCard.d.ts +18 -0
- package/lib/typescript/src/SocialComponents/GroupChat/components/GroupMessageCard.d.ts.map +1 -0
- package/lib/typescript/src/SocialComponents/GroupChat/index.d.ts +25 -0
- package/lib/typescript/src/SocialComponents/GroupChat/index.d.ts.map +1 -0
- package/lib/typescript/src/SocialComponents/ImageRenderer.d.ts +21 -0
- package/lib/typescript/src/SocialComponents/ImageRenderer.d.ts.map +1 -0
- package/lib/typescript/src/SocialComponents/InputBar/components/ActionSelector.d.ts +16 -0
- package/lib/typescript/src/SocialComponents/InputBar/components/ActionSelector.d.ts.map +1 -0
- package/lib/typescript/src/SocialComponents/InputBar/index.d.ts +10 -1
- package/lib/typescript/src/SocialComponents/InputBar/index.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/PostCard/components/ArticleCard.d.ts +1 -0
- package/lib/typescript/src/SocialComponents/PostCard/components/ArticleCard.d.ts.map +1 -0
- package/lib/typescript/src/SocialComponents/PostCard/components/ImageList.d.ts +1 -1
- package/lib/typescript/src/SocialComponents/PostCard/components/ImageList.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/PostCard/index.d.ts +4 -2
- package/lib/typescript/src/SocialComponents/PostCard/index.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/Poster/index.d.ts +16 -0
- package/lib/typescript/src/SocialComponents/Poster/index.d.ts.map +1 -0
- package/lib/typescript/src/SocialComponents/SocialOrderCard.d.ts +2 -1
- package/lib/typescript/src/SocialComponents/SocialOrderCard.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/SocialOrdersList.d.ts +2 -1
- package/lib/typescript/src/SocialComponents/SocialOrdersList.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/UrlPreviewCard.d.ts +10 -0
- package/lib/typescript/src/SocialComponents/UrlPreviewCard.d.ts.map +1 -0
- package/lib/typescript/src/SocialComponents/api/index.d.ts +37 -1
- package/lib/typescript/src/SocialComponents/api/index.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/index.d.ts +3 -1
- package/lib/typescript/src/SocialComponents/index.d.ts.map +1 -1
- package/package.json +5 -1
- package/src/Components/Icons.tsx +18 -1
- package/src/Components/Themed.tsx +11 -1
- package/src/SocialComponents/FormattedTextInput/components/TagSelector.tsx +24 -17
- package/src/SocialComponents/FormattedTextInput/index.tsx +32 -7
- package/src/SocialComponents/GifSelector/NativeSelector.tsx +13 -0
- package/src/SocialComponents/GifSelector/WebSelector.tsx +91 -0
- package/src/SocialComponents/GroupChat/components/GroupMessageCard.tsx +84 -0
- package/src/SocialComponents/GroupChat/index.tsx +333 -0
- package/src/SocialComponents/ImageRenderer.tsx +42 -0
- package/src/SocialComponents/InputBar/components/ActionSelector.tsx +164 -0
- package/src/SocialComponents/InputBar/index.tsx +40 -6
- package/src/SocialComponents/PostCard/components/ArticleCard.tsx +2 -0
- package/src/SocialComponents/PostCard/components/ImageList.tsx +28 -21
- package/src/SocialComponents/PostCard/index.tsx +122 -56
- package/src/SocialComponents/Poster/index.tsx +264 -0
- package/src/SocialComponents/SocialOrderCard.tsx +4 -6
- package/src/SocialComponents/SocialOrdersList.tsx +14 -8
- package/src/SocialComponents/UrlPreviewCard.tsx +75 -0
- package/src/SocialComponents/api/index.ts +345 -3
- package/src/SocialComponents/index.tsx +4 -0
- package/src/types.d.ts +58 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { Button, Text, View } from "../../../Components/Themed";
|
|
3
3
|
import { SocialComponentApi } from '../../api';
|
|
4
|
-
import {
|
|
4
|
+
import { Image } from 'react-native';
|
|
5
|
+
const MIN_TAG_WIDTH = 140;
|
|
5
6
|
const TagSelector = ({
|
|
7
|
+
width,
|
|
6
8
|
type,
|
|
7
9
|
visible,
|
|
8
10
|
working_tag,
|
|
@@ -14,6 +16,14 @@ const TagSelector = ({
|
|
|
14
16
|
players: [],
|
|
15
17
|
offset: 0
|
|
16
18
|
});
|
|
19
|
+
const getTagWidth = padding => {
|
|
20
|
+
//How many can fit in the screen
|
|
21
|
+
let num_possible = Math.floor(width / MIN_TAG_WIDTH);
|
|
22
|
+
// then simply divide the width with it!
|
|
23
|
+
let width_per_tag = width / num_possible - padding * 2 * num_possible;
|
|
24
|
+
return width_per_tag;
|
|
25
|
+
};
|
|
26
|
+
const tag_width = getTagWidth(3);
|
|
17
27
|
useEffect(() => {
|
|
18
28
|
if (!visible) {
|
|
19
29
|
return;
|
|
@@ -56,11 +66,15 @@ const TagSelector = ({
|
|
|
56
66
|
};
|
|
57
67
|
const renderPlayers = data => {
|
|
58
68
|
return /*#__PURE__*/React.createElement(Button, {
|
|
69
|
+
key: data.item.player_id.toString(),
|
|
59
70
|
float: true,
|
|
60
71
|
style: {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
72
|
+
flexDirection: 'row',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
margin: 2,
|
|
75
|
+
padding: 3,
|
|
76
|
+
width: tag_width,
|
|
77
|
+
borderRadius: 100
|
|
64
78
|
},
|
|
65
79
|
onPress: () => handleSelectPlayer(data.item)
|
|
66
80
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
@@ -68,33 +82,30 @@ const TagSelector = ({
|
|
|
68
82
|
uri: data.item.profile_pic
|
|
69
83
|
},
|
|
70
84
|
style: {
|
|
71
|
-
height:
|
|
72
|
-
width:
|
|
73
|
-
|
|
74
|
-
borderTopLeftRadius: 8
|
|
85
|
+
height: 25,
|
|
86
|
+
width: 25,
|
|
87
|
+
borderRadius: 100
|
|
75
88
|
},
|
|
76
89
|
resizeMode: "cover"
|
|
77
90
|
}), /*#__PURE__*/React.createElement(View, {
|
|
78
91
|
transparent: true,
|
|
79
92
|
style: {
|
|
80
|
-
|
|
93
|
+
flex: 1,
|
|
94
|
+
marginLeft: 5
|
|
81
95
|
}
|
|
82
96
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
83
|
-
|
|
97
|
+
style: {
|
|
98
|
+
maxWidth: tag_width - 30
|
|
99
|
+
},
|
|
100
|
+
theme: "description",
|
|
101
|
+
size: 10,
|
|
84
102
|
textAlign: "center"
|
|
85
103
|
}, "@", data.item.username)));
|
|
86
104
|
};
|
|
87
105
|
if (!visible) {
|
|
88
106
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
89
107
|
}
|
|
90
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
91
|
-
style: {
|
|
92
|
-
position: 'absolute',
|
|
93
|
-
bottom: 5,
|
|
94
|
-
left: 0,
|
|
95
|
-
right: 0
|
|
96
|
-
}
|
|
97
|
-
}, type == 'player' ? /*#__PURE__*/React.createElement(View, {
|
|
108
|
+
return /*#__PURE__*/React.createElement(View, null, type == 'player' ? /*#__PURE__*/React.createElement(View, {
|
|
98
109
|
float: true
|
|
99
110
|
}, /*#__PURE__*/React.createElement(View, {
|
|
100
111
|
type: "header",
|
|
@@ -112,18 +123,30 @@ const TagSelector = ({
|
|
|
112
123
|
theme: "h2"
|
|
113
124
|
}, "Tag A Player!")), /*#__PURE__*/React.createElement(Button, {
|
|
114
125
|
title: "X",
|
|
126
|
+
type: "close",
|
|
127
|
+
style: {
|
|
128
|
+
padding: 0,
|
|
129
|
+
borderRadius: 100,
|
|
130
|
+
height: 25,
|
|
131
|
+
width: 25,
|
|
132
|
+
justifyContent: 'center',
|
|
133
|
+
alignItems: 'center'
|
|
134
|
+
},
|
|
115
135
|
float: true,
|
|
116
136
|
onPress: () => onCancel()
|
|
117
137
|
})), /*#__PURE__*/React.createElement(View, {
|
|
118
138
|
style: {
|
|
119
|
-
padding: 5
|
|
139
|
+
padding: 5,
|
|
140
|
+
flexDirection: 'row',
|
|
141
|
+
alignItems: 'center',
|
|
142
|
+
justifyContent: 'center',
|
|
143
|
+
flexWrap: 'wrap'
|
|
120
144
|
}
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
renderItem: renderPlayers
|
|
145
|
+
}, player_tag.players.map((item, index) => {
|
|
146
|
+
return renderPlayers({
|
|
147
|
+
item,
|
|
148
|
+
index
|
|
149
|
+
});
|
|
127
150
|
}))) : /*#__PURE__*/React.createElement(React.Fragment, null));
|
|
128
151
|
};
|
|
129
152
|
export default TagSelector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useState","Button","Text","View","SocialComponentApi","
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","Button","Text","View","SocialComponentApi","Image","MIN_TAG_WIDTH","TagSelector","width","type","visible","working_tag","onSelectTag","onCancel","player_tag","setPlayerTag","loading","players","offset","getTagWidth","padding","num_possible","Math","floor","width_per_tag","tag_width","startUpSelector","searchPlayers","tag","page","plys","searchPlayersByValue","handleSelectPlayer","player","username","data","tag_type_id","player_id","valid","renderPlayers","createElement","key","item","toString","float","style","flexDirection","alignItems","margin","borderRadius","onPress","source","uri","profile_pic","height","resizeMode","transparent","flex","marginLeft","maxWidth","theme","size","textAlign","Fragment","title","justifyContent","flexWrap","map","index"],"sourceRoot":"../../../../../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CAAC;MAAE6B,YAAY,EAAC,GAAG;MAAEK,MAAM,EAAC,EAAE;MAAE9C,KAAK,EAAC,EAAE;MAAEyD,cAAc,EAAC,QAAQ;MAAElB,UAAU,EAAC;IAAS,CAAE;IAC1GH,KAAK;IACLM,OAAO,EAAEA,CAAA,KAAMrC,QAAQ,CAAC;EAAE,CAC7B,CACC,CAAC,eACPf,KAAA,CAAA0C,aAAA,CAACrC,IAAI;IAAC0C,KAAK,EAAE;MAAEzB,OAAO,EAAC,CAAC;MAAE0B,aAAa,EAAC,KAAK;MAAEC,UAAU,EAAC,QAAQ;MAAEkB,cAAc,EAAC,QAAQ;MAAEC,QAAQ,EAAC;IAAO;EAAE,GAC1GpD,UAAU,CAACG,OAAO,CAACkD,GAAG,CAAC,CAACzB,IAAI,EAAE0B,KAAK,KAAK;IACrC,OAAO7B,aAAa,CAAC;MAAEG,IAAI;MAAE0B;IAAM,CAAC,CAAC;EACzC,CAAC,CACC,CACJ,CAAC,gBACNtE,KAAA,CAAA0C,aAAA,CAAA1C,KAAA,CAAAiE,QAAA,MAAI,CACH,CAAC;AAEf,CAAC;AAED,eAAexD,WAAW","ignoreList":[]}
|
|
@@ -6,9 +6,14 @@ import TagSelector from './components/TagSelector';
|
|
|
6
6
|
import { Icons } from '../../Components';
|
|
7
7
|
import { useColors } from '../../constants/useColors';
|
|
8
8
|
const FormattedTextInput = ({
|
|
9
|
+
width,
|
|
10
|
+
disable_scroll,
|
|
9
11
|
submit_title,
|
|
12
|
+
hide_border,
|
|
13
|
+
tag_selector_location,
|
|
10
14
|
icon_submit,
|
|
11
15
|
keep_on_submit,
|
|
16
|
+
submit_caller,
|
|
12
17
|
submit_placement,
|
|
13
18
|
placeholder,
|
|
14
19
|
init_data,
|
|
@@ -45,6 +50,12 @@ const FormattedTextInput = ({
|
|
|
45
50
|
const active_tag = tags.find(t => t.active);
|
|
46
51
|
const [action_loading, setActionLoading] = useState(false);
|
|
47
52
|
const [working_tag, setWorkingTag] = useState();
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (!submit_caller) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
handleSubmit();
|
|
58
|
+
}, [submit_caller]);
|
|
48
59
|
useEffect(() => {
|
|
49
60
|
SocialComponentApi.setEnvironment();
|
|
50
61
|
if (init_data) {
|
|
@@ -54,7 +65,7 @@ const FormattedTextInput = ({
|
|
|
54
65
|
});
|
|
55
66
|
setValidTags(init_data.tags);
|
|
56
67
|
}
|
|
57
|
-
}, [init_data]);
|
|
68
|
+
}, [JSON.stringify(init_data)]);
|
|
58
69
|
useEffect(() => {
|
|
59
70
|
if (active_tag) {
|
|
60
71
|
return setWorkingTag(active_tag);
|
|
@@ -67,7 +78,9 @@ const FormattedTextInput = ({
|
|
|
67
78
|
}
|
|
68
79
|
}, [active_tag]);
|
|
69
80
|
const validateTag = async tag => {
|
|
70
|
-
let new_tags = valid_tags.
|
|
81
|
+
let new_tags = valid_tags.concat({
|
|
82
|
+
...tag
|
|
83
|
+
});
|
|
71
84
|
setValidTags(new_tags);
|
|
72
85
|
};
|
|
73
86
|
const searchPlayer = async tag => {
|
|
@@ -102,9 +115,7 @@ const FormattedTextInput = ({
|
|
|
102
115
|
const handleUpdateTag = async tag => {
|
|
103
116
|
setActionLoading(true);
|
|
104
117
|
const new_text = SocialComponentHelpers.replaceText(text, tag.start, tag.end, `@${tag.tag}`);
|
|
105
|
-
|
|
106
|
-
...tag
|
|
107
|
-
}));
|
|
118
|
+
validateTag(tag);
|
|
108
119
|
setData({
|
|
109
120
|
...data,
|
|
110
121
|
text: new_text
|
|
@@ -131,6 +142,10 @@ const FormattedTextInput = ({
|
|
|
131
142
|
text: '',
|
|
132
143
|
formatted_text: JSON.stringify('')
|
|
133
144
|
});
|
|
145
|
+
setInputState({
|
|
146
|
+
...input_state,
|
|
147
|
+
height: 50
|
|
148
|
+
});
|
|
134
149
|
setValidTags([]);
|
|
135
150
|
};
|
|
136
151
|
const handleChange = ev => {
|
|
@@ -151,9 +166,10 @@ const FormattedTextInput = ({
|
|
|
151
166
|
transparent: true
|
|
152
167
|
}, /*#__PURE__*/React.createElement(View, {
|
|
153
168
|
transparent: true
|
|
154
|
-
}, tag_selector.visible && tag_selector.working_tag ? /*#__PURE__*/React.createElement(TagSelector, {
|
|
169
|
+
}, tag_selector.visible && tag_selector.working_tag && tag_selector_location != 'bottom' ? /*#__PURE__*/React.createElement(TagSelector, {
|
|
155
170
|
working_tag: tag_selector.working_tag,
|
|
156
171
|
type: tag_selector.type,
|
|
172
|
+
width: width,
|
|
157
173
|
visible: tag_selector.visible,
|
|
158
174
|
onCancel: () => setTagSelector({
|
|
159
175
|
visible: false,
|
|
@@ -161,6 +177,7 @@ const FormattedTextInput = ({
|
|
|
161
177
|
}),
|
|
162
178
|
onSelectTag: tag => handleUpdateTag(tag)
|
|
163
179
|
}) : /*#__PURE__*/React.createElement(React.Fragment, null)), /*#__PURE__*/React.createElement(View, {
|
|
180
|
+
transparent: true,
|
|
164
181
|
style: {
|
|
165
182
|
flexDirection: 'row',
|
|
166
183
|
alignItems: 'flex-end'
|
|
@@ -180,7 +197,7 @@ const FormattedTextInput = ({
|
|
|
180
197
|
size: 24,
|
|
181
198
|
color: Colors.text.h1
|
|
182
199
|
})) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(View, {
|
|
183
|
-
type:
|
|
200
|
+
type: hide_border ? undefined : 'input',
|
|
184
201
|
style: {
|
|
185
202
|
flex: 1,
|
|
186
203
|
flexDirection: 'row'
|
|
@@ -192,6 +209,7 @@ const FormattedTextInput = ({
|
|
|
192
209
|
loading: action_loading,
|
|
193
210
|
focus_on_unload: true,
|
|
194
211
|
transparent: true,
|
|
212
|
+
scrollEnabled: !disable_scroll,
|
|
195
213
|
placeholder: placeholder ?? 'Start typing here...',
|
|
196
214
|
onFocusPosition: onFocusPosition,
|
|
197
215
|
style: {
|
|
@@ -223,7 +241,22 @@ const FormattedTextInput = ({
|
|
|
223
241
|
}, submit_title ?? 'Submit') : /*#__PURE__*/React.createElement(Icons.SendIcon, {
|
|
224
242
|
size: 18,
|
|
225
243
|
color: Colors.text.white
|
|
226
|
-
})) : /*#__PURE__*/React.createElement(React.Fragment, null)),
|
|
244
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null)), tag_selector.visible && tag_selector.working_tag && tag_selector_location == 'bottom' ? /*#__PURE__*/React.createElement(View, {
|
|
245
|
+
transparent: true,
|
|
246
|
+
style: {
|
|
247
|
+
height: 100
|
|
248
|
+
}
|
|
249
|
+
}, /*#__PURE__*/React.createElement(TagSelector, {
|
|
250
|
+
working_tag: tag_selector.working_tag,
|
|
251
|
+
type: tag_selector.type,
|
|
252
|
+
width: width,
|
|
253
|
+
visible: tag_selector.visible,
|
|
254
|
+
onCancel: () => setTagSelector({
|
|
255
|
+
visible: false,
|
|
256
|
+
type: 'player'
|
|
257
|
+
}),
|
|
258
|
+
onSelectTag: tag => handleUpdateTag(tag)
|
|
259
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null), submit_placement == 'bottom' ? /*#__PURE__*/React.createElement(Button, {
|
|
227
260
|
title: submit_title ?? 'Submit',
|
|
228
261
|
type: "success",
|
|
229
262
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useMemo","useState","Button","Text","TextInput","View","Platform","SocialComponentApi","SocialComponentHelpers","TagSelector","Icons","useColors","FormattedTextInput","submit_title","icon_submit","keep_on_submit","submit_placement","placeholder","init_data","onSelectInput","onChangeText","onSubmit","onFocusPosition","Colors","input_state","setInputState","height","data","setData","text","formatted_text","JSON","stringify","location","setLocation","start","end","tag_selector","setTagSelector","visible","type","valid_tags","setValidTags","tags","extractTagsFromText","active_tag","find","t","active","action_loading","setActionLoading","working_tag","setWorkingTag","setEnvironment","searchPlayer","undefined","validateTag","tag","new_tags","
|
|
1
|
+
{"version":3,"names":["React","useEffect","useMemo","useState","Button","Text","TextInput","View","Platform","SocialComponentApi","SocialComponentHelpers","TagSelector","Icons","useColors","FormattedTextInput","width","disable_scroll","submit_title","hide_border","tag_selector_location","icon_submit","keep_on_submit","submit_caller","submit_placement","placeholder","init_data","onSelectInput","onChangeText","onSubmit","onFocusPosition","Colors","input_state","setInputState","height","data","setData","text","formatted_text","JSON","stringify","location","setLocation","start","end","tag_selector","setTagSelector","visible","type","valid_tags","setValidTags","tags","extractTagsFromText","active_tag","find","t","active","action_loading","setActionLoading","working_tag","setWorkingTag","handleSubmit","setEnvironment","searchPlayer","undefined","validateTag","tag","new_tags","concat","player","searchPlayerByUsername","local_id","Math","random","toFixed","tag_type_id","player_id","handleSelectionChange","ev","nativeEvent","selection","handleUpdateTag","new_text","replaceText","setTimeout","compareTags","handleChange","createElement","transparent","onCancel","onSelectTag","Fragment","style","flexDirection","alignItems","float","padding","marginRight","borderRadius","justifyContent","onPress","MoreIcon","size","color","h1","flex","value","editable","multiline","loading","focus_on_unload","scrollEnabled","OS","onContentSizeChange","e","contentSize","onSelectionChange","onChange","opacity","marginLeft","disabled","theme","white","SendIcon","title","marginTop"],"sourceRoot":"../../../../src","sources":["SocialComponents/FormattedTextInput/index.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC3D,SAASC,MAAM,EAAEC,IAAI,EAAEC,SAAS,EAAEC,IAAI,QAAQ,yBAAyB;AACvE,SAASC,QAAQ,QAA2E,cAAc;AAE1G,SAASC,kBAAkB,EAAEC,sBAAsB,QAAQ,QAAQ;AACnE,OAAOC,WAAW,MAAM,0BAA0B;AAClD,SAASC,KAAK,QAAQ,kBAAkB;AACxC,SAASC,SAAS,QAAQ,2BAA2B;AAqBrD,MAAMC,kBAAkB,GAAGA,CAAC;EAAEC,KAAK;EAAEC,cAAc;EAAEC,YAAY;EAAEC,WAAW;EAAEC,qBAAqB;EAAEC,WAAW;EAAEC,cAAc;EAAEC,aAAa;EAAEC,gBAAgB;EAAEC,WAAW;EAAEC,S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|
3
|
+
const GifyNativeSelector = () => {
|
|
4
|
+
return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Text, null, "Hey"));
|
|
5
|
+
};
|
|
6
|
+
export default GifyNativeSelector;
|
|
7
|
+
//# sourceMappingURL=NativeSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Text","View","GifyNativeSelector","createElement"],"sourceRoot":"../../../../src","sources":["SocialComponents/GifSelector/NativeSelector.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,yBAAyB;AAEpD,MAAMC,kBAAkB,GAAGA,CAAA,KAAM;EAC7B,oBACIH,KAAA,CAAAI,aAAA,CAACF,IAAI,qBACDF,KAAA,CAAAI,aAAA,CAACH,IAAI,QAAC,KAAS,CACb,CAAC;AAEf,CAAC;AAED,eAAeE,kBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
2
|
+
import { GiphyFetch } from '@giphy/js-fetch-api';
|
|
3
|
+
import { Grid,
|
|
4
|
+
// our UI Component to display the results
|
|
5
|
+
SearchBar,
|
|
6
|
+
// the search bar the user will type into
|
|
7
|
+
SearchContext,
|
|
8
|
+
// the context that wraps and connects our components
|
|
9
|
+
SearchContextManager,
|
|
10
|
+
// the context manager, includes the Context.Provider
|
|
11
|
+
SuggestionBar // an optional UI component that displays trending searches and channel / username results
|
|
12
|
+
} from '@giphy/react-components';
|
|
13
|
+
const gf = new GiphyFetch('MPKLmL5j0G3TesyhtNeDTE0nZ3F8CKCB');
|
|
14
|
+
import { Button, View } from '../../Components/Themed';
|
|
15
|
+
import { Modal, Platform, ScrollView } from 'react-native';
|
|
16
|
+
|
|
17
|
+
// the search experience consists of the manager and its child components that use SearchContext
|
|
18
|
+
|
|
19
|
+
const WebGifySelector = ({
|
|
20
|
+
isVisible,
|
|
21
|
+
gifSelect,
|
|
22
|
+
closeModal,
|
|
23
|
+
view_mode,
|
|
24
|
+
width
|
|
25
|
+
}) => {
|
|
26
|
+
if (!isVisible) {
|
|
27
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
28
|
+
}
|
|
29
|
+
if (Platform.OS != 'web') {
|
|
30
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
31
|
+
}
|
|
32
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
33
|
+
transparent: true,
|
|
34
|
+
style: {
|
|
35
|
+
flex: 1
|
|
36
|
+
},
|
|
37
|
+
animationType: view_mode == 'desktop' ? 'fade' : 'slide'
|
|
38
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
39
|
+
type: "blur",
|
|
40
|
+
style: {
|
|
41
|
+
flex: 1,
|
|
42
|
+
padding: 10
|
|
43
|
+
}
|
|
44
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
45
|
+
float: true,
|
|
46
|
+
style: {
|
|
47
|
+
flex: 1,
|
|
48
|
+
padding: 10
|
|
49
|
+
}
|
|
50
|
+
}, /*#__PURE__*/React.createElement(ScrollView, {
|
|
51
|
+
style: {
|
|
52
|
+
flex: 1,
|
|
53
|
+
paddingTop: 10,
|
|
54
|
+
borderTopRightRadius: 2,
|
|
55
|
+
borderTopLeftRadius: 2
|
|
56
|
+
}
|
|
57
|
+
}, /*#__PURE__*/React.createElement(SearchContextManager, {
|
|
58
|
+
apiKey: 'MPKLmL5j0G3TesyhtNeDTE0nZ3F8CKCB'
|
|
59
|
+
}, /*#__PURE__*/React.createElement(Components, {
|
|
60
|
+
width: width - 20,
|
|
61
|
+
gifSelect: gifSelect
|
|
62
|
+
}))), /*#__PURE__*/React.createElement(View, {
|
|
63
|
+
type: "footer",
|
|
64
|
+
style: {
|
|
65
|
+
flexDirection: 'row',
|
|
66
|
+
padding: 10
|
|
67
|
+
}
|
|
68
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
69
|
+
type: "close",
|
|
70
|
+
title: "CLOSE",
|
|
71
|
+
style: {
|
|
72
|
+
flex: 1
|
|
73
|
+
},
|
|
74
|
+
onPress: () => closeModal()
|
|
75
|
+
})))));
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// define the components in a separate function so we can
|
|
79
|
+
// use the context hook. You could also use the render props pattern
|
|
80
|
+
const Components = ({
|
|
81
|
+
gifSelect,
|
|
82
|
+
width
|
|
83
|
+
}) => {
|
|
84
|
+
const {
|
|
85
|
+
fetchGifs,
|
|
86
|
+
searchKey
|
|
87
|
+
} = useContext(SearchContext);
|
|
88
|
+
const [initGifs, setInitGifs] = useState();
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
getInitGifs();
|
|
91
|
+
}, []);
|
|
92
|
+
const getInitGifs = async () => {
|
|
93
|
+
const fetchedGifs = await gf.trending({
|
|
94
|
+
offset: 0,
|
|
95
|
+
limit: 10
|
|
96
|
+
});
|
|
97
|
+
setInitGifs(fetchedGifs.data);
|
|
98
|
+
};
|
|
99
|
+
if (!initGifs) {
|
|
100
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
101
|
+
}
|
|
102
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SearchBar, null), /*#__PURE__*/React.createElement(View, {
|
|
103
|
+
style: {
|
|
104
|
+
paddingTop: 10,
|
|
105
|
+
paddingLeft: 2
|
|
106
|
+
}
|
|
107
|
+
}, /*#__PURE__*/React.createElement(SuggestionBar, null), /*#__PURE__*/React.createElement(Grid, {
|
|
108
|
+
noLink: true,
|
|
109
|
+
onGifClick: gif => gifSelect(gif),
|
|
110
|
+
initialGifs: searchKey === '' ? initGifs : [],
|
|
111
|
+
key: searchKey,
|
|
112
|
+
columns: 3,
|
|
113
|
+
width: width,
|
|
114
|
+
fetchGifs: fetchGifs
|
|
115
|
+
})));
|
|
116
|
+
};
|
|
117
|
+
const areEqual = (prevProps, nextProps) => {
|
|
118
|
+
let allEqual = true;
|
|
119
|
+
if (prevProps.isVisible !== nextProps.isVisible) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
return allEqual;
|
|
123
|
+
};
|
|
124
|
+
export default /*#__PURE__*/React.memo(WebGifySelector, areEqual);
|
|
125
|
+
//# sourceMappingURL=WebSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useContext","useEffect","useState","GiphyFetch","Grid","SearchBar","SearchContext","SearchContextManager","SuggestionBar","gf","Button","View","Modal","Platform","ScrollView","WebGifySelector","isVisible","gifSelect","closeModal","view_mode","width","createElement","Fragment","OS","transparent","style","flex","animationType","type","padding","float","paddingTop","borderTopRightRadius","borderTopLeftRadius","apiKey","Components","flexDirection","title","onPress","fetchGifs","searchKey","initGifs","setInitGifs","getInitGifs","fetchedGifs","trending","offset","limit","data","paddingLeft","noLink","onGifClick","gif","initialGifs","key","columns","areEqual","prevProps","nextProps","allEqual","memo"],"sourceRoot":"../../../../src","sources":["SocialComponents/GifSelector/WebSelector.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE9D,SAASC,UAAU,QAAQ,qBAAqB;AAEhD,SACIC,IAAI;AAAE;AACNC,SAAS;AAAE;AACXC,aAAa;AAAE;AACfC,oBAAoB;AAAE;AACtBC,aAAa,CAAE;AAAA,OACZ,yBAAyB;AAEhC,MAAMC,EAAE,GAAG,IAAIN,UAAU,CAAC,kCAAkC,CAAC;AAC7D,SAASO,MAAM,EAAEC,IAAI,QAAQ,yBAAyB;AACtD,SAASC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;;AAE1D;;AASA,MAAMC,eAAe,GAAGA,CAAC;EAAEC,SAAS;EAAEC,SAAS;EAAEC,UAAU;EAAEC,SAAS;EAAEC;AAA2B,CAAC,KAAK;EACrG,IAAG,CAACJ,SAAS,EAAC;IAAE,oBAAQjB,KAAA,CAAAsB,aAAA,CAAA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,EAAE,GAACC,QAAQ,GAAC,EAAG;IAACa,GAAG,EAAEd,SAAU;IAACe,OAAO,EAAE,CAAE;IAACnC,KAAK,EAAEA,KAAM;IAACmB,SAAS,EAAEA;EAAU,CAAE,CAC1J,CACR,CAAC;AAEX,CAAC;AAGD,MAAMiB,QAAQ,GAAGA,CAACC,SAA8B,EAAEC,SAA8B,KAAK;EACjF,IAAIC,QAAQ,GAAG,IAAI;EACnB,IAAGF,SAAS,CAACzC,SAAS,KAAK0C,SAAS,CAAC1C,SAAS,EAAC;IAAE,OAAO,KAAK;EAAC;EAC9D,OAAO2C,QAAQ;AACnB,CAAC;AAED,4BAAe5D,KAAK,CAAC6D,IAAI,CAAC7C,eAAe,EAAEyC,QAAQ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text, View } from "../../../Components/Themed";
|
|
3
|
+
import { useColors } from "../../../constants/useColors";
|
|
4
|
+
import { FormattedText } from '../../FormattedTextInput/FormattedText';
|
|
5
|
+
import moment from 'moment-mini';
|
|
6
|
+
import { Image } from 'react-native';
|
|
7
|
+
import ImageRenderer from '../../ImageRenderer';
|
|
8
|
+
import UrlPreviewCard from '../../UrlPreviewCard';
|
|
9
|
+
const GroupMessageCard = ({
|
|
10
|
+
group_message,
|
|
11
|
+
mine,
|
|
12
|
+
player,
|
|
13
|
+
width,
|
|
14
|
+
onSelectImage,
|
|
15
|
+
onSelectTag
|
|
16
|
+
}) => {
|
|
17
|
+
const Colors = useColors();
|
|
18
|
+
const image = group_message.message_images ? group_message.message_images[0] : undefined;
|
|
19
|
+
const url = group_message.message_urls ? group_message.message_urls[0] : undefined;
|
|
20
|
+
return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(View, {
|
|
21
|
+
style: {
|
|
22
|
+
flexDirection: 'row',
|
|
23
|
+
alignItems: 'flex-end'
|
|
24
|
+
}
|
|
25
|
+
}, mine ? /*#__PURE__*/React.createElement(View, {
|
|
26
|
+
style: {
|
|
27
|
+
flex: 1
|
|
28
|
+
},
|
|
29
|
+
transparent: true
|
|
30
|
+
}) : /*#__PURE__*/React.createElement(View, {
|
|
31
|
+
float: true,
|
|
32
|
+
style: {
|
|
33
|
+
borderRadius: 100,
|
|
34
|
+
padding: 2
|
|
35
|
+
}
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
37
|
+
source: {
|
|
38
|
+
uri: player?.profile_pic
|
|
39
|
+
},
|
|
40
|
+
style: {
|
|
41
|
+
height: 36,
|
|
42
|
+
width: 36,
|
|
43
|
+
borderRadius: 100
|
|
44
|
+
},
|
|
45
|
+
resizeMode: "cover"
|
|
46
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
47
|
+
float: true,
|
|
48
|
+
style: {
|
|
49
|
+
width: width - 90,
|
|
50
|
+
padding: 14,
|
|
51
|
+
marginLeft: 10,
|
|
52
|
+
borderRadius: 22,
|
|
53
|
+
marginBottom: 15,
|
|
54
|
+
borderBottomLeftRadius: !mine ? 0 : 22,
|
|
55
|
+
borderBottomRightRadius: mine ? 0 : 22,
|
|
56
|
+
backgroundColor: mine ? Colors.absolutes.brand.midnight : Colors.absolutes.highlights.highlight200
|
|
57
|
+
}
|
|
58
|
+
}, url ? /*#__PURE__*/React.createElement(UrlPreviewCard, {
|
|
59
|
+
url: url,
|
|
60
|
+
width: width - 120,
|
|
61
|
+
color: Colors.text.white
|
|
62
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null), image ? /*#__PURE__*/React.createElement(ImageRenderer, {
|
|
63
|
+
image: image,
|
|
64
|
+
width: width - 120,
|
|
65
|
+
onSelectImage: onSelectImage
|
|
66
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null), group_message.formatted_text ? /*#__PURE__*/React.createElement(FormattedText, {
|
|
67
|
+
text: group_message.formatted_text,
|
|
68
|
+
tags: group_message.tags ?? [],
|
|
69
|
+
text_color: Colors.text.white,
|
|
70
|
+
onSelectTag: tag => onSelectTag(tag)
|
|
71
|
+
}) : group_message.message ? /*#__PURE__*/React.createElement(Text, {
|
|
72
|
+
size: 12,
|
|
73
|
+
color: Colors.text.white
|
|
74
|
+
}, group_message.message) : /*#__PURE__*/React.createElement(React.Fragment, null)), !mine ? /*#__PURE__*/React.createElement(View, {
|
|
75
|
+
transparent: true
|
|
76
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null)), /*#__PURE__*/React.createElement(Text, {
|
|
77
|
+
theme: "light",
|
|
78
|
+
textAlign: mine ? 'right' : 'left'
|
|
79
|
+
}, !mine && player ? `@${player?.username} - ` : '', "Delivered ", moment(group_message.create_datetime).format('hh:mm a')));
|
|
80
|
+
};
|
|
81
|
+
export default GroupMessageCard;
|
|
82
|
+
//# sourceMappingURL=GroupMessageCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Text","View","useColors","FormattedText","moment","Image","ImageRenderer","UrlPreviewCard","GroupMessageCard","group_message","mine","player","width","onSelectImage","onSelectTag","Colors","image","message_images","undefined","url","message_urls","createElement","style","flexDirection","alignItems","flex","transparent","float","borderRadius","padding","source","uri","profile_pic","height","resizeMode","marginLeft","marginBottom","borderBottomLeftRadius","borderBottomRightRadius","backgroundColor","absolutes","brand","midnight","highlights","highlight200","color","text","white","Fragment","formatted_text","tags","text_color","tag","message","size","theme","textAlign","username","create_datetime","format"],"sourceRoot":"../../../../../src","sources":["SocialComponents/GroupChat/components/GroupMessageCard.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,4BAA4B;AACvD,SAASC,SAAS,QAAQ,8BAA8B;AAExD,SAASC,aAAa,QAAQ,wCAAwC;AACtE,OAAOC,MAAM,MAAM,aAAa;AAChC,SAASC,KAAK,QAAQ,cAAc;AACpC,OAAOC,aAAa,MAAM,qBAAqB;AAC/C,OAAOC,cAAc,MAAM,sBAAsB;AAajD,MAAMC,gBAAgB,GAAGA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