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 { useContext } from "react"; | |
import { useHistory } from 'react-router-dom'; | |
import Context from "../context"; | |
const Header = () => { | |
const { user, setUser, eThree, cometChat } = useContext(Context); | |
const history = useHistory(); |
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
... | |
useEffect(() => { | |
initCometChat(); | |
}, []); | |
const initCometChat = async () => { | |
const { CometChat } = await import('@cometchat-pro/chat'); | |
const appID = `${process.env.REACT_APP_COMETCHAT_APP_ID}`; | |
const region = `${process.env.REACT_APP_COMETCHAT_REGION}`; | |
const appSetting = new CometChat.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(region).build(); |
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 firebase from "firebase"; | |
import "firebase/storage"; | |
const firebaseConfig = { | |
apiKey: `${process.env.REACT_APP_FIREBASE_API_KEY}`, | |
authDomain: `${process.env.REACT_APP_FIREBASE_AUTH_DOMAIN}`, | |
databaseURL: `${process.env.REACT_APP_FIREBASE_DATABASE_URL}`, | |
projectId: `${process.env.REACT_APP_FIREBASE_PROJECT_ID}`, | |
storageBucket: `${process.env.REACT_APP_FIREBASE_STORAGE_BUCKET}`, | |
messagingSenderId: `${process.env.REACT_APP_FIREABSE_MESSAGING_SENDER_ID}`, |
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, useRef, useContext } from "react"; | |
import validator from "validator"; | |
import { useHistory } from 'react-router-dom'; | |
import withModal from "../common/Modal"; | |
import SignUp from "../register/SignUp"; | |
import Context from "../../context"; | |
import { auth, realTimeDb } from "../../firebase"; | |
const Login = (props) => { | |
const { toggleModal } = props; |
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 } from 'react'; | |
const withModal = ModalComponent => WrapperComponent => { | |
return function () { | |
const [isModalShown, setIsModalShown] = useState(false); | |
return ( | |
<> | |
<WrapperComponent toggleModal={setIsModalShown}/> | |
{isModalShown && <ModalComponent toggleModal={setIsModalShown} />} |
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 { useRef, useContext } from "react"; | |
import validator from "validator"; | |
import { v4 as uuidv4 } from "uuid"; | |
import Context from "../../context"; | |
import { auth, realTimeDb } from "../../firebase"; | |
const SignUp = (props) => { | |
const { toggleModal } = props; |
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 Sidebars from './Sidebars'; | |
import Main from './Main'; | |
const Friend = () => { | |
return ( | |
<div className="friends__container"> | |
<Sidebars /> | |
<Main /> | |
</div> | |
); |