-
-
Notifications
You must be signed in to change notification settings - Fork 758
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
Showing
17 changed files
with
776 additions
and
0 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 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,13 @@ | ||
.chatAreaContainer { | ||
padding: 10px; | ||
flex-grow: 1; | ||
background-color: rgba(196, 255, 211, 0.3); | ||
} | ||
|
||
.backgroundWhite { | ||
background-color: white; | ||
} | ||
|
||
.grey { | ||
color: grey; | ||
} |
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,81 @@ | ||
import React from 'react'; | ||
import type { ChangeEvent } from 'react'; | ||
import { Paper } from '@mui/material'; | ||
import SendIcon from '@mui/icons-material/Send'; | ||
import { Button, Form, InputGroup } from 'react-bootstrap'; | ||
import styles from './ChatRoom.module.css'; | ||
import PermContactCalendarIcon from '@mui/icons-material/PermContactCalendar'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
interface InterfaceChatRoomProps { | ||
selectedContact: string; | ||
} | ||
|
||
export default function chatRoom(props: InterfaceChatRoomProps): JSX.Element { | ||
const { t } = useTranslation('translation', { | ||
keyPrefix: 'userChatRoom', | ||
}); | ||
|
||
const [newMessage, setNewMessage] = React.useState(''); | ||
|
||
const handleNewMessageChange = (e: ChangeEvent<HTMLInputElement>): void => { | ||
const newMessageValue = e.target.value; | ||
|
||
setNewMessage(newMessageValue); | ||
}; | ||
|
||
return ( | ||
<div className={`d-flex flex-column ${styles.chatAreaContainer}`}> | ||
{!props.selectedContact ? ( | ||
<div | ||
className={`d-flex flex-column justify-content-center align-items-center w-100 h-75 gap-2 ${styles.grey}`} | ||
> | ||
<PermContactCalendarIcon fontSize="medium" className={styles.grey} /> | ||
<h6>{t('selectContact')}</h6> | ||
</div> | ||
) : ( | ||
<> | ||
<div className={`d-flex flex-grow-1 flex-column`}> | ||
<Paper | ||
variant="outlined" | ||
sx={{ | ||
p: 2, | ||
backgroundColor: 'white', | ||
borderRadius: '20px 20px 5px 20px', | ||
marginBottom: `10px`, | ||
}} | ||
> | ||
My message | ||
</Paper> | ||
<Paper | ||
variant="outlined" | ||
sx={{ | ||
p: 2, | ||
backgroundColor: '#31bb6b', | ||
borderRadius: '20px 20px 20px 5px', | ||
color: 'white', | ||
marginBottom: `10px`, | ||
}} | ||
> | ||
Other message | ||
</Paper> | ||
</div> | ||
<div> | ||
<InputGroup> | ||
<Form.Control | ||
placeholder={t('sendMessage')} | ||
aria-label="Send Message" | ||
value={newMessage} | ||
onChange={handleNewMessageChange} | ||
className={styles.backgroundWhite} | ||
/> | ||
<Button variant="primary" id="button-addon2"> | ||
<SendIcon fontSize="small" /> | ||
</Button> | ||
</InputGroup> | ||
</div> | ||
</> | ||
)} | ||
</div> | ||
); | ||
} |
33 changes: 33 additions & 0 deletions
33
src/components/UserPortal/ContactCard/ContactCard.module.css
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,33 @@ | ||
.contact { | ||
display: flex; | ||
flex-direction: row; | ||
padding: 10px 10px; | ||
cursor: pointer; | ||
border-radius: 10px; | ||
margin-bottom: 10px; | ||
border: 2px solid #f5f5f5; | ||
} | ||
|
||
.contactImage { | ||
width: 50px; | ||
height: auto; | ||
border-radius: 10px; | ||
} | ||
|
||
.contactNameContainer { | ||
display: flex; | ||
flex-direction: column; | ||
padding: 0px 10px; | ||
} | ||
|
||
.grey { | ||
color: grey; | ||
} | ||
|
||
.bgGrey { | ||
background-color: #f5f5f5; | ||
} | ||
|
||
.bgWhite { | ||
background-color: white; | ||
} |
Oops, something went wrong.