Browse Source

FIX | Copy img message & fixes

merge-requests/292/head
Vitalik 3 years ago
parent
commit
4621aea4c9
  1. 8
      android/app/agconnect-services.json
  2. 2
      android/app/build.gradle
  3. 3
      android/app/src/main/java/com/taskme/MainActivity.java
  4. 1
      android/app/src/main/java/com/taskme/MainApplication.java
  5. 2
      android/settings.gradle
  6. 2
      ios/Podfile.lock
  7. 4
      ios/taskme.xcodeproj/project.pbxproj
  8. 1
      src/api/auth/requests.ts
  9. 8
      src/api/chat-messages/requests.ts
  10. 6
      src/modules/account/validations/edit-account.validator.ts
  11. 129
      src/modules/chats/components/chat-send-img-modal.compoennt.tsx
  12. 2
      src/modules/chats/hooks/use-chat-messages.hook.ts
  13. 8
      src/modules/chats/hooks/use-chats-list.hook.ts
  14. 9
      src/modules/chats/hooks/use-create-text-message.hook.ts
  15. 2
      src/modules/comments/components/comments-footer.tsx
  16. 13
      src/modules/contacts/hooks/use-fetch-contacts.hook.ts
  17. 2
      src/modules/groups/components/groups-list.component.tsx
  18. 348
      src/modules/media/smart-components/record-audio-modal.smart-component.tsx
  19. 7
      src/modules/root/index.tsx
  20. 1
      src/modules/root/smart-components/modal-picker.smart-component.tsx
  21. 1
      src/modules/tasks/config/task-card-icons.config.ts
  22. 5
      src/modules/tasks/hooks/index.ts
  23. 42
      src/modules/tasks/hooks/use-fetch-group-tasks.hook.ts
  24. 53
      src/modules/tasks/hooks/use-fetch-my-tasks.hook.ts
  25. 4
      src/modules/tasks/hooks/use-fetch-tasks-by-filter.hook.ts
  26. 50
      src/modules/tasks/hooks/use-fetch-user-tasks.hook.ts
  27. 6
      src/modules/tasks/hooks/use-task-actions.hook.ts
  28. 9
      src/modules/tasks/hooks/use-task-filter.hook.ts
  29. 27
      src/modules/tasks/hooks/use-task-list-events.hook.ts
  30. 1
      src/modules/tasks/hooks/use-tasks-print.hook.ts
  31. 32
      src/modules/tasks/screens/filter-tasks-result.screen.tsx
  32. 3
      src/modules/tasks/screens/my-tasks.screen.tsx
  33. 1
      src/modules/tasks/screens/print-tasks.screen.tsx
  34. 6
      src/modules/tasks/validations/create-task.validations.ts
  35. 5
      src/services/domain/auth.service.ts
  36. 11
      src/services/system/fs.service.ts
  37. 3
      src/services/system/real-time.service.ts
  38. 19
      src/shared/components/plugins/chat/chat-bar.component.tsx
  39. 2
      src/shared/components/tools/keyboard-spacer.component.tsx
  40. 2
      src/shared/helpers/fs.helpers.ts
  41. 1
      src/store/shared/reducer.ts

8
android/app/agconnect-services.json

@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
"project_id":"99536292102144353",
"app_id":"105896531",
"api_key":"DAEDAMe2g0hAuXPDcOWX/VjzI9nScUzYz9mqg91UlGpseX11V5bNprMJPD5dVXxZOvZ5uThxc8vSZlkf3ki4nzMZ46mB/ek7pYdPcA==",
"package_name":"com.taskme2"
"package_name":"com.taskme"
},
"oauth_client":{
"client_id":"105896531",
@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
},
"app_info":{
"app_id":"105896531",
"package_name":"com.taskme2"
"package_name":"com.taskme"
},
"service":{
"analytics":{
@ -57,12 +57,12 @@ @@ -57,12 +57,12 @@
"configuration_version":"3.0",
"appInfos":[
{
"package_name":"com.taskme2",
"package_name":"com.taskme",
"client":{
"app_id":"105896531"
},
"app_info":{
"package_name":"com.taskme2",
"package_name":"com.taskme",
"app_id":"105896531"
},
"oauth_client":{

2
android/app/build.gradle

@ -32,7 +32,7 @@ android { @@ -32,7 +32,7 @@ android {
}
defaultConfig {
applicationId "com.taskme2"
applicationId "com.taskme"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 8

3
android/app/src/main/java/com/taskme/MainActivity.java

@ -3,8 +3,7 @@ package com.taskme; @@ -3,8 +3,7 @@ package com.taskme;
import android.os.Bundle;
import com.facebook.react.ReactActivity;
// react-native-splash-screen >= 0.3.1
import org.devio.rn.splashscreen.SplashScreen; // here
import org.devio.rn.splashscreen.SplashScreen;
import android.content.Intent;
import android.content.res.Configuration;

1
android/app/src/main/java/com/taskme/MainApplication.java

@ -6,7 +6,6 @@ import com.facebook.react.PackageList; @@ -6,7 +6,6 @@ import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.rnfs.RNFSPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;

2
android/settings.gradle

@ -1,6 +1,8 @@ @@ -1,6 +1,8 @@
rootProject.name = 'taskme'
include ':react-native-fs'
project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android')
include ':react-native-fs'
project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android')
include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')
include ':react-native-splash-screen'

2
ios/Podfile.lock

@ -661,7 +661,7 @@ SPEC CHECKSUMS: @@ -661,7 +661,7 @@ SPEC CHECKSUMS:
RNPermissions: bf844d392fe0ecbfbd2e4ae2b88cc32f2f09b369
RNReanimated: 58e7b950e0172235ff8296dd39ec145f9577e301
RNScreens: eb0dfb2d6b21d2d7f980ad46b14eb306d2f1062e
RNSoundLevel: 3dd5d2f6431e47f806233600936deb636a0d9800
RNSoundLevel: a02f3bfbb81aeec256de4e41d7fc967b32e3faf1
RNSVG: 8ba35cbeb385a52fd960fd28db9d7d18b4c2974f
RNVectorIcons: f67a1abce2ec73e62fe4606e8110e95a832bc859
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d

4
ios/taskme.xcodeproj/project.pbxproj

@ -764,7 +764,7 @@ @@ -764,7 +764,7 @@
CODE_SIGN_ENTITLEMENTS = taskme/taskme.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 92;
CURRENT_PROJECT_VERSION = 95;
DEVELOPMENT_TEAM = HQ3J3TDPR2;
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
@ -802,7 +802,7 @@ @@ -802,7 +802,7 @@
CODE_SIGN_ENTITLEMENTS = taskme/taskme.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 92;
CURRENT_PROJECT_VERSION = 95;
DEVELOPMENT_TEAM = HQ3J3TDPR2;
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";

1
src/api/auth/requests.ts

@ -23,7 +23,6 @@ export const finishLogin = ( @@ -23,7 +23,6 @@ export const finishLogin = (
export const resetSessionReq = (
params: IRefreshTokenPayload,
): ApiResponse<IAuthSuccessResponse> => {
console.log('reset start')
return http.post<IAuthSuccessResponse>('auth/refresh-token', params)
}

8
src/api/chat-messages/requests.ts

@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
import { prepareFormData } from './../../shared/helpers/fs.helpers';
import { prepareFormData } from './../../shared/helpers/fs.helpers'
import { ApiResponse } from '../http.types'
import * as req from './requests.interfaces'
import * as res from './responses.interfaces'
import http from '../http.service'
import { convertToFormData } from '@/shared/helpers/api.helpers'
export const getChatMessagesListReq = (
params: { params: req.IFetchChatMessages },
): ApiResponse<res.IFetchChatMessagesList> => {
export const getChatMessagesListReq = (params: {
params: req.IFetchChatMessages
}): ApiResponse<res.IFetchChatMessagesList> => {
return http.get<res.IFetchChatMessagesList>('chats-messages', params)
}

6
src/modules/account/validations/edit-account.validator.ts

@ -2,18 +2,12 @@ import _ from 'lodash' @@ -2,18 +2,12 @@ import _ from 'lodash'
import moment from 'moment'
import validate from 'validate.js'
// Here is a sample implementation using moment.js
validate.extend(validate.validators.datetime, {
// The value is guaranteed not to be null or undefined but otherwise it
// could be anything.
parse: function (value, options) {
console.log('parse', value, +moment.utc(value))
return +moment.utc(value)
},
// Input is a unix timestamp
format: function (value, options) {
var format = options.dateOnly ? 'YYYY-MM-DD' : 'YYYY-MM-DD hh:mm:ss'
console.log('format', value, moment.utc(value).format(format))
return moment.utc(value).format(format)
},
})

129
src/modules/chats/components/chat-send-img-modal.compoennt.tsx

@ -1,85 +1,86 @@ @@ -1,85 +1,86 @@
import {
$size,
BottomModal,
Button,
useEventsListener,
useTheme,
$size,
BottomModal,
Button,
useEventsListener,
useTheme,
} from '@/shared'
import { PartialTheme } from '@/shared/themes/interfaces'
import React, { FC, useRef, useState } from 'react'
import { StyleSheet } from 'react-native'
import React, { FC, useEffect, useRef, useState } from 'react'
import { Image, StyleSheet } from 'react-native'
import RBSheet from 'react-native-raw-bottom-sheet'
import FastImage from 'react-native-fast-image'
import { fsService } from '@/services/system'
interface ChatSendImgModalSettings {
onSend: () => void
onSend: () => void
}
export const ChatSendImgModal: FC = () => {
const { styles } = useTheme(createStyles)
const { styles } = useTheme(createStyles)
const [imgUrl, setImgUrl] = useState('')
const [imgUrl, setImgUrl] = useState('')
const sheetRef = useRef<RBSheet>()
const settingsRef = useRef<ChatSendImgModalSettings>({
onSend: null,
})
const sheetRef = useRef<RBSheet>()
const settingsRef = useRef<ChatSendImgModalSettings>({
onSend: null,
})
useEventsListener(
'chatSendImgModal',
data => {
sheetRef.current.open()
try {
settingsRef.current.onSend = data.onSend
setImgUrl(data.url)
} catch (err) {
console.log('APP-EVENT chatSendImgModal ERR: ', err)
}
},
[sheetRef.current, settingsRef.current],
)
useEventsListener(
'chatSendImgModal',
data => {
sheetRef.current.open()
try {
settingsRef.current.onSend = data.onSend
setImgUrl(data.url)
} catch (err) {
console.log('APP-EVENT chatSendImgModal ERR: ', err)
}
},
[sheetRef.current, settingsRef.current],
)
const onSend = () => {
settingsRef.current.onSend()
sheetRef.current.close()
}
const onSend = () => {
settingsRef.current.onSend()
sheetRef.current.close()
}
const onCancel = () => {
sheetRef.current.close()
}
const onCancel = () => {
sheetRef.current.close()
}
return (
<BottomModal
sheetRef={ref => (sheetRef.current = ref)}
height={$size(400, 300)}
containerStyle={styles.container}>
<FastImage
source={{ uri: imgUrl }}
style={styles.img}
resizeMode="contain"
/>
return (
<BottomModal
sheetRef={ref => (sheetRef.current = ref)}
height={$size(400, 300)}
containerStyle={styles.container}>
<FastImage
source={{ uri: imgUrl }}
style={styles.img}
resizeMode="contain"
/>
<Button
title={'Надiслати фото'}
type={'border'}
style={styles.sendBtn}
onPress={onSend}
/>
<Button
title={'Надiслати фото'}
type={'border'}
style={styles.sendBtn}
onPress={onSend}
/>
<Button title={'Скасувати'} onPress={onCancel} />
</BottomModal>
)
<Button title={'Скасувати'} onPress={onCancel} />
</BottomModal>
)
}
const createStyles = (theme: PartialTheme) =>
StyleSheet.create({
container: {},
img: {
height: '60%',
width: '100%',
marginBottom: $size(15),
},
sendBtn: {
marginBottom: $size(15),
},
})
StyleSheet.create({
container: {},
img: {
height: '60%',
width: '100%',
marginBottom: $size(15),
},
sendBtn: {
marginBottom: $size(15),
},
})

2
src/modules/chats/hooks/use-chat-messages.hook.ts

@ -134,7 +134,6 @@ export const useChatMessages = ( @@ -134,7 +134,6 @@ export const useChatMessages = (
fileUrl: message.content?.fileUrl,
fileName: message.content?.name,
})
console.log('FILE DOWNLOADED!')
appEvents.emit('openInfoModal', {
title: 'Файл успішно завантажено!',
message: path,
@ -334,7 +333,6 @@ export const useChatMessages = ( @@ -334,7 +333,6 @@ export const useChatMessages = (
}
const onChatIsRead = (data: { chatId: number; userId: number }) => {
console.log(Number(data?.chatId) !== chatId, data?.userId === accountId)
if (Number(data?.chatId) !== chatId || data?.userId === accountId)
return

8
src/modules/chats/hooks/use-chats-list.hook.ts

@ -6,7 +6,6 @@ import { @@ -6,7 +6,6 @@ import {
ChatType,
IChat,
IChatMessage,
isAndroid,
RouteKey,
useEventsListener,
useFlatList,
@ -30,7 +29,6 @@ import { @@ -30,7 +29,6 @@ import {
setChatUnreadReq,
unfixChatReq,
} from '@/api'
import RNFS from 'react-native-fs'
import { Buffer } from 'buffer'
import { fsService } from '@/services/system'
@ -287,7 +285,6 @@ export const useChatList = () => { @@ -287,7 +285,6 @@ export const useChatList = () => {
content: buffString,
fileName: data.fileName,
})
console.log('FILE WRITTEN!')
appEvents.emit('openInfoModal', {
title: 'Файл успішно завантажено!',
message: path,
@ -399,10 +396,7 @@ export const useChatList = () => { @@ -399,10 +396,7 @@ export const useChatList = () => {
chats: chats as IChat[],
searchString,
loadMore,
resetFlatList: () => {
console.log('refresh')
resetFlatList()
},
resetFlatList: resetFlatList,
setSearchVal,
handleChatAction,
isLoading,

9
src/modules/chats/hooks/use-create-text-message.hook.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
import { isAndroid } from './../../../shared/helpers/platform.helper';
import { isAndroid } from './../../../shared/helpers/platform.helper'
import {
appEvents,
createFullName,
@ -16,6 +16,7 @@ import { ISendTextMessage } from '@/api/chat-messages/requests.interfaces' @@ -16,6 +16,7 @@ import { ISendTextMessage } from '@/api/chat-messages/requests.interfaces'
import { getLinksFromTxt, isImgUrl } from '@/shared/helpers'
import { fsService } from '@/services/system'
import { storeImageMessageReq } from '@/api'
import { Alert } from 'react-native'
interface IProps {
chatMembers: IChatMember[]
@ -68,9 +69,7 @@ export const useCreateTextMessage = ({ @@ -68,9 +69,7 @@ export const useCreateTextMessage = ({
const onSendCopyImg = async (fileUrl: string) => {
setSending(true)
const splitLink = fileUrl.split('/')
const fileName = splitLink[splitLink.length - 1].split('.')
const fileExt = fileName[fileName.length - 1]
const fileExt = fileUrl.split('.').pop()
try {
const filePath = await fsService.downloadFile({
@ -79,6 +78,7 @@ export const useCreateTextMessage = ({ @@ -79,6 +78,7 @@ export const useCreateTextMessage = ({
})
const fileStat = await fsService.getFileStat(filePath)
fileStat.type = 'image/png'
await storeImageMessageReq({
file: fileStat,
@ -117,6 +117,7 @@ export const useCreateTextMessage = ({ @@ -117,6 +117,7 @@ export const useCreateTextMessage = ({
chatMembers,
member => !member?.isDeleted && member?.userId !== accountId,
)
const allItems = usersCanMention.map(it => {
const { firstName, lastName, avatarUrl } = it?.user
const name = createFullName(firstName, lastName)

2
src/modules/comments/components/comments-footer.tsx

@ -8,8 +8,6 @@ import { SendButtonComments } from '@/modules/comments/atom' @@ -8,8 +8,6 @@ import { SendButtonComments } from '@/modules/comments/atom'
export const NewCommentMessageInput = (props: any) => {
const { styles } = useTheme(createStyles)
console.log(props)
return (
<InputToolbar
{...props}

13
src/modules/contacts/hooks/use-fetch-contacts.hook.ts

@ -4,7 +4,7 @@ import { IContact, useFlatList } from '@/shared' @@ -4,7 +4,7 @@ import { IContact, useFlatList } from '@/shared'
import { contactsService } from '@/services/domain'
export const useFetchContacts = () => {
const [searchString, setSearchVal] = useState<string>()
const [searchString, setSearchVal] = useState<string>(null)
const {
items: contacts,
@ -29,21 +29,14 @@ export const useFetchContacts = () => { @@ -29,21 +29,14 @@ export const useFetchContacts = () => {
loadParams: {
sort: 'ASC',
sortField: 'firstName',
searchString,
soonBirthday: false,
},
})
const setSearchString = (value: string) => {
setLoadParams({ searchString: value })
}
const setBirthday = value => {
setLoadParams({ soonBirthday: value })
}
const setBirthday = value => setLoadParams({ soonBirthday: value })
useEffect(() => {
setSearchString(searchString)
if (searchString !== null) setLoadParams({ searchString })
}, [searchString])
return {

2
src/modules/groups/components/groups-list.component.tsx

@ -32,7 +32,7 @@ export const GroupsList: FC<IProps> = ({ data, navigate }) => { @@ -32,7 +32,7 @@ export const GroupsList: FC<IProps> = ({ data, navigate }) => {
navigate(RouteKey.GroupTasks, { groupData: item })
}
onPressInfo={() =>
console.log('i press info', item.title)
navigate(RouteKey.GroupTasks, { groupData: item })
}
/>
)}

348
src/modules/media/smart-components/record-audio-modal.smart-component.tsx

@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
import {
$size,
BottomModal,
IconComponent,
Txt,
useEventsListener,
useTheme,
$size,
BottomModal,
IconComponent,
Txt,
useEventsListener,
useTheme,
} from '@/shared'
import { PartialTheme } from '@/shared/themes/interfaces'
import React, { FC, useEffect, useMemo, useRef, useState } from 'react'
@ -16,178 +16,176 @@ import Animated, * as RNReanimated from 'react-native-reanimated' @@ -16,178 +16,176 @@ import Animated, * as RNReanimated from 'react-native-reanimated'
import { mediaService } from '@/services/system'
import { RecordAudioModalSettings } from '../interfaces'
import {
DEF_DB_LVL,
DEF_VOLUME_INDICATOR_SIZE,
INITIAL_PLAY_TIME,
MAX_VOLUME_INDICATOR_SIZE,
DEF_DB_LVL,
DEF_VOLUME_INDICATOR_SIZE,
INITIAL_PLAY_TIME,
MAX_VOLUME_INDICATOR_SIZE,
} from '../consts'
export const RecordAudioModalSmart: FC = () => {
const { styles, theme } = useTheme(createStyles)
const [isRecording, setRecord] = useState<boolean>(false)
const [playTime, setPlayTime] = useState<string>(INITIAL_PLAY_TIME)
const [recordFilPath, setRecordFilePath] = useState<string>('')
const animationVal = RNReanimated.useSharedValue(DEF_DB_LVL)
const sheetRef = useRef<RBSheet | null>()
const settingsRef = useRef<RecordAudioModalSettings>({
send: null,
}).current
const animatedStyles = RNReanimated.useAnimatedStyle(() => {
const size = RNReanimated.interpolate(
animationVal.value,
[DEF_DB_LVL, 0],
[DEF_VOLUME_INDICATOR_SIZE, MAX_VOLUME_INDICATOR_SIZE],
)
return {
width: size,
height: size,
borderRadius: size / 2,
}
})
useEventsListener(
'openRecordVoiceModal',
data => {
sheetRef.current.open()
settingsRef.send = data.send
},
[sheetRef.current, settingsRef],
)
const onStartRecord = async () => {
setRecord(true)
RNSoundLevel.start()
await mediaService.onStartRecord()
mediaService.addRecordBackListener(({ currentPosition }) =>
setPlayTime(mediaService.formatRecordPlayTime(currentPosition)),
)
RNSoundLevel.onNewFrame = data => {
animationVal.value = RNReanimated.withSpring(data.value)
}
}
const onStopRecord = async () => {
setRecord(false)
RNReanimated.cancelAnimation(animationVal)
animationVal.value = RNReanimated.withSpring(DEF_DB_LVL)
RNSoundLevel.stop()
const path = await mediaService.onStopRecord()
setRecordFilePath(path)
}
const onClose = () => {
setPlayTime(INITIAL_PLAY_TIME)
onStopRecord()
}
const onCancel = () => {
setPlayTime(INITIAL_PLAY_TIME)
setRecordFilePath('')
}
const onConfirm = () => {
settingsRef?.send(recordFilPath)
sheetRef.current.close()
}
useEffect(() => {
console.log({ recordFilPath, BOOLLrecordFilPath: !recordFilPath })
}, [recordFilPath])
const timer = useMemo(() => <Txt>{playTime}</Txt>, [playTime])
return (
<BottomModal
sheetRef={ref => (sheetRef.current = ref)}
height={$size(200, 190)}
onClose={onClose}
containerStyle={styles.container}>
<Txt style={styles.title}>Запис повідомлення</Txt>
<View style={styles.actionsContainer}>
<TouchableOpacity disabled={isRecording} onPress={onCancel}>
<IconComponent
name="xcircle-1"
size={$size(23)}
color={theme?.chats?.message?.$btnSend}
/>
</TouchableOpacity>
<TouchableOpacity
style={styles.micContainer}
onPress={() =>
!isRecording ? onStartRecord() : onStopRecord()
}>
<View style={styles.micBtn}>
<IconComponent
name="microphone-1"
size={$size(23)}
color={theme?.chats?.message?.$btnSend}
/>
</View>
<Animated.View
style={[styles.micVolumeCircle, animatedStyles]}
/>
</TouchableOpacity>
<TouchableOpacity disabled={!recordFilPath || isRecording} onPress={onConfirm}>
<Svg width={$size(20)} height={$size(25)} fill="none">
<Path
d="M20.581 11.346 4.745 2.478a.75.75 0 0 0-1.072.906l2.987 8.364a.75.75 0 0 1 0 .504l-2.987 8.364a.75.75 0 0 0 1.072.907l15.836-8.868a.75.75 0 0 0 0-1.31v0ZM6.75 12h6"
stroke={theme?.chats?.message?.$btnSend}
strokeWidth={1.7}
strokeLinecap="round"
strokeLinejoin="round"
transform={`translate(${$size(1, 2)}, ${$size(
0.5,
1.5,
)}), scale(${$size(0.7, 0.85)})`}
/>
</Svg>
</TouchableOpacity>
</View>
<View>{timer}</View>
</BottomModal>
)
const { styles, theme } = useTheme(createStyles)
const [isRecording, setRecord] = useState<boolean>(false)
const [playTime, setPlayTime] = useState<string>(INITIAL_PLAY_TIME)
const [recordFilPath, setRecordFilePath] = useState<string>('')
const animationVal = RNReanimated.useSharedValue(DEF_DB_LVL)
const sheetRef = useRef<RBSheet | null>()
const settingsRef = useRef<RecordAudioModalSettings>({
send: null,
}).current
const animatedStyles = RNReanimated.useAnimatedStyle(() => {
const size = RNReanimated.interpolate(
animationVal.value,
[DEF_DB_LVL, 0],
[DEF_VOLUME_INDICATOR_SIZE, MAX_VOLUME_INDICATOR_SIZE],
)
return {
width: size,
height: size,
borderRadius: size / 2,
}
})
useEventsListener(
'openRecordVoiceModal',
data => {
sheetRef.current.open()
settingsRef.send = data.send
},
[sheetRef.current, settingsRef],
)
const onStartRecord = async () => {
setRecord(true)
RNSoundLevel.start()
await mediaService.onStartRecord()
mediaService.addRecordBackListener(({ currentPosition }) =>
setPlayTime(mediaService.formatRecordPlayTime(currentPosition)),
)
RNSoundLevel.onNewFrame = data => {
animationVal.value = RNReanimated.withSpring(data.value)
}
}
const onStopRecord = async () => {
setRecord(false)
RNReanimated.cancelAnimation(animationVal)
animationVal.value = RNReanimated.withSpring(DEF_DB_LVL)
RNSoundLevel.stop()
const path = await mediaService.onStopRecord()
setRecordFilePath(path)
}
const onClose = () => {
setPlayTime(INITIAL_PLAY_TIME)
onStopRecord()
}
const onCancel = () => {
setPlayTime(INITIAL_PLAY_TIME)
setRecordFilePath('')
}
const onConfirm = () => {
settingsRef?.send(recordFilPath)
sheetRef.current.close()
}
const timer = useMemo(() => <Txt>{playTime}</Txt>, [playTime])
return (
<BottomModal
sheetRef={ref => (sheetRef.current = ref)}
height={$size(200, 190)}
onClose={onClose}
containerStyle={styles.container}>
<Txt style={styles.title}>Запис повідомлення</Txt>
<View style={styles.actionsContainer}>
<TouchableOpacity disabled={isRecording} onPress={onCancel}>
<IconComponent
name="xcircle-1"
size={$size(23)}
color={theme?.chats?.message?.$btnSend}
/>
</TouchableOpacity>
<TouchableOpacity
style={styles.micContainer}
onPress={() =>
!isRecording ? onStartRecord() : onStopRecord()
}>
<View style={styles.micBtn}>
<IconComponent
name="microphone-1"
size={$size(23)}
color={theme?.chats?.message?.$btnSend}
/>
</View>
<Animated.View
style={[styles.micVolumeCircle, animatedStyles]}
/>
</TouchableOpacity>
<TouchableOpacity
disabled={!recordFilPath || isRecording}
onPress={onConfirm}>
<Svg width={$size(20)} height={$size(25)} fill="none">
<Path
d="M20.581 11.346 4.745 2.478a.75.75 0 0 0-1.072.906l2.987 8.364a.75.75 0 0 1 0 .504l-2.987 8.364a.75.75 0 0 0 1.072.907l15.836-8.868a.75.75 0 0 0 0-1.31v0ZM6.75 12h6"
stroke={theme?.chats?.message?.$btnSend}
strokeWidth={1.7}
strokeLinecap="round"
strokeLinejoin="round"
transform={`translate(${$size(1, 2)}, ${$size(
0.5,
1.5,
)}), scale(${$size(0.7, 0.85)})`}
/>
</Svg>
</TouchableOpacity>
</View>
<View>{timer}</View>
</BottomModal>
)
}
const createStyles = ({ chats: { sendVoiceMsg } }: PartialTheme) =>
StyleSheet.create({
container: {
width: '100%',
justifyContent: 'center',
alignItems: 'center',
},
title: {
top: $size(-35),
},
actionsContainer: {
width: '60%',
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
marginBottom: $size(25),
},
micContainer: {
alignItems: 'center',
justifyContent: 'center',
},
micBtn: {
alignItems: 'center',
justifyContent: 'center',
zIndex: 1,
width: $size(52),
height: $size(52),
backgroundColor: sendVoiceMsg.micBtn.$bg,
borderRadius: $size(62) / 2,
},
micVolumeCircle: {
position: 'absolute',
backgroundColor: sendVoiceMsg.micBtn.$border,
},
})
StyleSheet.create({
container: {
width: '100%',
justifyContent: 'center',
alignItems: 'center',
},
title: {
top: $size(-35),
},
actionsContainer: {
width: '60%',
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
marginBottom: $size(25),
},
micContainer: {
alignItems: 'center',
justifyContent: 'center',
},
micBtn: {
alignItems: 'center',
justifyContent: 'center',
zIndex: 1,
width: $size(52),
height: $size(52),
backgroundColor: sendVoiceMsg.micBtn.$bg,
borderRadius: $size(62) / 2,
},
micVolumeCircle: {
position: 'absolute',
backgroundColor: sendVoiceMsg.micBtn.$border,
},
})

7
src/modules/root/index.tsx

@ -63,7 +63,6 @@ export const Navigation: FC = () => { @@ -63,7 +63,6 @@ export const Navigation: FC = () => {
}
const internetConnectionHandler = () => {
console.log('isConnected', isConnected)
try {
if (!_.isBoolean(isConnected)) return
@ -78,7 +77,6 @@ export const Navigation: FC = () => { @@ -78,7 +77,6 @@ export const Navigation: FC = () => {
NavigationService.setModule(prevActiveModule)
} else handleAutoAuth()
} finally {
console.log('Init')
SplashScreen.hide()
}
}
@ -96,10 +94,7 @@ export const Navigation: FC = () => { @@ -96,10 +94,7 @@ export const Navigation: FC = () => {
[NavigationModuleKey.User]: <UsersGroup />,
}
const navigation = useMemo(() => {
console.log('ACTIVE MODULE', activeModule)
return modules[activeModule]
}, [activeModule])
const navigation = useMemo(() => modules[activeModule], [activeModule])
const GlobalComponents = useMemo(() => {
if (activeModule === NavigationModuleKey.User) {

1
src/modules/root/smart-components/modal-picker.smart-component.tsx

@ -27,7 +27,6 @@ export const ModalPickerSmartComponent: FC = () => { @@ -27,7 +27,6 @@ export const ModalPickerSmartComponent: FC = () => {
'openPickerModal',
data => {
try {
console.log('openPickerModal')
sheetRef.current.open()
settingsRef.current = {
callback: data.callback,

1
src/modules/tasks/config/task-card-icons.config.ts

@ -7,7 +7,6 @@ export interface IConfigData { @@ -7,7 +7,6 @@ export interface IConfigData {
}
export const getTaskCardIcons = (data?: IConfigData) => {
console.log({ data })
return [
{
icon: 'paperclip-1',

5
src/modules/tasks/hooks/index.ts

@ -1,9 +1,6 @@ @@ -1,9 +1,6 @@
export * from './use-task-details.hook'
export * from './use-fetch-task-executors.hook'
export * from './use-task-selector.hook'
export * from './use-fetch-user-tasks.hook'
export * from './use-fetch-my-tasks.hook'
export * from './use-fetch-group-tasks.hook'
export * from './use-task-actions.hook'
export * from './use-reasons.hook'
export * from './use-task-filter.hook'
@ -11,4 +8,4 @@ export * from './use-create-update-task.hook' @@ -11,4 +8,4 @@ export * from './use-create-update-task.hook'
export * from './use-change-task-executor.hook'
export * from './use-fetch-tasks-by-filter.hook'
export * from './use-task-list-events.hook'
export * from './use-select-task-executor.hook'
export * from './use-select-task-executor.hook'

42
src/modules/tasks/hooks/use-fetch-group-tasks.hook.ts

@ -1,42 +0,0 @@ @@ -1,42 +0,0 @@
import { ITaskPreview, useFlatList } from '@/shared'
import { tasksService } from '@/services/domain'
import { useEffect } from 'react'
import { ITaskPreviewResponse } from '@/api/tasks/responses.interface'
import { transformTasksInList } from '@/api/tasks/transform'
import { useTaskListEvents } from './use-task-list-events.hook'
export const useFetchGroupTasks = (groupId: number) => {
const {
items,
isLoading,
isLoadingNext,
loadMore,
resetFlatList,
_setItems,
} = useFlatList({
fetchItems: params => tasksService.getGroupTasks(groupId, params),
serrializatorItems: (items: ITaskPreviewResponse[]) =>
transformTasksInList(items),
needInit: true,
loadParams: {
sort: 'DESC',
sortField: 'id',
},
limit: 10,
})
useEffect(() => resetFlatList(), [groupId])
useTaskListEvents({
items,
onReload: () => resetFlatList(),
setItems: (items: ITaskPreview[]) => _setItems(items),
})
return {
items,
isLoading,
isLoadingNext,
loadMore,
}
}

53
src/modules/tasks/hooks/use-fetch-my-tasks.hook.ts

@ -1,53 +0,0 @@ @@ -1,53 +0,0 @@
import { createFullName, ITaskPreview, useFlatList } from '@/shared'
import { tasksService } from '@/services/domain'
import { useEffect } from 'react'
import { useSelector } from 'react-redux'
import { selectAccount } from '@/store/account'
import _ from 'lodash'
import { transformTasksInList } from '@/api/tasks/transform'
import { ITaskPreviewResponse } from '@/api/tasks/responses.interface'
import { useTaskListEvents } from './use-task-list-events.hook'
export const useFetchMyTasks = (
loadParams: { [key: string]: string | boolean },
limit: number,
) => {
const account = useSelector(selectAccount)
const shortAccount = {
id: account.id,
fullName: createFullName(account.info.firstName, account.info.lastName),
avatarUrl: account.info.avatarUrl,
}
const {
items: myTasks,
isLoading,
isLoadingNext,
loadMore,
resetFlatList,
_setItems,
} = useFlatList({
fetchItems: params => tasksService.getMyTasks(params),
serrializatorItems: (items: ITaskPreviewResponse[]) =>
transformTasksInList(items, shortAccount),
needInit: true,
loadParams,
limit,
})
useEffect(() => resetFlatList(), [])
useTaskListEvents({
items: myTasks,
onReload: () => resetFlatList(),
setItems: (items: ITaskPreview[]) => _setItems(items),
})
return {
myTasks,
isLoading,
isLoadingNext,
loadMore,
reloadTasks: resetFlatList
}
}

4
src/modules/tasks/hooks/use-fetch-tasks-by-filter.hook.ts

@ -52,14 +52,13 @@ export const useFetchTasksByFilter = ({ @@ -52,14 +52,13 @@ export const useFetchTasksByFilter = ({
const {
items,
loadParams,
isLoading,
isLoadingNext,
loadMore,
setLoadParams,
resetFlatList,
_setItems,
count
count,
} = useFlatList<ITaskPreview>({
fetchItems: params => tasksService.getTasks(params),
serrializatorItems: (items: ITaskPreviewResponse[]) =>
@ -91,6 +90,7 @@ export const useFetchTasksByFilter = ({ @@ -91,6 +90,7 @@ export const useFetchTasksByFilter = ({
onReload: () => resetFlatList(),
setItems: (items: ITaskPreview[]) => _setItems(items),
onAction,
taskFilterStatus: filter?.status,
})
return {

50
src/modules/tasks/hooks/use-fetch-user-tasks.hook.ts

@ -1,50 +0,0 @@ @@ -1,50 +0,0 @@
import { ITaskPreview, useFlatList } from '@/shared'
import { tasksService } from '@/services/domain'
import { useEffect } from 'react'
import { ITaskPreviewResponse } from '@/api/tasks/responses.interface'
import { transformTasksInList } from '@/api/tasks/transform'
import { useTaskListEvents } from './use-task-list-events.hook'
export const useFetchUserTasks = (user: {
id: number
fullName: string
avatarUrl: string
}) => {
const {
items,
isLoading,
isLoadingNext,
loadMore,
resetFlatList,
_setItems,
} = useFlatList({
fetchItems: params => tasksService.getUserTasks(user.id, params),
serrializatorItems: (items: ITaskPreviewResponse[]) =>
transformTasksInList(items, {
id: user.id,
fullName: user.fullName,
avatarUrl: user.avatarUrl,
}),
needInit: true,
loadParams: {
sort: 'DESC',
sortField: 'id',
},
limit: 10,
})
useTaskListEvents({
items,
onReload: () => resetFlatList(),
setItems: (items: ITaskPreview[]) => _setItems(items),
})
useEffect(() => resetFlatList(), [user.id])
return {
items,
isLoading,
isLoadingNext,
loadMore,
}
}

6
src/modules/tasks/hooks/use-task-actions.hook.ts

@ -1,20 +1,17 @@ @@ -1,20 +1,17 @@
import { removeTasksReq } from '@/api'
import { permissionsService, tasksService } from '@/services/domain'
import {
appEvents,
EUserRole,
FullTaskActions,
ITaskActionPayload,
ITaskDetails,
ITaskPreview,
RouteKey,
TaskStatus,
useNav,
} from '@/shared'
import { selectId, selectRole } from '@/store/account'
import { simpleDispatch } from '@/store/store-helpers'
import { selectSelectedTasks, UnselectAll } from '@/store/tasks'
import _ from 'lodash'
import { useState } from 'react'
import { useSelector } from 'react-redux'
import { TaskActionErrors } from '../enum'
import { useTasksPrint } from './use-tasks-print.hook'
@ -30,7 +27,6 @@ export const useTaskActions = () => { @@ -30,7 +27,6 @@ export const useTaskActions = () => {
const selectedTasks = useSelector(selectSelectedTasks)
const userRole = useSelector(selectRole)
const userId = useSelector(selectId)
const nav = useNav()
const { print, pdf } = useTasksPrint()
// const [error, setError] = useState<TaskActionErrors | string>(null)

9
src/modules/tasks/hooks/use-task-filter.hook.ts

@ -64,19 +64,16 @@ export const useTaskFilter = ({ onSubmit, ...props }: IProps) => { @@ -64,19 +64,16 @@ export const useTaskFilter = ({ onSubmit, ...props }: IProps) => {
},
type: 'taskExecutors',
selectedOption: values?.executor,
title: 'Виконавець'
title: 'Виконавець',
})
}
const openSelectCreatorModal = () => {
appEvents.emit('openUserPicker', {
callback: user => {
console.log({ user })
setFormField('creator', user)
},
callback: user => setFormField('creator', user),
type: 'contacts',
selectedOption: values?.creator,
title: 'Хто створив'
title: 'Хто створив',
})
}

27
src/modules/tasks/hooks/use-task-list-events.hook.ts

@ -1,11 +1,17 @@ @@ -1,11 +1,17 @@
import { ITaskPreview, useEventsListener, useSocketListener } from '@/shared'
import {
ITaskPreview,
TaskStatus,
useEventsListener,
useSocketListener,
} from '@/shared'
import _ from 'lodash'
export interface IProps {
interface IProps {
items: ITaskPreview[]
onReload: () => void
setItems: (items: ITaskPreview[]) => void
onAction?: (key: string) => void
taskFilterStatus?: TaskStatus
}
export const useTaskListEvents = (props: IProps) => {
@ -15,12 +21,17 @@ export const useTaskListEvents = (props: IProps) => { @@ -15,12 +21,17 @@ export const useTaskListEvents = (props: IProps) => {
const onTaskDeleted = (data: { ids: number[] }) => {
if (!checkListContainAnyItem(data.ids)) return
const filteredItems = _.filter(
props.items,
item => !_.includes(data.ids, item.id),
)
props.setItems(filteredItems)
props.onAction('delete')
if (
props.taskFilterStatus === TaskStatus.Active ||
props.taskFilterStatus === TaskStatus.Finished
) {
const filteredItems = _.filter(
props.items,
item => !_.includes(data.ids, item.id),
)
props.setItems(filteredItems)
props.onAction('delete')
}
}
const onTaskChanged = (data: { ids: number[] }) => {

1
src/modules/tasks/hooks/use-tasks-print.hook.ts

@ -28,7 +28,6 @@ export const useTasksPrint = () => { @@ -28,7 +28,6 @@ export const useTasksPrint = () => {
fileName: tasksIds.join('-'),
base64: false,
})
console.log('result', result)
RNFetchBlob.ios.openDocument(result.filePath)
// Linking.openURL(result.filePath)

32
src/modules/tasks/screens/filter-tasks-result.screen.tsx

@ -57,38 +57,18 @@ export const FilterTasksResultScreen: FC<IProps> = ({ route, navigation }) => { @@ -57,38 +57,18 @@ export const FilterTasksResultScreen: FC<IProps> = ({ route, navigation }) => {
useSelectExecutor(taskFilter.executor)
const {
items,
loadMore,
reloadTasks,
taskFilterProps,
isLoading,
isLoadingNext,
} = useFetchTasksByFilter({
taskFilter,
searchString: searchValue,
closeFilter: () => setDrawer(false),
})
const { items, loadMore, taskFilterProps, isLoading, isLoadingNext } =
useFetchTasksByFilter({
taskFilter,
searchString: searchValue,
closeFilter: () => setDrawer(false),
})
const { selectedTasks, handleSelectTask, handleResetSelected } =
useTaskSelector()
const { handlePressOneTaskAction } = useTaskActions()
const handleOpenInfoModal = (
title: string,
message: string,
onPress: () => void,
) => {
appEvents.emit('openInfoModal', {
title,
message,
onPressOk: () => onPress(),
})
}
console.log('isLoadingNext', isLoadingNext)
const onPressBack = () => {
simpleDispatch(new UnselectAllUsers())
simpleDispatch(new UnselectExecutor())

3
src/modules/tasks/screens/my-tasks.screen.tsx

@ -40,7 +40,6 @@ export const MyTasksScreen: FC<IProps> = ({ navigation, route }) => { @@ -40,7 +40,6 @@ export const MyTasksScreen: FC<IProps> = ({ navigation, route }) => {
items: myTasks,
loadMore,
taskFilterProps,
isLoading,
isLoadingNext,
} = useFetchTasksByFilter({
closeFilter: () => setDrawer(false),
@ -56,8 +55,6 @@ export const MyTasksScreen: FC<IProps> = ({ navigation, route }) => { @@ -56,8 +55,6 @@ export const MyTasksScreen: FC<IProps> = ({ navigation, route }) => {
)
}
console.log('isLoadingNext', isLoadingNext)
return (
<ScreenLayout
filter={{

1
src/modules/tasks/screens/print-tasks.screen.tsx

@ -24,7 +24,6 @@ export const PrintTasks: FC<IProps> = ({ navigation, route: { params } }) => { @@ -24,7 +24,6 @@ export const PrintTasks: FC<IProps> = ({ navigation, route: { params } }) => {
await RNPrint.print({
html: html.join(' '),
})
console.log('PRINT END')
}
const getTask = async (id: number): Promise<IFullTaskInfo> => {

6
src/modules/tasks/validations/create-task.validations.ts

@ -5,13 +5,11 @@ import { TaskEditMode } from '../enum' @@ -5,13 +5,11 @@ import { TaskEditMode } from '../enum'
validate.extend(validate.validators.datetime, {
parse: function (value, options) {
console.log('parse', value, +moment.utc(value))
return +moment.utc(value)
},
format: function (value, options) {
var format = options.dateOnly ? 'YYYY-MM-DD' : 'YYYY-MM-DD hh:mm:ss'
console.log('format', value, moment.utc(value).format(format))
return moment.utc(value).format(format)
},
})
@ -70,7 +68,7 @@ const constraintsByMode = { @@ -70,7 +68,7 @@ const constraintsByMode = {
},
[TaskEditMode.Copy]: {
...commonConstraints,
...commonConstraints,
executorId: {
presence: presenceCost,
},
@ -121,7 +119,7 @@ const constraintsByMode = { @@ -121,7 +119,7 @@ const constraintsByMode = {
}
export const validateCreateTask = <T>(data: T, mode: TaskEditMode) => {
const errors = validate(data, constraintsByMode[mode])
const errors = validate(data, constraintsByMode[mode])
if (_.isEmpty(errors)) return null

5
src/services/domain/auth.service.ts

@ -59,11 +59,8 @@ const autoAuth = async () => { @@ -59,11 +59,8 @@ const autoAuth = async () => {
await refreshSession()
await loadDataAfterAuth()
await loadNotImportantData()
console.log('DATA LOADED')
NavigationService.setModule(NavigationModuleKey.User)
} catch (e) {
console.log('ACCOUNT LOADING ERROR', e)
@ -85,7 +82,7 @@ const loadNotImportantData = async () => { @@ -85,7 +82,7 @@ const loadNotImportantData = async () => {
await taxonomiesService.fetchReasons().catch(() => {})
await contactsService.fetchBirthdayCountToday().catch(() => {})
await tasksService.getUnreadTasksCount().catch(() => { })
await tasksService.getUnreadTasksCount().catch(() => {})
await chatsService.getUnreadMessagesCount().catch(() => {})
await notificationService.initAndSaveDevice().catch(() => {})
}

11
src/services/system/fs.service.ts

@ -18,8 +18,7 @@ interface IDownloadFileParams { @@ -18,8 +18,7 @@ interface IDownloadFileParams {
fileName: string
}
const prepareUriToRNFS = (uri: string) =>
'file:///' + uri.replace('file://', '')
const prepareUriToRNFS = (uri: string) => 'file://' + uri.replace('file://', '')
const prepareRNFSFile = (data: RNFS.StatResult): IFile => {
return {
@ -65,13 +64,15 @@ const downloadFile = (params: IDownloadFileParams) => { @@ -65,13 +64,15 @@ const downloadFile = (params: IDownloadFileParams) => {
const path = directory + `/${params.fileName}`
// downloadImage(params.fileUrl)
const { promise } = RNFS.downloadFile({
fromUrl: params.fileUrl,
toFile: path,
})
try {
await promise
const result = await promise
resolve(path)
} catch (e) {
console.log('downloadFile ERR:', e)
@ -85,15 +86,11 @@ const deleteFile = async (filepath: string) => { @@ -85,15 +86,11 @@ const deleteFile = async (filepath: string) => {
let exists = await RNFS.exists(filepath)
if (exists) {
await RNFS.unlink(filepath)
console.log('File Deleted')
} else {
console.log('File Not Available')
}
} catch (err) {
console.log('deleteFile ERR:', err)
}
}
export const fsService = {
getFileStat,
writeFile,

3
src/services/system/real-time.service.ts

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
import { config } from '@/config'
import { socketEvents } from '@/shared/events'
import { Alert } from 'react-native'
import io from 'socket.io-client'
import { GlobalContainerService } from './global-container.service'
@ -18,7 +18,6 @@ export class SocketIo { @@ -18,7 +18,6 @@ export class SocketIo {
this._on('connect', () => {
this.emit('join-user', store().getState().account.account)
this.initSockets()
console.log('Success init socket')
})
} catch (e) {
console.log('ERROR')

19
src/shared/components/plugins/chat/chat-bar.component.tsx

@ -2,7 +2,7 @@ import { $size, isAndroid } from '@/shared/helpers' @@ -2,7 +2,7 @@ import { $size, isAndroid } from '@/shared/helpers'
import { useTheme } from '@/shared/hooks'
import { PartialTheme } from '@/shared/themes/interfaces'
import _ from 'lodash'
import React, { FC, useMemo, useRef, useState } from 'react'
import React, { FC, useEffect, useMemo, useRef, useState } from 'react'
import { Dimensions } from 'react-native'
import { ActivityIndicator, Platform, StyleSheet, View } from 'react-native'
import { MentionInput } from 'react-native-controlled-mentions'
@ -38,6 +38,7 @@ export const ChatBar: FC<ChatBarProps> = props => { @@ -38,6 +38,7 @@ export const ChatBar: FC<ChatBarProps> = props => {
const insets = useSafeAreaInsets()
const [isFocus, setFocus] = useState(false)
const [inputHeight, setInputHeight] = useState(0)
const [block, setBlock] = useState(false)
const inputRef = useRef(null)
@ -119,7 +120,10 @@ export const ChatBar: FC<ChatBarProps> = props => { @@ -119,7 +120,10 @@ export const ChatBar: FC<ChatBarProps> = props => {
} else {
return (
<ChatSendButton
onSend={props.onPressSend}
onSend={() => {
setBlock(true)
props.onPressSend()
}}
onSendVoice={props.onSendVoice}
/>
)
@ -145,7 +149,7 @@ export const ChatBar: FC<ChatBarProps> = props => { @@ -145,7 +149,7 @@ export const ChatBar: FC<ChatBarProps> = props => {
onLayout={e =>
setInputHeight(e.nativeEvent.layout.height)
}
editable={!props.isDisabled}
editable={true}
multiline={true}
autoCorrect={false}
autoCompleteType="off"
@ -153,7 +157,14 @@ export const ChatBar: FC<ChatBarProps> = props => { @@ -153,7 +157,14 @@ export const ChatBar: FC<ChatBarProps> = props => {
containerStyle={styles.input}
style={{ color: theme?.$secondaryText }}
value={props.message}
onChange={val => props.onChangeMessage(val)}
onChange={val => {
if (block) {
setBlock(false)
props.onChangeMessage('')
} else {
props.onChangeMessage(val)
}
}}
placeholderTextColor={theme?.$secondaryText}
partTypes={[
{

2
src/shared/components/tools/keyboard-spacer.component.tsx

@ -121,8 +121,6 @@ export class KeyboardSpacer extends Component< @@ -121,8 +121,6 @@ export class KeyboardSpacer extends Component<
keyboardSpace = keyboardSpace - Number(this.props.addSpace)
}
console.log('keyboardSpace', event.endCoordinates.screenY)
this.setState(
{
keyboardSpace,

2
src/shared/helpers/fs.helpers.ts

@ -13,7 +13,7 @@ export const getFileName = (file: any) => { @@ -13,7 +13,7 @@ export const getFileName = (file: any) => {
}
}
export const getFileExtension = (uri: string) => uri.split('.')[1]
export const getFileExtension = (uri: string) => uri.split('.').pop()
export const getFileUri = (file: any) => {
return Platform.OS === 'android'

1
src/store/shared/reducer.ts

@ -18,7 +18,6 @@ export const sharedReducer = createReducer<ISharedState, TAuthActions>( @@ -18,7 +18,6 @@ export const sharedReducer = createReducer<ISharedState, TAuthActions>(
initialState,
{
SET_NAVIGATION_MODULE: (state, action) => {
console.log('SET_NAVIGATION_MODULE', action.payload)
return {
...state,
prevModule: state.activeNavigationModule,

Loading…
Cancel
Save