-
-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add chat screen to talawa-user-portal (#986)
* Create login and register page for user portal * Lint public locales * Create tests for login page components * Add react import in tests * Create organizations screen for user portal * Fix failing tests and lint code * fix failing tests * Add tests for organization screen and componenets * Fix non-null assertions * Fix non-null assertions in organizations test * Fix bootstrap migration changes * Add Home Screen along with other components * Fix failing tests * Add required tests and Offcanvas navbar * Remove unused variables from tests * Sync the Mutations with talawa-api * Add Settings and Donate Screen * Add multilingual support for the screens * Add events screen without calendar view * Add multilingual support to Events screen * Fix failing tests due to merge * Add Post Comment functionality * Refactor Events tests * Deprecate event registrants from query * Add my tasks screen for user portal * Remove unnecessary comments from test files * Add chat screen along with components * Add mui/system package for x-chart support * Add chat screen tests and fix other bugs
- Loading branch information
1 parent
18e6ed9
commit 046600a
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.