be-components 5.1.8 → 5.2.0
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 +80 -21
- package/lib/commonjs/SocialComponents/FormattedTextInput/components/TagSelector.js.map +1 -1
- package/lib/commonjs/SocialComponents/FormattedTextInput/index.js +49 -11
- 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 +112 -0
- package/lib/commonjs/SocialComponents/GroupChat/components/GroupMessageCard.js.map +1 -0
- package/lib/commonjs/SocialComponents/GroupChat/index.js +501 -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 +16 -6
- 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 +437 -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 +79 -21
- package/lib/module/SocialComponents/FormattedTextInput/components/TagSelector.js.map +1 -1
- package/lib/module/SocialComponents/FormattedTextInput/index.js +49 -11
- 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 +105 -0
- package/lib/module/SocialComponents/GroupChat/components/GroupMessageCard.js.map +1 -0
- package/lib/module/SocialComponents/GroupChat/index.js +493 -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 +16 -6
- 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 +437 -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 +3 -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 +14 -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 +18 -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 +3 -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 +94 -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 -1
- 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 +14 -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 +18 -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 +4 -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 +94 -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 +8 -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 +21 -0
- package/lib/typescript/src/SocialComponents/GroupChat/components/GroupMessageCard.d.ts.map +1 -0
- package/lib/typescript/src/SocialComponents/GroupChat/index.d.ts +34 -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 +3 -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 +42 -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 +56 -15
- package/src/SocialComponents/FormattedTextInput/index.tsx +36 -9
- package/src/SocialComponents/GifSelector/NativeSelector.tsx +13 -0
- package/src/SocialComponents/GifSelector/WebSelector.tsx +91 -0
- package/src/SocialComponents/GroupChat/components/GroupMessageCard.tsx +105 -0
- package/src/SocialComponents/GroupChat/index.tsx +403 -0
- package/src/SocialComponents/ImageRenderer.tsx +42 -0
- package/src/SocialComponents/InputBar/components/ActionSelector.tsx +165 -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 +9 -8
- package/src/SocialComponents/SocialOrdersList.tsx +14 -8
- package/src/SocialComponents/UrlPreviewCard.tsx +75 -0
- package/src/SocialComponents/api/index.ts +385 -3
- package/src/SocialComponents/index.tsx +4 -0
- package/src/types.d.ts +58 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Text","View","useColors","FormattedText","moment","Image","ImageRenderer","UrlPreviewCard","SocialOrdersList","GroupMessageCard","group_message","orders","mine","player","width","onSelectImage","onSelectTag","onCopyOrder","onFadeOrder","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","formatted_text","text","tags","text_color","white","tag","message","size","color","Fragment","marginTop","max_height","length","maxWidth","players","direction","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;AACjD,OAAOC,gBAAgB,MAAM,wBAAwB;AAgBrD,MAAMC,gBAAgB,GAAGA,CAAC;EAACC,aAAa;EAAEC,MAAM;EAAEC,IAAI;EAAEC,MAAM;EAAEC,KAAK;EAAEC,aAAa;EAAEC,WAAW;EAAEC,WAAW;EAAEC;AAAiC,CAAC,KAAK;EACnJ,MAAMC,MAAM,GAAGjB,SAAS,CAAC,CAAC;EAC1B,MAAMkB,KAAK,GAAGV,aAAa,CAACW,cAAc,GAA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AA,CAAA0B,aAAA,CAAA1B,KAAA,CAAA2D,QAAA,MAAI,CAAC,EACL7C,MAAM,IAAIF,MAAM,IAAIA,MAAM,CAACkD,MAAM,GAAG,CAAC,gBACtC9D,KAAA,CAAA0B,aAAA,CAACxB,IAAI;IAAC8B,KAAK;IAACL,KAAK,EAAE;MAAEO,OAAO,EAAC,CAAC;MAAE0B,SAAS,EAAC;IAAG;EAAE,gBAC3C5D,KAAA,CAAA0B,aAAA,CAACjB,gBAAgB;IACbG,MAAM,EAAEA,MAAO;IACfM,WAAW,EAAEA,WAAY;IACzBC,WAAW,EAAEA,WAAY;IACzB4C,QAAQ,EAAEhD,KAAK,GAAG,GAAI;IACtBiD,OAAO,EAAE,CAAClD,MAAM,CAAE;IAClBmD,SAAS,EAAC;EAAY,CAEzB,CACC,CAAC,gBACNjE,KAAA,CAAA0B,aAAA,CAAA1B,KAAA,CAAA2D,QAAA,MAAI,CACH,CAAC,EACN,CAAC9C,IAAI,gBACNb,KAAA,CAAA0B,aAAA,CAACxB,IAAI;IAAC6B,WAAW;EAAA,CAAE,CAAC,gBACnB/B,KAAA,CAAA0B,aAAA,CAAA1B,KAAA,CAAA2D,QAAA,MAAI,CACH,CAAC,eACP3D,KAAA,CAAA0B,aAAA,CAACzB,IAAI;IAACiE,KAAK,EAAC,OAAO;IAACC,SAAS,EAAEtD,IAAI,GAAC,OAAO,GAAC;EAAO,GAAE,CAACA,IAAI,IAAIC,MAAM,GAAE,IAAIA,MAAM,EAAEsD,QAAQ,KAAK,GAAE,EAAE,EAAC,YAAU,EAAC/D,MAAM,CAACM,aAAa,CAAC0D,eAAe,CAAC,CAACC,MAAM,CAAC,SAAS,CAAQ,CAC3K,CAAC;AAEf,CAAC;AAED,eAAe5D,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import moment from "moment-mini";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { ActivityIndicator, FlatList, Image } from "react-native";
|
|
5
|
+
import { useColors } from "../../constants/useColors";
|
|
6
|
+
import { SocialComponentApi, SocialComponentHelpers } from "../api";
|
|
7
|
+
import { Button, Text, View } from "../../Components/Themed";
|
|
8
|
+
import GroupMessageCard from './components/GroupMessageCard';
|
|
9
|
+
import InputBar from '../InputBar';
|
|
10
|
+
import FormattedTextInput from '../FormattedTextInput';
|
|
11
|
+
import SocketManager from '../../Socket';
|
|
12
|
+
import SocialOrdersList from '../SocialOrdersList';
|
|
13
|
+
const sections = ['orders', 'input_bar', 'input'];
|
|
14
|
+
const GroupChat = ({
|
|
15
|
+
my_id,
|
|
16
|
+
player_id,
|
|
17
|
+
width,
|
|
18
|
+
group_id,
|
|
19
|
+
access_token,
|
|
20
|
+
insets,
|
|
21
|
+
distinct_id,
|
|
22
|
+
onCopyOrder,
|
|
23
|
+
onFadeOrder,
|
|
24
|
+
onClose,
|
|
25
|
+
onFocusPosition,
|
|
26
|
+
onSelectImage,
|
|
27
|
+
onSelectTag
|
|
28
|
+
}) => {
|
|
29
|
+
const Colors = useColors();
|
|
30
|
+
const [chat_size, setChatSize] = useState({
|
|
31
|
+
height: 0,
|
|
32
|
+
width: 0
|
|
33
|
+
});
|
|
34
|
+
const [show_input_bar, setShowInputBar] = useState(false);
|
|
35
|
+
const [needs_reload, setNeedsReload] = useState(false);
|
|
36
|
+
const [message_loading, setMessageLoading] = useState(false);
|
|
37
|
+
const [socket_message, setSocketMessage] = useState(undefined);
|
|
38
|
+
const [draft_orders, setDraftOrders] = useState([]);
|
|
39
|
+
const [my_data, setMyData] = useState({});
|
|
40
|
+
const {
|
|
41
|
+
me
|
|
42
|
+
} = my_data;
|
|
43
|
+
const [screen_data, setData] = useState({
|
|
44
|
+
loading: false,
|
|
45
|
+
group_players: []
|
|
46
|
+
});
|
|
47
|
+
const {
|
|
48
|
+
loading,
|
|
49
|
+
group
|
|
50
|
+
} = screen_data;
|
|
51
|
+
const [message_data, setMessageData] = useState({
|
|
52
|
+
messages_loading: false,
|
|
53
|
+
messages: [],
|
|
54
|
+
players: [],
|
|
55
|
+
orders: []
|
|
56
|
+
});
|
|
57
|
+
const {
|
|
58
|
+
messages,
|
|
59
|
+
players,
|
|
60
|
+
orders
|
|
61
|
+
} = message_data;
|
|
62
|
+
const chat_ref = useRef(null);
|
|
63
|
+
const unique_dates = [...new Set(messages.map(m => moment(m.create_datetime).format('MMM DD YYYY')))];
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
SocialComponentApi.setEnvironment();
|
|
66
|
+
if (group_id) {
|
|
67
|
+
getGroupFromServer(group_id);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (player_id) {
|
|
71
|
+
getChatFromServer(player_id);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
}, [group_id, player_id]);
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (!my_id) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
getMyData();
|
|
80
|
+
}, [my_id]);
|
|
81
|
+
const getMyData = async () => {
|
|
82
|
+
const player = await SocialComponentApi.getMyDetails();
|
|
83
|
+
setMyData({
|
|
84
|
+
me: player
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (!socket_message) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
getNewData(socket_message);
|
|
92
|
+
}, [socket_message]);
|
|
93
|
+
const getNewData = async message => {
|
|
94
|
+
const new_resp = await SocialComponentHelpers.addDataToMessages([message]);
|
|
95
|
+
setMessageData({
|
|
96
|
+
...message_data,
|
|
97
|
+
messages: messages.filter(m => m.group_message_id != message.group_message_id).concat(new_resp.group_messages),
|
|
98
|
+
players: players.filter(p => !new_resp.players.find(np => np.player_id == p.player_id)).concat(new_resp.players),
|
|
99
|
+
orders: orders.filter(p => !new_resp.orders.find(np => np.order_id == p.order_id)).concat(new_resp.orders)
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
const chat_player = group?.type == 'direct' ? players.find(p => p.player_id == player_id) : undefined;
|
|
103
|
+
const getChatFromServer = async id => {
|
|
104
|
+
setData({
|
|
105
|
+
...screen_data,
|
|
106
|
+
loading: true
|
|
107
|
+
});
|
|
108
|
+
if (!my_id) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
setMessageData({
|
|
112
|
+
...message_data,
|
|
113
|
+
messages_loading: true
|
|
114
|
+
});
|
|
115
|
+
const group_response = await SocialComponentApi.getChat(id);
|
|
116
|
+
if (!group_response) {
|
|
117
|
+
return setData({
|
|
118
|
+
...screen_data,
|
|
119
|
+
loading: false
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
const gm_data = await SocialComponentHelpers.addDataToMessages(group_response.group_messages);
|
|
123
|
+
setData({
|
|
124
|
+
...screen_data,
|
|
125
|
+
group: group_response.group,
|
|
126
|
+
group_players: group_response.group_players,
|
|
127
|
+
loading: false
|
|
128
|
+
});
|
|
129
|
+
setMessageData({
|
|
130
|
+
...message_data,
|
|
131
|
+
messages_loading: false,
|
|
132
|
+
players: gm_data.players,
|
|
133
|
+
messages: gm_data.group_messages,
|
|
134
|
+
orders: gm_data.orders
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
const getGroupFromServer = async id => {
|
|
138
|
+
setData({
|
|
139
|
+
...screen_data,
|
|
140
|
+
loading: true
|
|
141
|
+
});
|
|
142
|
+
setMessageData({
|
|
143
|
+
...message_data,
|
|
144
|
+
messages_loading: true
|
|
145
|
+
});
|
|
146
|
+
const group_response = await SocialComponentApi.getGroupById(id);
|
|
147
|
+
if (!group_response) {
|
|
148
|
+
return setData({
|
|
149
|
+
...screen_data,
|
|
150
|
+
loading: false
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
const gm_data = await SocialComponentHelpers.addDataToMessages(group_response.group_messages);
|
|
154
|
+
setData({
|
|
155
|
+
...screen_data,
|
|
156
|
+
group: group_response.group,
|
|
157
|
+
group_players: group_response.group_players,
|
|
158
|
+
loading: false
|
|
159
|
+
});
|
|
160
|
+
setMessageData({
|
|
161
|
+
...message_data,
|
|
162
|
+
messages_loading: false,
|
|
163
|
+
players: gm_data.players,
|
|
164
|
+
messages: gm_data.group_messages,
|
|
165
|
+
orders: gm_data.orders
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
//const message_valid = message_text != '' ? true : false
|
|
170
|
+
|
|
171
|
+
const handleSendImage = async image => {
|
|
172
|
+
if (!group || message_loading) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
setMessageLoading(true);
|
|
176
|
+
const group_message = SocialComponentHelpers.getEmptyMessage();
|
|
177
|
+
const gm = await SocialComponentApi.sendChat({
|
|
178
|
+
...group_message,
|
|
179
|
+
formatted_text: '',
|
|
180
|
+
tags: [],
|
|
181
|
+
message_images: [image],
|
|
182
|
+
group_id: group.group_id,
|
|
183
|
+
message: ''
|
|
184
|
+
});
|
|
185
|
+
if (!gm) {
|
|
186
|
+
setMessageLoading(false);
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
setMessageData({
|
|
190
|
+
...message_data,
|
|
191
|
+
messages: messages.filter(m => m.group_message_id != gm.group_message_id).concat(gm)
|
|
192
|
+
});
|
|
193
|
+
setMessageLoading(false);
|
|
194
|
+
};
|
|
195
|
+
const handleSendMessage = async (data, tags) => {
|
|
196
|
+
if (!group || message_loading) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
setMessageLoading(true);
|
|
200
|
+
|
|
201
|
+
//Find urls!
|
|
202
|
+
const url = SocialComponentHelpers.getUrlsFromString(data.text);
|
|
203
|
+
let message_urls = [];
|
|
204
|
+
if (url) {
|
|
205
|
+
message_urls.push(url);
|
|
206
|
+
}
|
|
207
|
+
const group_message = SocialComponentHelpers.getEmptyMessage();
|
|
208
|
+
const gm = await SocialComponentApi.sendChat({
|
|
209
|
+
...group_message,
|
|
210
|
+
formatted_text: data.formatted_text,
|
|
211
|
+
tags: tags.map(t => {
|
|
212
|
+
return {
|
|
213
|
+
...t,
|
|
214
|
+
data: undefined
|
|
215
|
+
};
|
|
216
|
+
}),
|
|
217
|
+
//Drop the data!
|
|
218
|
+
group_id: group.group_id,
|
|
219
|
+
message_urls: message_urls,
|
|
220
|
+
message_orders: draft_orders.map(o => o.order_id),
|
|
221
|
+
message: data.text
|
|
222
|
+
});
|
|
223
|
+
if (!gm) {
|
|
224
|
+
setMessageLoading(false);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
setMessageData({
|
|
228
|
+
...message_data,
|
|
229
|
+
messages: messages.filter(m => m.group_message_id != gm.group_message_id).concat(gm)
|
|
230
|
+
});
|
|
231
|
+
setMessageLoading(false);
|
|
232
|
+
};
|
|
233
|
+
const renderMessages = data => {
|
|
234
|
+
const player = players.find(p => p.player_id == data.item.player_id);
|
|
235
|
+
const mine = player?.player_id == me?.player_id ? true : false;
|
|
236
|
+
let post_orders = data.item.message_orders ? orders.filter(o => data.item.message_orders?.includes(o.order_id)) : [];
|
|
237
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
238
|
+
style: {
|
|
239
|
+
margin: 5
|
|
240
|
+
}
|
|
241
|
+
}, /*#__PURE__*/React.createElement(GroupMessageCard, {
|
|
242
|
+
player: player,
|
|
243
|
+
me: me,
|
|
244
|
+
width: chat_size.width,
|
|
245
|
+
mine: mine,
|
|
246
|
+
onCopyOrder: onCopyOrder,
|
|
247
|
+
onFadeOrder: onFadeOrder,
|
|
248
|
+
orders: post_orders,
|
|
249
|
+
onSelectImage: onSelectImage,
|
|
250
|
+
group_message: data.item,
|
|
251
|
+
onSelectTag: onSelectTag
|
|
252
|
+
}));
|
|
253
|
+
};
|
|
254
|
+
const renderDates = data => {
|
|
255
|
+
const date_messages = messages.filter(m => moment(m.create_datetime).format('MMM DD YYYY') == data.item);
|
|
256
|
+
return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(View, {
|
|
257
|
+
style: {
|
|
258
|
+
padding: 10
|
|
259
|
+
}
|
|
260
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
261
|
+
size: 16,
|
|
262
|
+
theme: "light",
|
|
263
|
+
textAlign: "center"
|
|
264
|
+
}, data.item)), /*#__PURE__*/React.createElement(FlatList, {
|
|
265
|
+
key: 'date_messages',
|
|
266
|
+
keyExtractor: item => item.group_message_id.toString(),
|
|
267
|
+
data: date_messages.sort((a, b) => moment(a.create_datetime).unix() - moment(b.create_datetime).unix()),
|
|
268
|
+
renderItem: renderMessages
|
|
269
|
+
}));
|
|
270
|
+
};
|
|
271
|
+
const renderSections = data => {
|
|
272
|
+
switch (data.item) {
|
|
273
|
+
case 'orders':
|
|
274
|
+
if (draft_orders.length == 0) {
|
|
275
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
276
|
+
}
|
|
277
|
+
return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(SocialOrdersList, {
|
|
278
|
+
players: players,
|
|
279
|
+
orders: draft_orders,
|
|
280
|
+
onUntagOrder: order => setDraftOrders(draft_orders.filter(o => o.order_id != order.order_id)),
|
|
281
|
+
direction: "horizontal"
|
|
282
|
+
}));
|
|
283
|
+
case 'input_bar':
|
|
284
|
+
if (!show_input_bar) {
|
|
285
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
286
|
+
}
|
|
287
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
288
|
+
type: "header",
|
|
289
|
+
style: {
|
|
290
|
+
padding: 5
|
|
291
|
+
}
|
|
292
|
+
}, /*#__PURE__*/React.createElement(InputBar, {
|
|
293
|
+
actions: ['image', 'action'],
|
|
294
|
+
width: width,
|
|
295
|
+
insets: insets,
|
|
296
|
+
onTagOrder: order => {
|
|
297
|
+
setDraftOrders(draft_orders.filter(o => o.order_id != order.order_id).concat(order));
|
|
298
|
+
},
|
|
299
|
+
onImageUpload: image => handleSendImage(image)
|
|
300
|
+
}));
|
|
301
|
+
case 'input':
|
|
302
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
303
|
+
type: "footer",
|
|
304
|
+
style: {
|
|
305
|
+
padding: 5,
|
|
306
|
+
paddingBottom: (insets?.bottom ?? 0) + 5
|
|
307
|
+
}
|
|
308
|
+
}, /*#__PURE__*/React.createElement(FormattedTextInput, {
|
|
309
|
+
submit_placement: "inline",
|
|
310
|
+
icon_submit: true,
|
|
311
|
+
width: chat_size.width,
|
|
312
|
+
onSelectInput: () => setShowInputBar(!show_input_bar),
|
|
313
|
+
onSubmit: (data, tags) => handleSendMessage(data, tags),
|
|
314
|
+
onFocusPosition: onFocusPosition
|
|
315
|
+
}));
|
|
316
|
+
default:
|
|
317
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
321
|
+
style: {
|
|
322
|
+
flex: 1
|
|
323
|
+
},
|
|
324
|
+
onLayout: ev => {
|
|
325
|
+
const {
|
|
326
|
+
height,
|
|
327
|
+
width
|
|
328
|
+
} = ev.nativeEvent.layout;
|
|
329
|
+
setChatSize({
|
|
330
|
+
height,
|
|
331
|
+
width
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
}, group?.type == 'direct' && chat_player ? /*#__PURE__*/React.createElement(View, {
|
|
335
|
+
type: "header",
|
|
336
|
+
style: {
|
|
337
|
+
flexDirection: 'row',
|
|
338
|
+
alignItems: 'center',
|
|
339
|
+
padding: 10,
|
|
340
|
+
paddingTop: (insets?.top ?? 0) + 10
|
|
341
|
+
}
|
|
342
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
343
|
+
transparent: true
|
|
344
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
345
|
+
source: {
|
|
346
|
+
uri: chat_player.profile_pic
|
|
347
|
+
},
|
|
348
|
+
style: {
|
|
349
|
+
height: 40,
|
|
350
|
+
width: 40,
|
|
351
|
+
borderRadius: 100
|
|
352
|
+
},
|
|
353
|
+
resizeMode: "cover"
|
|
354
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
355
|
+
transparent: true,
|
|
356
|
+
style: {
|
|
357
|
+
flex: 1,
|
|
358
|
+
marginLeft: 10
|
|
359
|
+
}
|
|
360
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
361
|
+
theme: "h1"
|
|
362
|
+
}, "@", chat_player.username), /*#__PURE__*/React.createElement(Text, {
|
|
363
|
+
style: {
|
|
364
|
+
marginTop: 3
|
|
365
|
+
},
|
|
366
|
+
theme: "description"
|
|
367
|
+
}, "Joined ", moment(chat_player.create_datetime).fromNow())), onClose ? /*#__PURE__*/React.createElement(Button, {
|
|
368
|
+
type: "close",
|
|
369
|
+
title: "X",
|
|
370
|
+
float: true,
|
|
371
|
+
style: {
|
|
372
|
+
padding: 0,
|
|
373
|
+
borderRadius: 100,
|
|
374
|
+
justifyContent: 'center',
|
|
375
|
+
alignItems: 'center',
|
|
376
|
+
height: 30,
|
|
377
|
+
width: 30
|
|
378
|
+
},
|
|
379
|
+
onPress: () => onClose()
|
|
380
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null)) : group ? /*#__PURE__*/React.createElement(View, {
|
|
381
|
+
type: "header",
|
|
382
|
+
style: {
|
|
383
|
+
flexDirection: 'row',
|
|
384
|
+
alignItems: 'center',
|
|
385
|
+
padding: 10,
|
|
386
|
+
paddingTop: (insets?.top ?? 0) + 10
|
|
387
|
+
}
|
|
388
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
389
|
+
transparent: true
|
|
390
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
391
|
+
source: {
|
|
392
|
+
uri: group.group_image?.url
|
|
393
|
+
},
|
|
394
|
+
style: {
|
|
395
|
+
height: 40,
|
|
396
|
+
width: 40,
|
|
397
|
+
borderRadius: 100
|
|
398
|
+
},
|
|
399
|
+
resizeMode: "cover"
|
|
400
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
401
|
+
transparent: true,
|
|
402
|
+
style: {
|
|
403
|
+
flex: 1,
|
|
404
|
+
marginLeft: 10
|
|
405
|
+
}
|
|
406
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
407
|
+
theme: "h1"
|
|
408
|
+
}, group.name), /*#__PURE__*/React.createElement(Text, {
|
|
409
|
+
style: {
|
|
410
|
+
marginTop: 3
|
|
411
|
+
},
|
|
412
|
+
theme: "description"
|
|
413
|
+
}, moment(group.last_update_datetime).format('YYYY MM DD'))), onClose ? /*#__PURE__*/React.createElement(Button, {
|
|
414
|
+
type: "close",
|
|
415
|
+
title: "X",
|
|
416
|
+
float: true,
|
|
417
|
+
style: {
|
|
418
|
+
padding: 0,
|
|
419
|
+
borderRadius: 100,
|
|
420
|
+
justifyContent: 'center',
|
|
421
|
+
alignItems: 'center',
|
|
422
|
+
height: 30,
|
|
423
|
+
width: 30
|
|
424
|
+
},
|
|
425
|
+
onPress: () => onClose()
|
|
426
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null)) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(View, {
|
|
427
|
+
style: {
|
|
428
|
+
flex: 1
|
|
429
|
+
}
|
|
430
|
+
}, /*#__PURE__*/React.createElement(FlatList, {
|
|
431
|
+
ref: chat_ref,
|
|
432
|
+
data: unique_dates,
|
|
433
|
+
inverted: true,
|
|
434
|
+
style: {
|
|
435
|
+
flex: 1
|
|
436
|
+
},
|
|
437
|
+
renderItem: renderDates,
|
|
438
|
+
key: `chat_${group_id}dates`,
|
|
439
|
+
keyExtractor: item => item
|
|
440
|
+
})), /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(FlatList, {
|
|
441
|
+
data: sections,
|
|
442
|
+
key: 'chat_sections',
|
|
443
|
+
scrollEnabled: false,
|
|
444
|
+
keyExtractor: item => item,
|
|
445
|
+
renderItem: renderSections
|
|
446
|
+
})), group ? /*#__PURE__*/React.createElement(SocketManager, {
|
|
447
|
+
distinct_id: distinct_id,
|
|
448
|
+
access_token: access_token,
|
|
449
|
+
group_id: group.group_id,
|
|
450
|
+
subscribed_events: ['V1_UPDATE_GROUP_MESSAGE'],
|
|
451
|
+
onConnect: () => {
|
|
452
|
+
if (!needs_reload) {
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
if (group_id) {
|
|
456
|
+
return getGroupFromServer(group_id);
|
|
457
|
+
}
|
|
458
|
+
if (player_id) {
|
|
459
|
+
return getChatFromServer(player_id);
|
|
460
|
+
}
|
|
461
|
+
return;
|
|
462
|
+
},
|
|
463
|
+
onDisconnect: () => {
|
|
464
|
+
setNeedsReload(true);
|
|
465
|
+
},
|
|
466
|
+
onSocketEvent: ev => {
|
|
467
|
+
if (!ev.data) {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
let gm = ev.data;
|
|
471
|
+
if (gm.group_id != group.group_id) {
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
setSocketMessage(gm);
|
|
475
|
+
}
|
|
476
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null), loading ? /*#__PURE__*/React.createElement(View, {
|
|
477
|
+
type: "blur",
|
|
478
|
+
style: {
|
|
479
|
+
position: 'absolute',
|
|
480
|
+
top: 0,
|
|
481
|
+
left: 0,
|
|
482
|
+
right: 0,
|
|
483
|
+
bottom: 0,
|
|
484
|
+
alignItems: 'center',
|
|
485
|
+
padding: 20
|
|
486
|
+
}
|
|
487
|
+
}, /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
488
|
+
size: "large",
|
|
489
|
+
color: Colors.text.h1
|
|
490
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null));
|
|
491
|
+
};
|
|
492
|
+
export default GroupChat;
|
|
493
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","moment","useEffect","useRef","useState","ActivityIndicator","FlatList","Image","useColors","SocialComponentApi","SocialComponentHelpers","Button","Text","View","GroupMessageCard","InputBar","FormattedTextInput","SocketManager","SocialOrdersList","sections","GroupChat","my_id","player_id","width","group_id","access_token","insets","distinct_id","onCopyOrder","onFadeOrder","onClose","onFocusPosition","onSelectImage","onSelectTag","Colors","chat_size","setChatSize","height","show_input_bar","setShowInputBar","needs_reload","setNeedsReload","message_loading","setMessageLoading","socket_message","setSocketMessage","undefined","draft_orders","setDraftOrders","my_data","setMyData","me","screen_data","setData","loading","group_players","group","message_data","setMessageData","messages_loading","messages","players","orders","chat_ref","unique_dates","Set","map","m","create_datetime","format","setEnvironment","getGroupFromServer","getChatFromServer","getMyData","player","getMyDetails","getNewData","message","new_resp","addDataToMessages","filter","group_message_id","concat","group_messages","p","find","np","order_id","chat_player","type","id","group_response","getChat","gm_data","getGroupById","handleSendImage","image","group_message","getEmptyMessage","gm","sendChat","formatted_text","tags","message_images","handleSendMessage","data","url","getUrlsFromString","text","message_urls","push","t","message_orders","o","renderMessages","item","mine","post_orders","includes","createElement","style","margin","renderDates","date_messages","padding","size","theme","textAlign","key","keyExtractor","toString","sort","a","b","unix","renderItem","renderSections","length","Fragment","onUntagOrder","order","direction","actions","onTagOrder","onImageUpload","paddingBottom","bottom","submit_placement","icon_submit","onSelectInput","onSubmit","flex","onLayout","ev","nativeEvent","layout","flexDirection","alignItems","paddingTop","top","transparent","source","uri","profile_pic","borderRadius","resizeMode","marginLeft","username","marginTop","fromNow","title","float","justifyContent","onPress","group_image","name","last_update_datetime","ref","inverted","scrollEnabled","subscribed_events","onConnect","onDisconnect","onSocketEvent","position","left","right","color","h1"],"sourceRoot":"../../../../src","sources":["SocialComponents/GroupChat/index.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,aAAa;AAChC,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACnD,SAASC,iBAAiB,EAAEC,QAAQ,EAAEC,KAAK,QAAQ,cAAc;AACjE,SAASC,SAAS,QAAQ,2BAA2B;AAErD,SAASC,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,EAAC;QAAE;MAAO;MAC1CqB,gBAAgB,CAACsD,EAAE,CAAC;IACxB;EAAE,CACL,CAAC,gBACDnG,KAAA,CAAAuH,aAAA,CAAAvH,KAAA,CAAA0I,QAAA,MAAI,CAAC,EACLpF,OAAO,gBACRtD,KAAA,CAAAuH,aAAA,CAAC1G,IAAI;IAAC4E,IAAI,EAAC,MAAM;IAAC+B,KAAK,EAAE;MAAEgE,QAAQ,EAAC,UAAU;MAAEzB,GAAG,EAAC,CAAC;MAAE0B,IAAI,EAAC,CAAC;MAAEC,KAAK,EAAC,CAAC;MAAExC,MAAM,EAAC,CAAC;MAAEW,UAAU,EAAC,QAAQ;MAAEjC,OAAO,EAAC;IAAG;EAAE,gBAChH5H,KAAA,CAAAuH,aAAA,CAAClH,iBAAiB;IACdwH,IAAI,EAAC,OAAO;IACZ8D,KAAK,EAAEzJ,MAAM,CAAC0E,IAAI,CAACgF;EAAG,CACzB,CACC,CAAC,gBACN5L,KAAA,CAAAuH,aAAA,CAAAvH,KAAA,CAAA0I,QAAA,MAAI,CACH,CAAC;AAEf,CAAC;AAED,eAAetH,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Image } from "react-native";
|
|
3
|
+
import { Button } from "../Components/Themed";
|
|
4
|
+
const ImageRenderer = ({
|
|
5
|
+
image,
|
|
6
|
+
width,
|
|
7
|
+
onSelectImage,
|
|
8
|
+
max_height,
|
|
9
|
+
style,
|
|
10
|
+
allow_aspect_change
|
|
11
|
+
}) => {
|
|
12
|
+
const getImageRatio = () => {
|
|
13
|
+
let ratio = 1;
|
|
14
|
+
if (image.width && image.height) {
|
|
15
|
+
ratio = image.width / image.height;
|
|
16
|
+
}
|
|
17
|
+
return ratio;
|
|
18
|
+
};
|
|
19
|
+
const ratio = getImageRatio();
|
|
20
|
+
let image_width = width;
|
|
21
|
+
let image_height = width * ratio;
|
|
22
|
+
if (max_height && image_height > max_height) {
|
|
23
|
+
image_height = max_height;
|
|
24
|
+
if (!allow_aspect_change) {
|
|
25
|
+
image_width = image_height / ratio;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
29
|
+
disabled: !onSelectImage,
|
|
30
|
+
transparent: true,
|
|
31
|
+
style: {
|
|
32
|
+
padding: 0
|
|
33
|
+
},
|
|
34
|
+
onPress: () => onSelectImage ? onSelectImage(image) : console.log('')
|
|
35
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
36
|
+
source: {
|
|
37
|
+
uri: image.url
|
|
38
|
+
},
|
|
39
|
+
style: {
|
|
40
|
+
height: image_height,
|
|
41
|
+
width: image_width,
|
|
42
|
+
...style
|
|
43
|
+
},
|
|
44
|
+
resizeMode: "cover"
|
|
45
|
+
}));
|
|
46
|
+
};
|
|
47
|
+
export default ImageRenderer;
|
|
48
|
+
//# sourceMappingURL=ImageRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Image","Button","ImageRenderer","image","width","onSelectImage","max_height","style","allow_aspect_change","getImageRatio","ratio","height","image_width","image_height","createElement","disabled","transparent","padding","onPress","console","log","source","uri","url","resizeMode"],"sourceRoot":"../../../src","sources":["SocialComponents/ImageRenderer.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,QAAQ,cAAc;AACpC,SAASC,MAAM,QAAQ,sBAAsB;AAU7C,MAAMC,aAAa,GAAGA,CAAC;EAAEC,KAAK;EAAEC,KAAK;EAAEC,aAAa;EAAEC,UAAU;EAAEC,KAAK;EAAEC;AAAuC,CAAC,KAAK;EAClH,MAAMC,aAAa,GAAGA,CAAA,KAAM;IACxB,IAAIC,KAAK,GAAG,CAAC;IACb,IAAGP,KAAK,CAACC,KAAK,IAAID,KAAK,CAACQ,MAAM,EAAC;MAC3BD,KAAK,GAAGP,KAAK,CAACC,KAAK,GAAGD,KAAK,CAACQ,MAAM;IACtC;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