Skip to content

Commit 7555ca0

Browse files
committed
Merge branch 'newArchitecture' of https://github.com/dappros/ethora
2 parents 692deb6 + bce5727 commit 7555ca0

File tree

15 files changed

+1086
-194
lines changed

15 files changed

+1086
-194
lines changed

client-reactnative/src/Screens/Chat/ChatScreen.tsx

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
1-
import {observer} from 'mobx-react-lite';
2-
import React, {useEffect} from 'react';
3-
import {format} from 'date-fns';
4-
import {useStores} from '../../stores/context';
5-
import {getRoomArchiveStanza, getPaginatedArchive} from '../../xmpp/stanzas';
6-
import ChatContainer from '../../components/Chat/ChatContainer';
7-
import {IMessage, roomListProps} from '../../stores/chatStore';
8-
import { View } from 'native-base';
1+
import { observer } from "mobx-react-lite";
2+
import React, { useEffect } from "react";
3+
import { format } from "date-fns";
4+
import { useStores } from "../../stores/context";
5+
import { getRoomArchiveStanza, getPaginatedArchive } from "../../xmpp/stanzas";
6+
import ChatContainer from "../../components/Chat/ChatContainer";
7+
import { IMessage, roomListProps } from "../../stores/chatStore";
8+
import { View } from "native-base";
99

10-
const ChatScreen = observer(({route}: any) => {
11-
const {chatStore} = useStores();
10+
const ChatScreen = observer(({ route }: any) => {
11+
const { chatStore } = useStores();
1212

13-
const {chatJid, chatName} = route.params;
14-
const room:roomListProps = chatStore.roomList.find(item => item.jid === chatJid)||{
15-
avatar:"",
16-
counter:0,
17-
createdAt:"",
18-
jid:chatJid,
19-
lastUserName:"",
20-
lastUserText:"",
21-
name:chatName?chatName:'',
22-
participants:0,
23-
isFavourite:false,
24-
muted:false,
25-
priority:0,
26-
roomBackground:"",
27-
roomBackgroundIndex:0,
28-
roomThumbnail:""
13+
const { chatJid, chatName } = route.params;
14+
const room: roomListProps = chatStore.roomList.find(
15+
(item) => item.jid === chatJid
16+
) || {
17+
avatar: "",
18+
counter: 0,
19+
createdAt: "",
20+
jid: chatJid,
21+
lastUserName: "",
22+
lastUserText: "",
23+
name: chatName ? chatName : "",
24+
participants: 0,
25+
isFavourite: false,
26+
muted: false,
27+
priority: 0,
28+
roomBackground: "",
29+
roomBackgroundIndex: 0,
30+
roomThumbnail: "",
2931
};
3032
const messages = chatStore.messages
3133
.filter((item: IMessage) => {
@@ -66,7 +68,8 @@ const ChatScreen = observer(({route}: any) => {
6668
lastUserText: lastMessage?.text,
6769
lastUserName: lastMessage?.user?.name,
6870
lastMessageTime:
69-
lastMessage?.createdAt && format(lastMessage?.createdAt as Date, 'hh:mm'),
71+
lastMessage?.createdAt &&
72+
format(new Date(lastMessage?.createdAt), "hh:mm"),
7073
});
7174
}, [!!messages]);
7275

@@ -79,7 +82,7 @@ const ChatScreen = observer(({route}: any) => {
7982
};
8083

8184
return (
82-
<View testID='ChatScreen'>
85+
<View testID="ChatScreen">
8386
<ChatContainer
8487
containerType="main"
8588
roomDetails={room}
@@ -90,4 +93,4 @@ const ChatScreen = observer(({route}: any) => {
9093
);
9194
});
9295

93-
export default ChatScreen;
96+
export default ChatScreen;

client-reactnative/src/Screens/Chat/NewChatScreen.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,12 @@ const NewChatScreen = (props: NewChatScreenProps) => {
125125
{ roomName: chatName, roomDescription: chatDescription },
126126
chatStore.xmpp
127127
);
128-
129128
chatAvatar &&
130129
setRoomImage(
131130
manipulatedWalletAddress + "@" + apiStore.xmppDomains.DOMAIN,
132131
roomHash + apiStore.xmppDomains.CONFERENCEDOMAIN,
133132
chatAvatar,
134-
"",
133+
"none",
135134
"icon",
136135
chatStore.xmpp
137136
);

client-reactnative/src/Screens/Login/RegularLoginScreen.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ export const RegularLoginScreen = ({navigation}: ScreenProps) => {
100100
<Input
101101
testID={'loginPassword'}
102102
accessibilityLabel="Enter your password"
103-
maxLength={15}
104103
marginBottom={2}
105104
fontFamily={textStyles.lightFont}
106105
fontSize={hp('1.6%')}

0 commit comments

Comments
 (0)