-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
75ab666
commit 6fb5327
Showing
8 changed files
with
118 additions
and
141 deletions.
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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Conversation, Message } from "../../utils/types/message"; | ||
|
||
export const getLineTextByMessageType = ({ message }: { message: Message }) => { | ||
switch (message.type) { | ||
case "contact-request": | ||
return `Anon has sent a contact`; | ||
} | ||
}; | ||
|
||
export const getNewConversationText = (conversation: Conversation) => { | ||
if (conversation.type === "contact") { | ||
return `Your contact request with ${ | ||
conversation?.members?.[0]?.name || "Anon" | ||
} is still pending and has not yet been accepted.`; | ||
} else { | ||
return "Congratulations on creating this group! Currently, there are no members who have joined yet."; | ||
} | ||
}; | ||
|
||
export const getConversationName = (conversation: Conversation) => { | ||
if (conversation.type === "contact") { | ||
return conversation?.members?.[0]?.name || "Anon"; | ||
} else { | ||
return "Group"; | ||
} | ||
}; | ||
|
||
export const getConversationAvatar = (conversation: Conversation) => { | ||
if (conversation.type === "contact") { | ||
return conversation?.members?.[0]?.avatar || ""; | ||
} else { | ||
return ""; | ||
} | ||
}; |