From a7a4d9bb0013b3ca09a3dbaf372be899e2ea91a7 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto Date: Tue, 13 Dec 2022 14:18:31 -0300 Subject: [PATCH] room info edit view --- app/stacks/MasterDetailStack/types.ts | 6 ++ app/views/ChangeAvatarView/index.tsx | 10 +-- app/views/RoomInfoEditView/index.tsx | 88 ++++----------------------- app/views/RoomInfoView/index.tsx | 2 +- 4 files changed, 26 insertions(+), 80 deletions(-) diff --git a/app/stacks/MasterDetailStack/types.ts b/app/stacks/MasterDetailStack/types.ts index f06cfd5b9..181a35d35 100644 --- a/app/stacks/MasterDetailStack/types.ts +++ b/app/stacks/MasterDetailStack/types.ts @@ -58,6 +58,12 @@ export type ModalStackParamList = { onSearch?: Function; isRadio?: boolean; }; + ChangeAvatarView: { + fromUser?: boolean; + titleHeader?: string; + room?: ISubscription; + t?: SubscriptionType; + }; RoomInfoEditView: { rid: string; }; diff --git a/app/views/ChangeAvatarView/index.tsx b/app/views/ChangeAvatarView/index.tsx index 29aa8a987..03570e5f9 100644 --- a/app/views/ChangeAvatarView/index.tsx +++ b/app/views/ChangeAvatarView/index.tsx @@ -4,6 +4,7 @@ import { RouteProp, useNavigation, useRoute } from '@react-navigation/native'; import { StackNavigationProp } from '@react-navigation/stack'; import ImagePicker, { Image } from 'react-native-image-crop-picker'; +import { compareServerVersion } from '../../lib/methods/helpers'; import KeyboardView from '../../containers/KeyboardView'; import sharedStyles from '../Styles'; import scrollPersistTaps from '../../lib/methods/helpers/scrollPersistTaps'; @@ -27,13 +28,14 @@ import log from '../../lib/methods/helpers/log'; const ChangeAvatarView = () => { const [avatar, setAvatarState] = useState(); - + const [textAvatar, setTextAvatar] = useState(''); const [saving, setSaving] = useState(false); const { colors } = useTheme(); - const { user } = useAppSelector(state => ({ + const { user, serverVersion } = useAppSelector(state => ({ user: getUserSelector(state), - isMasterDetail: state.app.isMasterDetail + isMasterDetail: state.app.isMasterDetail, + serverVersion: state.server.version })); const avatarUrl = useRef(''); @@ -182,7 +184,7 @@ const ChangeAvatarView = () => { onPress={pickImage} testID='change-avatar-view-logout-other-locations' /> - {!fromUser ? ( + {!fromUser && serverVersion && compareServerVersion(serverVersion, 'greaterThanOrEqualTo', '3.6.0') ? (