-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class based restapi migration for chat components #862
Closed
Closed
Changes from 9 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
3af1ca5
feat: changed all the old apis in chat to class component ones
KlausMikhaelson 5db0221
fix: reverted type change
KlausMikhaelson 1d49e23
fix: removed unnecessary code
KlausMikhaelson 153336a
fix: fixed type error in fetch chat
KlausMikhaelson a4ab6cf
fix: fixed pagination
KlausMikhaelson de2bc6e
fix: added correct types and changed alias to pushUser
KlausMikhaelson 393ffe9
fix: fixed message not loading if signer is passed and changed api of…
KlausMikhaelson 15bce8e
fix: updated creategroup and update group api and added initializep…
KlausMikhaelson 729f2b9
fix: updated get profile hook with a new one for chat
KlausMikhaelson ad73b15
fix: fixed add members with a new hook
KlausMikhaelson e3c1606
fix: made changes as per comments on pr
KlausMikhaelson d91bbac
fix: moved initialize user to chatdataprovider
KlausMikhaelson e8fa9cb
fix: removed unused code and connected profile
KlausMikhaelson a4e9870
fix: fixed content issue when adding new member and replaced to or fr…
KlausMikhaelson 6397df9
fix: fixed
mishramonalisha76 2b91a52
fix: merging with main
mishramonalisha76 4738e1a
fix: fixed guest mode
mishramonalisha76 c035385
fix: chat profile migration
mishramonalisha76 d7f5ec0
fix: user initialisation code
mishramonalisha76 64ca399
fix: fixed
mishramonalisha76 39ce166
fix: fixed
mishramonalisha76 bdcdfc3
fix: fetched members of a group
mishramonalisha76 da7f545
fix: fixed
mishramonalisha76 bea7799
fix: fixing chat profile
mishramonalisha76 e6a7991
fix: migrated chat profile to new restapi
mishramonalisha76 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,13 +25,14 @@ import { | |
pCAIP10ToWallet, | ||
shortenText, | ||
} from '../../../helpers'; | ||
import { formatTime } from '../../../helpers/timestamp'; | ||
|
||
const SenderMessageAddress = ({ chat }: { chat: IMessagePayload }) => { | ||
const { account } = useContext(ChatDataContext); | ||
const theme = useContext(ThemeContext); | ||
return ( | ||
<> | ||
{chat.fromCAIP10.split(':')[1] !== account && ( | ||
{(chat.fromDID).split(':')[1] !== account && ( | ||
<Span | ||
theme={theme} | ||
alignSelf="start" | ||
|
@@ -53,7 +54,7 @@ const SenderMessageProfilePicture = ({ chat }: { chat: IMessagePayload }) => { | |
const [pfp, setPfp] = useState<string>(''); | ||
const getUserPfp = async () => { | ||
const pfp = await getPfp({ | ||
account: chat.fromCAIP10.split(':')[1], | ||
account: chat.fromDID.split(':')[1], | ||
env: env, | ||
}); | ||
if (pfp) { | ||
|
@@ -62,10 +63,10 @@ const SenderMessageProfilePicture = ({ chat }: { chat: IMessagePayload }) => { | |
}; | ||
useEffect(() => { | ||
getUserPfp(); | ||
}, [account, chat.fromCAIP10]); | ||
}, [account, chat.fromDID]); | ||
return ( | ||
<Section justifyContent="start" alignItems="start"> | ||
{chat.fromCAIP10.split(':')[1] !== account && ( | ||
{(chat.fromDID || chat.fromDID).split(':')[1] !== account && ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, thanks for pointing out will remove one |
||
<Section alignItems="start"> | ||
{pfp && ( | ||
<Image | ||
|
@@ -123,7 +124,7 @@ const MessageCard = ({ | |
isGroup: boolean; | ||
}) => { | ||
const theme = useContext(ThemeContext); | ||
const time = moment(chat.timestamp).format('hh:mm a'); | ||
const time = formatTime(chat.timestamp) | ||
return ( | ||
<MessageWrapper chat={chat} isGroup={isGroup} maxWidth="70%"> | ||
<Section | ||
|
@@ -347,7 +348,7 @@ export const ChatViewBubble = ({ decryptedMessagePayload }: { decryptedMessagePa | |
}); | ||
const [isGroup, setIsGroup] = useState<boolean>(false); | ||
useEffect(() => { | ||
if (decryptedMessagePayload.toDID.split(':')[0] === 'eip155') { | ||
if ((decryptedMessagePayload.toDID).split(':')[0] === 'eip155') { | ||
if (isGroup) { | ||
setIsGroup(false); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets revert this back to .fromCAIP10, in this file