Browse Source

CHANGE | chat conversation process creating (personal & group)

change/chat-conversation
Yevhen Romanenko 9 months ago
parent
commit
bd41cb538e
  1. BIN
      android/app/src/main/assets/fonts/fontello.ttf
  2. 44
      ios/Podfile.lock
  3. 31931
      package-lock.json
  4. BIN
      src/assets/fonts/fontello.ttf
  5. 14
      src/config/fontello.json
  6. 52
      src/modules/chats/screens/chats.screen.tsx
  7. 267
      src/modules/chats/screens/create-conversation.screen.tsx
  8. 1
      src/modules/chats/screens/index.ts
  9. 3
      src/modules/chats/smart-components/chats-list.smart-component.tsx
  10. 7
      src/modules/root/navigation-groups/users.group.tsx
  11. 1
      src/shared/enums/route-key.enum.ts

BIN
android/app/src/main/assets/fonts/fontello.ttf

Binary file not shown.

44
ios/Podfile.lock

@ -409,9 +409,9 @@ PODS: @@ -409,9 +409,9 @@ PODS:
- react-native-config/App (1.5.1):
- React-Core
- react-native-config/Extension (1.5.1)
- react-native-date-picker (4.3.5):
- react-native-date-picker (4.3.6):
- React-Core
- react-native-document-picker (9.1.0):
- react-native-document-picker (9.1.1):
- React-Core
- react-native-html-to-pdf (0.12.0):
- React-Core
@ -427,9 +427,11 @@ PODS: @@ -427,9 +427,11 @@ PODS:
- React-Core
- react-native-print (0.10.0):
- React-Core
- react-native-receive-sharing-intent (2.0.0):
- React-Core
- react-native-restart (0.0.27):
- React-Core
- react-native-safe-area-context (4.8.1):
- react-native-safe-area-context (4.9.0):
- React-Core
- react-native-splash-screen (3.3.0):
- React-Core
@ -562,12 +564,14 @@ PODS: @@ -562,12 +564,14 @@ PODS:
- React-Core
- RNAudioRecorderPlayer (3.6.6):
- React-Core
- RNCAsyncStorage (1.21.0):
- RNCAsyncStorage (1.22.1):
- React-Core
- RNCClipboard (1.5.1):
- React-Core
- RNCPicker (2.6.1):
- React-Core
- RNDateTimePicker (7.6.2):
- React-Core
- RNDeviceInfo (10.12.0):
- React-Core
- RNFastImage (8.6.3):
@ -578,15 +582,15 @@ PODS: @@ -578,15 +582,15 @@ PODS:
- React-Core
- RNFS (2.20.0):
- React-Core
- RNGestureHandler (2.14.0):
- RNGestureHandler (2.15.0):
- RCT-Folly (= 2021.07.22.00)
- React-Core
- RNImageCropPicker (0.40.2):
- RNImageCropPicker (0.40.3):
- React-Core
- React-RCTImage
- RNImageCropPicker/QBImagePickerController (= 0.40.2)
- RNImageCropPicker/QBImagePickerController (= 0.40.3)
- TOCropViewController
- RNImageCropPicker/QBImagePickerController (0.40.2):
- RNImageCropPicker/QBImagePickerController (0.40.3):
- React-Core
- React-RCTImage
- TOCropViewController
@ -599,7 +603,7 @@ PODS: @@ -599,7 +603,7 @@ PODS:
- React
- RNPermissions (3.10.1):
- React-Core
- RNReanimated (3.6.1):
- RNReanimated (3.7.1):
- RCT-Folly (= 2021.07.22.00)
- React-Core
- ReactCommon/turbomodule/core
@ -686,6 +690,7 @@ DEPENDENCIES: @@ -686,6 +690,7 @@ DEPENDENCIES:
- react-native-onesignal (from `../node_modules/react-native-onesignal`)
- react-native-pager-view (from `../node_modules/react-native-pager-view`)
- react-native-print (from `../node_modules/react-native-print`)
- react-native-receive-sharing-intent (from `../node_modules/react-native-receive-sharing-intent`)
- react-native-restart (from `../node_modules/react-native-restart`)
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- react-native-splash-screen (from `../node_modules/react-native-splash-screen`)
@ -716,6 +721,7 @@ DEPENDENCIES: @@ -716,6 +721,7 @@ DEPENDENCIES:
- "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)"
- "RNCClipboard (from `../node_modules/@react-native-community/clipboard`)"
- "RNCPicker (from `../node_modules/@react-native-picker/picker`)"
- "RNDateTimePicker (from `../node_modules/@react-native-community/datetimepicker`)"
- RNDeviceInfo (from `../node_modules/react-native-device-info`)
- RNFastImage (from `../node_modules/react-native-fast-image`)
- RNFileViewer (from `../node_modules/react-native-file-viewer`)
@ -822,6 +828,8 @@ EXTERNAL SOURCES: @@ -822,6 +828,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-pager-view"
react-native-print:
:path: "../node_modules/react-native-print"
react-native-receive-sharing-intent:
:path: "../node_modules/react-native-receive-sharing-intent"
react-native-restart:
:path: "../node_modules/react-native-restart"
react-native-safe-area-context:
@ -882,6 +890,8 @@ EXTERNAL SOURCES: @@ -882,6 +890,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/@react-native-community/clipboard"
RNCPicker:
:path: "../node_modules/@react-native-picker/picker"
RNDateTimePicker:
:path: "../node_modules/@react-native-community/datetimepicker"
RNDeviceInfo:
:path: "../node_modules/react-native-device-info"
RNFastImage:
@ -956,16 +966,17 @@ SPEC CHECKSUMS: @@ -956,16 +966,17 @@ SPEC CHECKSUMS:
React-logger: dc3a2b174d79c2da635059212747d8d929b54e06
react-native-cameraroll: 4701ae7c3dbcd3f5e9e150ca17f250a276154b35
react-native-config: 86038147314e2e6d10ea9972022aa171e6b1d4d8
react-native-date-picker: 90d1d60802a20085125657940b944f2bb4e5c113
react-native-document-picker: b4f4a23b73f864ce17965b284c0757648993805b
react-native-date-picker: c28ccf1b3bc3de3bc6a785792a393fee49677f89
react-native-document-picker: 3599b238843369026201d2ef466df53f77ae0452
react-native-html-to-pdf: 4c5c6e26819fe202971061594058877aa9b25265
react-native-image-picker: 3269f75c251cdcd61ab51b911dd30d6fff8c6169
react-native-netinfo: 48c5f79a84fbc3ba1d28a8b0d04adeda72885fa8
react-native-onesignal: ab800900cffeca4d9db70a05244013fc8a36ceb8
react-native-pager-view: e26d35e382d86950c936f8917e3beb9188115ccc
react-native-print: 1ae7a4ce4bf673b975f2ec9c4e00ad0c9b60e8aa
react-native-receive-sharing-intent: 62ab28c50e6ae56d32b9e841d7452091312a0bc7
react-native-restart: 7595693413fe3ca15893702f2c8306c62a708162
react-native-safe-area-context: cd1169d797a2ef722a00bfc5af10748d5b6c94f9
react-native-safe-area-context: b97eb6f9e3b7f437806c2ce5983f479f8eb5de4b
react-native-splash-screen: 4312f786b13a81b5169ef346d76d33bc0c6dc457
react-native-sqlite-storage: f6d515e1c446d1e6d026aa5352908a25d4de3261
react-native-video: c26780b224543c62d5e1b2a7244a5cd1b50e8253
@ -991,19 +1002,20 @@ SPEC CHECKSUMS: @@ -991,19 +1002,20 @@ SPEC CHECKSUMS:
ReactNativeExceptionHandler: b11ff67c78802b2f62eed0e10e75cb1ef7947c60
rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba
RNAudioRecorderPlayer: f790fc1afb118552ae6285d60adde52ee6b5d9ef
RNCAsyncStorage: 618d03a5f52fbccb3d7010076bc54712844c18ef
RNCAsyncStorage: 7deab901e27d1f989a83e8be6ce91b673772c848
RNCClipboard: 41d8d918092ae8e676f18adada19104fa3e68495
RNCPicker: b18aaf30df596e9b1738e7c1f9ee55402a229dca
RNDateTimePicker: fc2e4f2795877d45e84d85659bebe627eba5c931
RNDeviceInfo: db5c64a060e66e5db3102d041ebe3ef307a85120
RNFastImage: 5c9c9fed9c076e521b3f509fe79e790418a544e8
RNFileViewer: ce7ca3ac370e18554d35d6355cffd7c30437c592
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
RNGestureHandler: 32a01c29ecc9bb0b5bf7bc0a33547f61b4dc2741
RNImageCropPicker: d9616a0cb9b72e8551ff94a7a5021fbd29050aa5
RNGestureHandler: 7909c50383a18f0cb10ce1db7262b9a6da504c03
RNImageCropPicker: e7ab6fb43d2fc3e84651e786ef4a080d63b0ed3d
RNNotifee: 8e2d3df3f0e9ce8f5d1fe4c967431138190b6175
RNPDF: 8526c7210ff375c29d2461c51945e2f5480f7b60
RNPermissions: 0a4aa6c2f46c2cd55fbfa095bcdbad20118ea46f
RNReanimated: fdbaa9c964bbab7fac50c90862b6cc5f041679b9
RNReanimated: 43675f1f0e704abe8ebf953fd79b00e66302cda2
RNScreens: 3c5b9f4a9dcde752466854b6109b79c0e205dad3
RNShare: 32e97adc8d8c97d4a26bcdd3c45516882184f8b6
RNSoundLevel: c031ed233382b6aeabe44b3d5e895b906e69952f

31931
package-lock.json generated

File diff suppressed because it is too large Load Diff

BIN
src/assets/fonts/fontello.ttf

Binary file not shown.

14
src/config/fontello.json

@ -1055,6 +1055,20 @@ @@ -1055,6 +1055,20 @@
"search": [
"copy"
]
},
{
"uid": "d1ca8ed077d0662c711ebc58ef5821b2",
"css": "group-conversation",
"code": 59484,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M1275 561.1C1270.6 564.4 1265.7 566.8 1260.4 568.1 1255.1 569.5 1249.5 569.8 1244.1 569 1238.7 568.3 1233.5 566.4 1228.8 563.6 1224.1 560.9 1220 557.2 1216.7 552.8 1191.6 519 1158.9 491.6 1121.2 472.8 1083.6 454 1042.1 444.3 1000 444.5 991.8 444.5 983.8 442 977 437.5 970.2 433 964.8 426.5 961.6 419 959.5 413.9 958.4 408.4 958.4 402.8 958.4 397.2 959.5 391.7 961.6 386.6 964.8 379 970.2 372.6 977 368.1 983.8 363.5 991.8 361.1 1000 361.1 1023.4 361.1 1046.3 354.6 1066.1 342.2 1086 329.8 1102 312.1 1112.2 291.1 1122.5 270.2 1126.7 246.7 1124.4 223.4 1122 200.2 1113.1 178.1 1098.8 159.6 1084.5 141.1 1065.3 127 1043.4 118.9 1021.4 110.8 997.7 109 974.8 113.7 951.9 118.4 930.8 129.5 913.8 145.6 896.9 161.7 884.8 182.2 879 204.9 877.6 210.2 875.2 215.2 871.9 219.5 868.6 223.9 864.5 227.6 859.8 230.4 855.1 233.1 849.9 235 844.4 235.7 839 236.5 833.5 236.2 828.2 234.8 822.9 233.5 817.9 231.1 813.5 227.8 809.2 224.5 805.5 220.3 802.7 215.6 799.9 210.9 798.1 205.7 797.3 200.3 796.6 194.9 796.9 189.3 798.2 184 806.4 152.6 821.7 123.6 843 99.2 864.3 74.7 891.1 55.6 921.1 43.3 951.1 31.1 983.5 26 1015.9 28.4 1048.2 30.9 1079.5 40.9 1107.3 57.6 1135.1 74.3 1158.6 97.3 1175.9 124.6 1193.3 152 1204 183.1 1207.2 215.3 1210.5 247.6 1206.2 280.2 1194.6 310.5 1183 340.8 1164.5 367.9 1140.6 389.8 1197.3 414.3 1246.5 453.3 1283.5 502.7 1286.8 507.1 1289.2 512.1 1290.5 517.4 1291.9 522.7 1292.2 528.3 1291.4 533.7 1290.6 539.1 1288.7 544.3 1285.9 549 1283.1 553.7 1279.4 557.9 1275 561.1ZM994.4 882C997.4 886.7 999.4 892 1000.3 897.5 1001.3 903.1 1001 908.8 999.7 914.2 998.4 919.7 995.9 924.8 992.6 929.3 989.2 933.8 984.9 937.6 980.1 940.4 975.2 943.2 969.8 945 964.3 945.7 958.7 946.3 953 945.9 947.6 944.3 942.2 942.8 937.2 940.1 932.8 936.6 928.5 933 924.9 928.6 922.3 923.6 896.1 879.2 858.7 842.3 813.9 816.8 769 791.2 718.3 777.7 666.7 777.7 615.1 777.7 564.3 791.2 519.5 816.8 474.7 842.3 437.3 879.2 411.1 923.6 408.5 928.6 404.9 933 400.5 936.6 396.2 940.1 391.1 942.8 385.7 944.3 380.3 945.9 374.7 946.3 369.1 945.7 363.5 945 358.2 943.2 353.3 940.4 348.4 937.6 344.2 933.8 340.8 929.3 337.4 924.8 335 919.7 333.7 914.2 332.3 908.8 332.1 903.1 333 897.5 333.9 892 336 886.7 339 882 379.4 812.5 441 757.9 514.7 726.1 473.2 694.4 442.7 650.4 427.5 600.4 412.3 550.4 413.1 496.9 429.9 447.4 446.7 397.9 478.5 354.9 521 324.4 563.5 294 614.4 277.6 666.7 277.6 718.9 277.6 769.9 294 812.4 324.4 854.8 354.9 886.7 397.9 903.5 447.4 920.2 496.9 921.1 550.4 905.9 600.4 890.7 650.4 860.2 694.4 818.7 726.1 892.4 757.9 954 812.5 994.4 882ZM666.7 694.5C699.6 694.5 731.9 684.7 759.3 666.4 786.7 648 808.1 622 820.7 591.6 833.3 561.1 836.6 527.6 830.1 495.3 823.7 462.9 807.8 433.2 784.5 409.9 761.2 386.6 731.5 370.8 699.2 364.3 666.9 357.9 633.4 361.2 602.9 373.8 572.5 386.4 546.4 407.8 528.1 435.2 509.8 462.6 500 494.8 500 527.8 500 572 517.6 614.4 548.8 645.6 580.1 676.9 622.5 694.5 666.7 694.5ZM375 402.8C375 391.7 370.6 381.1 362.8 373.3 355 365.5 344.4 361.1 333.3 361.1 310 361.1 287.1 354.6 267.2 342.2 247.4 329.8 231.4 312.1 221.1 291.1 210.8 270.2 206.6 246.7 209 223.4 211.4 200.2 220.2 178.1 234.5 159.6 248.9 141.1 268.1 127 290 118.9 311.9 110.8 335.7 109 358.6 113.7 381.5 118.4 402.6 129.5 419.5 145.6 436.5 161.7 448.5 182.2 454.4 204.9 457.2 215.6 464.1 224.7 473.6 230.4 483.1 236 494.5 237.6 505.2 234.8 515.9 232.1 525 225.2 530.7 215.6 536.3 206.1 537.9 194.7 535.1 184 527 152.6 511.7 123.6 490.4 99.2 469 74.7 442.3 55.6 412.3 43.3 382.3 31.1 349.8 26 317.5 28.4 285.2 30.9 253.9 40.9 226.1 57.6 198.3 74.3 174.8 97.3 157.4 124.6 140.1 152 129.4 183.1 126.1 215.3 122.9 247.6 127.2 280.2 138.8 310.5 150.3 340.8 168.8 367.9 192.7 389.8 136.1 414.4 86.9 453.3 50 502.7 43.4 511.6 40.5 522.7 42.1 533.6 43.6 544.6 49.5 554.5 58.3 561.1 67.2 567.7 78.3 570.6 89.2 569 100.2 567.5 110 561.6 116.7 552.8 141.8 519 174.5 491.6 212.1 472.8 249.8 454 291.3 444.3 333.3 444.5 344.4 444.5 355 440.1 362.8 432.3 370.6 424.4 375 413.8 375 402.8Z",
"width": 1333
},
"search": [
"group-conversation"
]
}
]
}

52
src/modules/chats/screens/chats.screen.tsx

@ -1,62 +1,20 @@ @@ -1,62 +1,20 @@
import React, { FC } from 'react'
import {
IRouteParams,
IShortUser,
PrimaryHeader,
RouteKey,
ScreenLayout,
appEvents,
} from '@/shared'
import { IRouteParams, PrimaryHeader, RouteKey, ScreenLayout } from '@/shared'
import { HeaderRightBtn } from '../atoms'
import { SmartChatsList } from '../smart-components'
import { useSelector } from 'react-redux'
import { selectId } from '@/store/account'
import _ from 'lodash'
interface IProps extends IRouteParams {}
export const ChatsScreen: FC<IProps> = ({ navigation }) => {
const accountId = useSelector(selectId)
const checkSelectedUsersAndContinue = (selectedUsers: IShortUser[]) => {
if (_.isEmpty(selectedUsers))
appEvents.emit('openInfoModal', {
title: 'Виберіть учасників.',
message: 'Хоча б один користувач повинен бути вибраний',
onPressOk: () => {},
})
else navigation.navigate(RouteKey.CreateGroup)
}
const createChat = () => {
appEvents.emit('openActionSheet', {
items: [
{
name: 'Персональний',
onPress: () => navigation.navigate(RouteKey.CreatePersonal),
},
{
name: 'Груповий',
onPress: () =>
navigation.navigate(RouteKey.SelectUsersScreen, {
title: 'Нова група',
isLoading: false,
footerBtnTitle: 'Далі',
onSubmit: checkSelectedUsersAndContinue,
useChatBtnColors: true,
excludeIds: [accountId],
resetOnGoBack: true,
type: 'all',
}),
},
],
})
const onCreateConversation = () => {
navigation.navigate(RouteKey.CreateConversation)
}
const props = {
title: 'Бесіди',
rightComponent: <HeaderRightBtn onPress={createChat} />,
rightComponent: <HeaderRightBtn onPress={onCreateConversation} />,
}
return (
<ScreenLayout headerComponent={<PrimaryHeader {...props} />}>
<SmartChatsList />

267
src/modules/chats/screens/create-conversation.screen.tsx

@ -0,0 +1,267 @@ @@ -0,0 +1,267 @@
/* eslint-disable react/no-unstable-nested-components */
import React, { useCallback } from 'react'
import {
$size,
Avatar,
IShortUser,
IconComponent,
RouteKey,
ScreenLayout,
SearchForm,
Txt,
appEvents,
hasImageUrl,
useNav,
useTheme,
} from '@/shared'
import { useFetchUsersList } from '@/modules/users/hooks'
import {
TouchableOpacity,
StyleSheet,
FlatList,
ActivityIndicator,
Platform,
View,
} from 'react-native'
import { PartialTheme } from '@/shared/themes/interfaces'
import { chatManager } from '@/managers'
import { simpleDispatch } from '@/store/store-helpers'
import { SelectChat } from '@/store/chats'
import { useSelector } from 'react-redux'
import { selectAccount } from '@/store/account'
import _ from 'lodash'
export const CreateConversationScreen = () => {
const account = useSelector(selectAccount)
const nav = useNav()
const { styles, theme, themeTitle } = useTheme(createStyles)
const {
items,
searchString,
setSearchVal,
loadMore,
resetFlatList,
isLoading,
isLoadingNext,
} = useFetchUsersList({
type: 'all',
execludeUserId: [account.id],
})
const onPressMessage = async userId => {
try {
const chatId = await chatManager.getPersonalChatId({
userId,
})
simpleDispatch(new SelectChat({ id: chatId }))
chatManager.readChat.bind(chatManager)(chatId)
nav.navigate(RouteKey.Conversation)
} catch (e) {
appEvents.emit('openInfoModal', {
title: 'Сталась помилка!',
message: 'Спробуйте будь-ласка пізніше.',
onPressOk: () => {},
})
}
}
const checkSelectedUsersAndContinue = (selectedUsers: IShortUser[]) => {
if (_.isEmpty(selectedUsers))
appEvents.emit('openInfoModal', {
title: 'Виберіть учасників.',
message: 'Хоча б один користувач повинен бути вибраний',
onPressOk: () => {},
})
else nav.navigate(RouteKey.CreateGroup)
}
const onCreateGroupPress = () => {
nav.navigate(RouteKey.SelectUsersScreen, {
title: 'Нова група',
isLoading: false,
footerBtnTitle: 'Далі',
onSubmit: checkSelectedUsersAndContinue,
useChatBtnColors: true,
excludeIds: [account.id],
resetOnGoBack: true,
type: 'all',
})
}
const renderItem = useCallback(
({ item, index }: { item: IShortUser; index: number }) => {
return (
<TouchableOpacity
style={[
styles.container,
index === 0
? { borderTopColor: theme.$layoutBg }
: null,
]}
onPress={() => onPressMessage(item.id)}>
<Avatar
imageUrl={hasImageUrl(item.avatarUrl, item.fullName)}
maxHeight={$size(35, 32)}
maxWidth={$size(35, 32)}
textStyle={styles.avatarLabel}
/>
<Txt style={styles.userName}>{item.fullName}</Txt>
<IconComponent
name="chatcircledots-1"
size={24}
color="#9F2843"
/>
</TouchableOpacity>
)
},
[],
)
const renderFooter = useCallback(() => {
if (!isLoading && isLoadingNext)
return (
<ActivityIndicator
color={theme.$loaderPrimary}
style={{ marginTop: 20 }}
/>
)
else return null
}, [isLoading, isLoadingNext, theme])
const renderEmpty = useCallback(() => {
if (isLoading || isLoadingNext) {
return <ActivityIndicator color={theme.$loaderPrimary} />
} else {
return <Txt style={styles.emptyText}>Користувачі відсутні</Txt>
}
}, [isLoading, isLoadingNext])
const renderGroupChatHeader = useCallback(() => {
return (
<TouchableOpacity
style={styles.conversationContainer}
onPress={onCreateGroupPress}>
<View
style={[
styles.conversationIconContainer,
themeTitle === 'dark'
? styles.borderedIconContainer
: null,
]}>
<IconComponent
name="group-conversation"
color={theme.chats.header.rightIcon.$icon}
size={$size(18)}
/>
</View>
<Txt style={{ color: theme.$textPrimary }}>{'Нова група'}</Txt>
</TouchableOpacity>
)
}, [theme])
const keyExtractor = useCallback(item => `${item.id}`, [])
return (
<ScreenLayout
horizontalPadding={0}
header={{
goBack: nav.goBack,
title: 'Нова бесіда',
style: {
marginBottom: $size(20, 18),
paddingTop: $size(10, 10),
},
}}>
<>
<SearchForm
containerStyle={styles.searchContainer}
searchValue={searchString}
placeholder={'Знайдіть контакт'}
onChange={setSearchVal}
/>
<FlatList
style={{ flex: 1 }}
data={items}
renderItem={renderItem}
contentContainerStyle={{ paddingHorizontal: $size(16) }}
keyExtractor={keyExtractor}
initialNumToRender={10}
onEndReachedThreshold={0.4}
refreshing={Platform.select({
ios: false,
android: isLoading,
})}
onEndReached={loadMore}
onRefresh={resetFlatList}
showsVerticalScrollIndicator={false}
showsHorizontalScrollIndicator={false}
ListEmptyComponent={renderEmpty}
ListFooterComponent={renderFooter}
ListHeaderComponent={renderGroupChatHeader}
/>
</>
</ScreenLayout>
)
}
const createStyles = (theme: PartialTheme) =>
StyleSheet.create({
container: {
flexDirection: 'row',
alignItems: 'center',
height: $size(65, 60),
borderTopWidth: 0.3,
borderTopColor: theme.$border,
},
userName: {
fontSize: $size(16, 14),
fontWeight: '400',
marginLeft: $size(20, 16),
marginRight: 'auto',
color: theme.$textPrimary,
},
checkBox: {
position: 'absolute',
right: 0,
alignItems: 'center',
justifyContent: 'center',
},
searchContainer: {
borderBottomWidth: 0,
},
conversationContainer: {
flexDirection: 'row',
justifyContent: 'flex-start',
alignItems: 'center',
height: $size(50),
gap: $size(10),
borderRadius: $size(10),
backgroundColor: theme.chats.$elementsBg,
paddingHorizontal: $size(16),
marginVertical: $size(5),
},
conversationIconContainer: {
alignItems: 'center',
justifyContent: 'center',
backgroundColor: theme.chats.header.rightIcon.$bg,
width: $size(32),
height: $size(32),
borderRadius: $size(16),
},
borderedIconContainer: {
borderWidth: 1,
borderColor: theme.chats.header.rightIcon.$border,
},
avatarLabel: {
fontSize: $size(20, 18),
fontWeight: '500',
},
})

1
src/modules/chats/screens/index.ts

@ -4,3 +4,4 @@ export * from './create-group.screen' @@ -4,3 +4,4 @@ export * from './create-group.screen'
export * from './forward-message.screen'
export * from './send-shared-files.screen'
export * from './create-personal.screen'
export * from './create-conversation.screen'

3
src/modules/chats/smart-components/chats-list.smart-component.tsx

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
import React, { FC, useCallback } from 'react'
import { $size, appEvents, IChat, RouteKey, StorageKey } from '@/shared'
import { $size, appEvents, IChat, RouteKey } from '@/shared'
import { SearchForm } from '@/shared/components/forms'
import { useTheme } from '@/shared/hooks/use-theme.hook'
import { SelectChat } from '@/store/chats'
@ -45,7 +45,6 @@ export const SmartChatsList: FC = () => { @@ -45,7 +45,6 @@ export const SmartChatsList: FC = () => {
})
chatManager.readChat.bind(chatManager)(item.id)
navigate(RouteKey.Conversation)
}

7
src/modules/root/navigation-groups/users.group.tsx

@ -21,6 +21,7 @@ import { ChatConversation } from '@/modules/chats/screens/chat' @@ -21,6 +21,7 @@ import { ChatConversation } from '@/modules/chats/screens/chat'
import { Comments } from '@/modules/comments/screens/comments.screen'
import {
CreateChatScreen,
CreateConversationScreen,
CreatePersonalScreen,
ForwardMessageScreen,
GroupChatDetailScreen,
@ -61,16 +62,18 @@ export const UsersGroup: FC = () => ( @@ -61,16 +62,18 @@ export const UsersGroup: FC = () => (
name={RouteKey.GroupChatDetail}
component={GroupChatDetailScreen}
/>
<Stack.Screen
name={RouteKey.CreateConversation}
component={CreateConversationScreen}
/>
<Stack.Screen
name={RouteKey.CreateGroup}
component={CreateChatScreen}
/>
<Stack.Screen
name={RouteKey.CreatePersonal}
component={CreatePersonalScreen}
/>
<Stack.Screen
name={RouteKey.ForwardMessage}
component={ForwardMessageScreen}

1
src/shared/enums/route-key.enum.ts

@ -29,6 +29,7 @@ export enum RouteKey { @@ -29,6 +29,7 @@ export enum RouteKey {
SelectChatBg = 'SelectChatBg',
Group = 'Group',
CreateConversation = 'CreateConversation',
CreateGroup = 'CreateGroup',
CreatePersonal = 'CreatePersonal',
GroupChatDetail = 'GroupChatDetail',

Loading…
Cancel
Save