This file contains hidden or 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
| import { useState, useContext } from 'react'; | |
| import { CometChatMessages } from '../../cometchat-pro-react-ui-kit/CometChatWorkspace/src'; | |
| import Header from './Header'; | |
| import Pendings from './Pendings'; | |
| import Add from './Add'; | |
| import RightSidebar from './RightSidebar'; | |
| import Context from '../../context'; | |
| const Main = () => { | |
| const [selectedOption, setSelectedOption] = useState(1); |
This file contains hidden or 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
| const Header = (props) => { | |
| const { onItemSelected, selectedOption } = props; | |
| const selectItem = (index) => () => { | |
| onItemSelected(index); | |
| }; | |
| return ( | |
| <div className="friends__main-header"> | |
| <span onClick={selectItem(1)} className={`${selectedOption === 1 ? 'friends__main-header--active' : ''}`}>Pending</span> |
This file contains hidden or 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
| import notFound from '../../images/404.png'; | |
| const NotFound = () => { | |
| return ( | |
| <div className="not-found"> | |
| <img src={notFound} alt="404"/> | |
| <p>No one's around to play with Wumpus.</p> | |
| </div> | |
| ); | |
| }; |
This file contains hidden or 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
| import { useEffect, useState, useContext } from 'react'; | |
| import Search from './Search'; | |
| import Users from './Users'; | |
| import Context from '../../context'; | |
| import { realTimeDb } from '../../firebase'; | |
| const Add = () => { | |
| const [authenticatedUser, setAuthenticatedUser] = useState(null); | |
| const [users, setUsers] = useState(null); |
This file contains hidden or 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
| const Search = (props) => { | |
| const { onSearchChanged } = props; | |
| const onChanged = (e) => { | |
| const keywords = e.target.value.trim(); | |
| onSearchChanged(keywords); | |
| }; | |
| return ( | |
| <div className="add-friend__search"> |
This file contains hidden or 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
| import User from './User'; | |
| const Users = (props) => { | |
| const { users, onConfirmShown } = props; | |
| if (!users || !users.length) { | |
| return <></>; | |
| } | |
| return ( |
This file contains hidden or 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
| const User = (props) => { | |
| const { user, onItemClicked } = props; | |
| const selectUser = (user) => () => { | |
| onItemClicked(user); | |
| }; | |
| return ( | |
| <div className="add-friend__list-item" onClick={selectUser(user)}> | |
| <div className="add-friend__list-item-left"> |
This file contains hidden or 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
| import { useEffect, useState, useContext } from 'react'; | |
| import SubHeader from "./SubHeader"; | |
| import Pending from './Pending'; | |
| import NotFound from './NotFound'; | |
| import Context from '../../context'; | |
| import { realTimeDb } from '../../firebase'; | |
| const Pendings = () => { | |
| const [authenticatedUser, setAuthenticatedUser] = useState(null); | |
| const [users, setUsers] = useState(null); |