Browse Source

last commit project finished

unknown 1 year ago
parent
commit
88a0a9808b

File diff suppressed because it is too large
+ 1 - 1
.eslintcache


+ 6 - 37
src/components/HomePage/CentralBar/ChatBar/Messages/MessageLeftCall/index.tsx

@@ -3,24 +3,20 @@ import { styled } from '@mui/material/styles';
 import { useState } from "react";
 import Typography from '@mui/material/Typography';
 import Button from '@mui/material/Button';
-import ContentCopyIcon from '@mui/icons-material/ContentCopy';
 import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
 import Menu from '@mui/material/Menu';
 import MenuItem from '@mui/material/MenuItem';
 import Divider from '@mui/material/Divider';
 import CheckBoxIcon from '@mui/icons-material/CheckBox';
 import Checkbox from '@mui/material/Checkbox';
-import PushPinIcon from '@mui/icons-material/PushPin';
-import CloseIcon from '@mui/icons-material/Close';
 import ReplyIcon from '@mui/icons-material/Reply';
 import VisibilityIcon from '@mui/icons-material/Visibility';
 import SouthWestIcon from '@mui/icons-material/SouthWest';
 import NorthEastIcon from '@mui/icons-material/NorthEast';
 import PhoneIcon from '@mui/icons-material/Phone';
 import Avatar from '@mui/material/Avatar';
-import { CopyToClipboard } from 'react-copy-to-clipboard';
-import { removeMessageById,updateMessageById,pinMessageById } from "../../../../../../api-data";
-import { firstLetter,slicedWord,timeStampMessage,copied,emojisArr,prodAwsS3,getTimeBySeconds } from '../../../../../../helpers'
+import { removeMessageById,updateMessageById } from "../../../../../../api-data";
+import { firstLetter,slicedWord,timeStampMessage,emojisArr,prodAwsS3,getTimeBySeconds } from '../../../../../../helpers'
 
 const StyledMenu = styled((props:any) => (
   <Menu
@@ -210,26 +206,22 @@ interface IMessageLeftCall {
   duration: number,
   tongue: boolean,
   watched: boolean,
-  edited: boolean,
   avatarUrl: string,
   color: string,
   name:string,
   lastName:string,
   createdAt: string,
-  caption: string,
   emoji: string,
   emojiCompanion: string,
-  pinned: boolean,
   isSomeSelected: boolean,
   isSelected:(_id:string) => boolean,
   handleSelected: (_id:string) => void,
   _id: string,
   nightMode: boolean,
   handleReply: (_id: string) => void,
-  handleForward: (_id: string) => void,
 }
 
-const MessageLeftCall = ({message,initiator,duration,tongue,watched,edited,avatarUrl,color,name,lastName,createdAt,caption,emoji,emojiCompanion,pinned,isSomeSelected,isSelected,handleSelected,_id,nightMode,handleReply,handleForward}:IMessageLeftCall) => {
+const MessageLeftCall = ({message,initiator,duration,tongue,watched,avatarUrl,color,name,lastName,createdAt,emoji,emojiCompanion,isSomeSelected,isSelected,handleSelected,_id,nightMode,handleReply}:IMessageLeftCall) => {
   const classes = useStyles();
   const [anchorEl, setAnchorEl] = useState<any>(null);
   const [selected, setSelected] = useState<boolean>(false);
@@ -238,7 +230,6 @@ const MessageLeftCall = ({message,initiator,duration,tongue,watched,edited,avata
   const checked = isSelected(_id)
   
   const handleClose = (type: string | undefined): void => {
-    if (type === 'copy') copied('Text')
     if (type === 'delete') setModal(true)
     setAnchorEl(null)
     setSelected(false)
@@ -260,8 +251,8 @@ const MessageLeftCall = ({message,initiator,duration,tongue,watched,edited,avata
 
   const handleEmojiMenu = ({ target }: any): void => {
     const idEmoji = target.id
-    if (idEmoji === emoji) {updateMessageById(_id,'')  
-    } else updateMessageById(_id,idEmoji)
+    if (idEmoji === emoji) updateMessageById(_id,'')  
+     else updateMessageById(_id,idEmoji)
   } 
   
   return (
@@ -273,7 +264,7 @@ const MessageLeftCall = ({message,initiator,duration,tongue,watched,edited,avata
           ${firstLetter(lastName)}${slicedWord(lastName, 15, 1)}`}
         </Typography>
         <div className={classes.wrapperInner}>
-          <Typography style={{color: "#26afee"}} variant="h6" align="right">
+          <Typography style={{color: "#363636"}} variant="h6" align="right">
             {message}
           </Typography>
           <PhoneIcon style={{color:'#26afee'}} fontSize='large' />
@@ -310,28 +301,6 @@ const MessageLeftCall = ({message,initiator,duration,tongue,watched,edited,avata
         }}>
           <ReplyIcon />
           Reply
-        </MenuItem>
-        <MenuItem onClick={() => {
-            handleForward(_id)
-            handleClose(undefined)
-        }}>
-            <ReplyIcon style={{transform :'rotateY(180deg)'}} />
-            Forward
-        </MenuItem>           
-        <CopyToClipboard onCopy={() => handleClose('copy')} text={`${message?message:''} ${caption?caption:''}`}>
-          <MenuItem>
-            <ContentCopyIcon />
-             Copy Text
-          </MenuItem>
-        </CopyToClipboard>
-        <MenuItem onClick={() => {
-          pinMessageById(_id, !pinned)
-          handleClose(undefined)
-        }}>
-            {pinned ?
-              <CloseIcon className={classes.iconClose} /> :
-              <PushPinIcon />}
-             {pinned?'Unpin':'Pin'}
         </MenuItem>          
         <MenuItem onClick={() => {
             handleSelected(_id)

+ 7 - 47
src/components/HomePage/CentralBar/ChatBar/Messages/MessageRightCall/index.tsx

@@ -3,26 +3,21 @@ import { styled } from '@mui/material/styles';
 import { useState } from "react";
 import Typography from '@mui/material/Typography';
 import Button from '@mui/material/Button';
-import ContentCopyIcon from '@mui/icons-material/ContentCopy';
 import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
 import Menu from '@mui/material/Menu';
 import MenuItem from '@mui/material/MenuItem';
 import Divider from '@mui/material/Divider';
 import CheckBoxIcon from '@mui/icons-material/CheckBox';
 import Checkbox from '@mui/material/Checkbox';
-import PushPinIcon from '@mui/icons-material/PushPin';
-import CloseIcon from '@mui/icons-material/Close';
 import ReplyIcon from '@mui/icons-material/Reply';
 import DoneAllIcon from '@mui/icons-material/DoneAll';
 import DoneIcon from '@mui/icons-material/Done';
-import EditIcon from '@mui/icons-material/Edit';
 import SouthWestIcon from '@mui/icons-material/SouthWest';
 import NorthEastIcon from '@mui/icons-material/NorthEast';
 import PhoneIcon from '@mui/icons-material/Phone';
 import Avatar from '@mui/material/Avatar';
-import { CopyToClipboard } from 'react-copy-to-clipboard';
-import { firstLetter, slicedWord, timeStampMessage, copied,emojisArr,prodAwsS3,getTimeBySeconds } from '../../../../../../helpers'
-import { removeMessageById,updateMessageById,pinMessageById } from "../../../../../../api-data";
+import { firstLetter, slicedWord, timeStampMessage,emojisArr,prodAwsS3,getTimeBySeconds } from '../../../../../../helpers'
+import { removeMessageById,updateMessageById } from "../../../../../../api-data";
 
 const StyledMenu = styled((props:any) => (
   <Menu
@@ -211,27 +206,22 @@ interface IMessageRightCall {
   duration: number,
   tongue: boolean,
   watched: boolean,
-  edited: boolean,
   avatarUrl: string,
   color: string,
   name:string,
   lastName:string,
   createdAt: string,
-  caption: string,
   emoji: string,
   emojiCompanion: string,
-  pinned: boolean,
   isSomeSelected: boolean,
   isSelected:(_id:string) => boolean,
   handleSelected: (_id:string) => void,  
   _id: string,
   nightMode: boolean,
   handleReply: (_id: string) => void,
-  handleForward: (_id: string) => void,
-  handleEdit:(_id: string) => void,
 }
 
-const MessageRightCall = ({message,initiator,duration,tongue,watched,edited,avatarUrl,color,name,lastName,createdAt,caption,emoji,emojiCompanion,pinned,isSomeSelected,isSelected,handleSelected,_id,nightMode,handleReply,handleForward,handleEdit}:IMessageRightCall) => {
+const MessageRightCall = ({message,initiator,duration,tongue,watched,avatarUrl,color,name,lastName,createdAt,emoji,emojiCompanion,isSomeSelected,isSelected,handleSelected,_id,nightMode,handleReply}:IMessageRightCall) => {
   const classes = useStyles();
   const [anchorEl, setAnchorEl] = useState<any>(null);
   const [selected, setSelected] = useState<boolean>(false);
@@ -239,7 +229,6 @@ const MessageRightCall = ({message,initiator,duration,tongue,watched,edited,avat
   const open = Boolean(anchorEl);
   const checked = isSelected(_id)
   const handleClose = (type: string | undefined): void => {
-    if (type === 'copy') copied('Text')
     if (type === 'delete') setModal(true)
       setAnchorEl(null)
       setSelected(false)
@@ -261,8 +250,8 @@ const MessageRightCall = ({message,initiator,duration,tongue,watched,edited,avat
   
   const handleEmojiMenu = ({ target }: any): void => {
     const idEmoji = target.id
-    if (idEmoji === emoji) {updateMessageById(_id,'')  
-    } else updateMessageById(_id,idEmoji)
+    if (idEmoji === emoji) updateMessageById(_id,'')  
+     else updateMessageById(_id,idEmoji)
   }  
 
   return (
@@ -274,7 +263,7 @@ const MessageRightCall = ({message,initiator,duration,tongue,watched,edited,avat
           ${firstLetter(lastName)}${slicedWord(lastName, 15, 1)}`}
         </Typography>
         <div className={classes.wrapperInner}>
-          <Typography style={{color: "#00b333"}} variant="h6" align="right">
+          <Typography style={{color: "#363636"}} variant="h6" align="right">
             {message}
           </Typography>
           <PhoneIcon style={{color:'#18bd03'}} fontSize='large' />
@@ -312,36 +301,7 @@ const MessageRightCall = ({message,initiator,duration,tongue,watched,edited,avat
         }}>
           <ReplyIcon />
           Reply
-        </MenuItem>
-        <MenuItem onClick={() => {
-            handleForward(_id)
-            handleClose(undefined)
-        }}>
-            <ReplyIcon style={{transform :'rotateY(180deg)'}} />
-            Forward
-        </MenuItem>           
-        <MenuItem onClick={() => {
-            handleEdit(_id)
-            handleClose(undefined)
-        }}>
-            <EditIcon/>
-            Edit
-        </MenuItem>        
-          <CopyToClipboard onCopy={() => handleClose('copy')} text={`${message ? message : ''} ${caption ? caption : ''}`}>
-          <MenuItem>
-            <ContentCopyIcon />
-             Copy Text
-          </MenuItem>
-        </CopyToClipboard>
-        <MenuItem onClick={() => {
-          pinMessageById(_id, !pinned)
-          handleClose(undefined)
-        }}>
-            {pinned ?
-              <CloseIcon className={classes.iconClose} /> :
-              <PushPinIcon />}
-             {pinned?'Unpin':'Pin'}
-        </MenuItem>           
+        </MenuItem>                           
         <MenuItem onClick={() => {
             handleSelected(_id)
             handleClose(undefined)

+ 0 - 9
src/components/HomePage/CentralBar/ChatBar/index.tsx

@@ -304,23 +304,19 @@ const ChatBar = ({chatDivRef,selectedArr,setSelectedArr,isSomeSelected,setIsSome
                duration={duration}
                tongue={isTongue}
                watched={!unread}
-               edited={edited}
                avatarUrl={avatarUrl}
                color={color}
                createdAt={createdAt}
                name={name}
                lastName={lastName}
-               caption={caption}
                emoji={emoji}
                emojiCompanion={emojiCompanion}
-               pinned={pinned}
                isSomeSelected={isSomeSelected}
                isSelected={isSelected}
                handleSelected={handleSelected}
                _id={_id}
                nightMode={nightMode}
                handleReply={handleReply}
-               handleForward={handleForward} 
                /></div>)            
             if (type === 'text' && !oldId && !companionIdForwardToAndFrom && !deleted) return (<div key={createdAt} id={_id} style={{borderRadius: 7}}> 
               {isTime&&<MessageDivider message={timeStampFilter(createdAt)}/>}
@@ -558,24 +554,19 @@ const ChatBar = ({chatDivRef,selectedArr,setSelectedArr,isSomeSelected,setIsSome
                 duration={duration}
                 tongue={isTongue}
                 watched={watched}
-                edited={edited}
                 avatarUrl={avatarUrl}
                 color={color}
                 createdAt={createdAt}
                 name={name}
                 lastName={lastName}
-                caption={caption}
                 emoji={emoji}
                 emojiCompanion={emojiCompanion}
-                pinned={pinned}
                 isSomeSelected={isSomeSelected}
                 isSelected={isSelected}
                 handleSelected={handleSelected}                
                 _id={_id}
                 nightMode={nightMode}
                 handleReply={handleReply}
-                handleForward={handleForward}
-                handleEdit={handleEdit}
                 /></div>)            
             if (type === 'text' && !oldId && !companionIdForwardToAndFrom && !deleted) return (<div key={createdAt} id={_id} style={{borderRadius: 7}}>
               {isTime&&<MessageDivider message={timeStampFilter(createdAt)}/>}

+ 2 - 2
src/helpers/index.ts

@@ -162,8 +162,8 @@ const emojisArr = ['💘','😀','😍','😲','😡']
 
 let prodBaseURL = 'https://w-telegram.herokuapp.com'
 let prodSocketURL = 'https://w-telegram-socket.herokuapp.com'
-prodSocketURL = 'http://localhost:3001'
-prodBaseURL = 'http://localhost:3000'
+// prodSocketURL = 'http://localhost:3001'
+// prodBaseURL = 'http://localhost:3000'
 
 const prodAwsS3 = 'https://my-telegram-bucket.s3.eu-west-1.amazonaws.com'