-
Notifications
You must be signed in to change notification settings - Fork 1
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
c862f5c
commit d63672d
Showing
10 changed files
with
170 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { baseApiUrl } from './base'; | ||
|
||
const base = `${baseApiUrl}/messages`; | ||
|
||
export const messagesPaths = Object.seal({ | ||
get: (userId: number) => `${base}/${userId}`, | ||
send: `${base}/send`, | ||
}); |
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
25 changes: 25 additions & 0 deletions
25
client/src/pages/chat/chat-left-message/ChatLeftMessage.tsx
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,25 @@ | ||
interface ChatLeftMessageProps { | ||
content: string; | ||
senderFullName: string; | ||
} | ||
|
||
function ChatLeftMessage(props: ChatLeftMessageProps) { | ||
return ( | ||
<div className="d-flex align-items-center"> | ||
<div className="text-left pr-1"> | ||
<img | ||
src="https://img.icons8.com/color/40/000000/guest-female.png" | ||
width={30} | ||
className="img1" | ||
/> | ||
</div> | ||
<div className="pr-2 pl-1"> | ||
{' '} | ||
<span className="name">{props.senderFullName}</span> | ||
<p className="msg">{props.content}</p> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default ChatLeftMessage; |
24 changes: 24 additions & 0 deletions
24
client/src/pages/chat/chat-right-message/ChatRightMessage.tsx
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,24 @@ | ||
interface ChatRightMessageProps { | ||
message: string; | ||
} | ||
|
||
function ChatRightMessage({ message }: ChatRightMessageProps) { | ||
return ( | ||
<div className="d-flex align-items-center text-right justify-content-end "> | ||
<div className="pr-2"> | ||
{' '} | ||
<span className="name">You</span> | ||
<p className="msg">{message}</p> | ||
</div> | ||
<div> | ||
<img | ||
src="https://i.imgur.com/HpF4BFG.jpg" | ||
width={30} | ||
className="img1" | ||
/> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default ChatRightMessage; |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { IFullUser } from '../auth/IFullUser'; | ||
import { IObjectWithId } from '../common/IObjectWithId'; | ||
|
||
export interface IMessage extends IObjectWithId { | ||
content: string; | ||
sentAt: Date; | ||
senderId: IFullUser; | ||
receiverId: IFullUser; | ||
} |
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