@messenger-box/platform-mobile 0.0.1-alpha.437 → 0.0.1-alpha.454

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@messenger-box/platform-mobile",
3
- "version": "0.0.1-alpha.437",
3
+ "version": "0.0.1-alpha.454",
4
4
  "description": "Sample core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -19,8 +19,8 @@
19
19
  "watch": "yarn build:lib:watch"
20
20
  },
21
21
  "dependencies": {
22
- "@messenger-box/core": "0.0.1-alpha.437",
23
- "@messenger-box/platform-client": "0.0.1-alpha.437",
22
+ "@messenger-box/core": "0.0.1-alpha.454",
23
+ "@messenger-box/platform-client": "0.0.1-alpha.454",
24
24
  "base-64": "1.0.0",
25
25
  "react-native-gifted-chat": "1.0.4"
26
26
  },
@@ -40,5 +40,5 @@
40
40
  "typescript": {
41
41
  "definition": "lib/index.d.ts"
42
42
  },
43
- "gitHead": "b37d42f00a8fb15f2d364e8e1b96e811cce60279"
43
+ "gitHead": "ca227b522c6f1cc7f0f853480df3953ddc6dd439"
44
44
  }
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
- import { Avatar, Box, Button, HStack, Icon, Image, Spinner, Text, useColorModeValue, } from 'native-base';
2
+ import { Avatar, Box, Button, HStack, Icon, Image, Spinner, Text, useColorModeValue } from 'native-base';
3
3
  import { Platform, TouchableHighlight } from 'react-native';
4
4
  import { useFocusEffect, useIsFocused, useNavigation } from '@react-navigation/native';
5
5
  import { useSelector } from 'react-redux';
@@ -109,22 +109,22 @@ const ConversationViewComponent = ({ channelId, role }: any) => {
109
109
  refetchWritePolicy: 'merge',
110
110
  });
111
111
 
112
- const {
113
- data: channelsDetail,
114
- loading: channelLoading,
115
- refetch: refetchChannelDetail,
116
- } = useViewChannelDetailQuery({
117
- variables: {
118
- id: channelId?.toString(),
119
- },
120
- });
112
+ // const {
113
+ // data: channelsDetail,
114
+ // loading: channelLoading,
115
+ // refetch: refetchChannelDetail,
116
+ // } = useViewChannelDetailQuery({
117
+ // variables: {
118
+ // id: channelId?.toString(),
119
+ // },
120
+ // });
121
121
  // const { data: users } = useGetAllUsersQuery();
122
122
 
123
123
  useFocusEffect(
124
124
  React.useCallback(() => {
125
125
  // Do something when the screen is focused
126
126
  setSkip(0);
127
- refetchChannelDetail({ id: channelId?.toString() });
127
+ // refetchChannelDetail({ id: channelId?.toString() });
128
128
  refetch({
129
129
  channelId: channelId?.toString(),
130
130
  parentId: null,
@@ -246,7 +246,7 @@ const ConversationViewComponent = ({ channelId, role }: any) => {
246
246
  };
247
247
 
248
248
  if (images && images.length > 0) {
249
- const postId = objectId()
249
+ const postId = objectId();
250
250
 
251
251
  setLoading(true);
252
252
  const uploadResponse = await startUpload({
@@ -317,7 +317,7 @@ const ConversationViewComponent = ({ channelId, role }: any) => {
317
317
  const messageList = useMemo(() => {
318
318
  let currentDate = '';
319
319
  let res: any = [];
320
- if (channelMessages.length) {
320
+ if (channelId && channelMessages && channelMessages?.length > 0) {
321
321
  orderBy(channelMessages, ['createdAt'], ['desc']).map((msg) => {
322
322
  let message: IMessageProps = {
323
323
  _id: '',
@@ -349,17 +349,17 @@ const ConversationViewComponent = ({ channelId, role }: any) => {
349
349
  });
350
350
  }
351
351
  return res;
352
- }, [channelMessages]);
352
+ }, [channelMessages, channelId]);
353
353
 
354
354
  const renderSend = (props) => {
355
355
  return (
356
- <Send {...props}>
356
+ <Send {...props} disabled={channelId ? false : true}>
357
357
  <Box>
358
358
  <MaterialCommunityIcons
359
359
  name="send-circle"
360
360
  style={{ marginBottom: 5, marginRight: 5 }}
361
361
  size={32}
362
- color="#2e64e5"
362
+ color={channelId ? '#2e64e5' : '#b8b2b2'}
363
363
  />
364
364
  </Box>
365
365
  </Send>
@@ -683,7 +683,7 @@ const ConversationViewComponent = ({ channelId, role }: any) => {
683
683
  // }
684
684
  // }
685
685
  // }}
686
- onSend={(messages) => handleSend(messages[0]?.text ?? ' ')}
686
+ onSend={(messages) => channelId && handleSend(messages[0]?.text ?? ' ')}
687
687
  text={msg ? msg : ' '}
688
688
  onInputTextChanged={(text) => setMsg(text)}
689
689
  renderFooter={() => (loading ? <Spinner /> : imageLoading ? <Spinner /> : '')}
@@ -715,7 +715,7 @@ const ConversationViewComponent = ({ channelId, role }: any) => {
715
715
  // }
716
716
  renderMessageText={renderMessageText}
717
717
  minInputToolbarHeight={50}
718
- renderActions={renderActions}
718
+ renderActions={channelId && renderActions}
719
719
  renderAccessory={renderAccessory}
720
720
  renderMessage={renderMessage}
721
721
  renderChatFooter={() => (