Giter VIP home page Giter VIP logo

chat_application's Introduction

JS Mastery Pro

chat_application's People

Contributors

adrianhajdin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chat_application's Issues

error

Failed to load resource: the server responded with a status of 404

Chats are not showing

Hi a few days ago I started to do this project and after I successfully compiled everything without an error on all scripts I run the command npm run but when the app is starting on Microsoft Edge the Chats are not visible, can somebody help me, please?

H

Module not found: error: can't resolve './App'

Time

How can I add the published time of messages?

exports error in react chat app

PS D:\Dialog flow\react-prepration\chat_application> npm start

[email protected] start
react-scripts start

node:internal/modules/cjs/loader:488
throw e;
^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in D:\Dialog flow\react-prepration\chat_application\node_modules\postcss-safe-parser\node_modules\postcss\package.json
at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:429:9)
at packageExportsResolve (node:internal/modules/esm/resolve:683:3)
at resolveExports (node:internal/modules/cjs/loader:482:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (D:\Dialog flow\react-prepration\chat_application\node_modules\postcss-safe-parser\lib\safe-parser.js:1:17) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v17.3.0

Hey guys , an issue I keep running into

"Compiled with problems:X

ERROR in ./src/App.js 5:0-46

Module not found: Error: Cannot find file: 'ChatFeed.jsx' does not match the corresponding name on disk: '.\src\components\Components'.

ERROR in ./src/App.js 6:0-46

Module not found: Error: Cannot find file: 'LoginForm.jsx' does not match the corresponding name on disk: '.\src\components\Components'."

Is the issue I'm not sure why everything is in place and seems fine thinking its the program/ computer can someone check it for me? or have an idea what it may be

I have html tags that show with my message , can you please help - Thank you

tag

this is the code of MyMessage :

const MyMessage = ({message}) => {
if (message.attachments && message.attachments.length>0) {

    return (
        <img
         src={message.attachments[0].file}
          alt="message-attachment" 
          className="message-image" 
          style={{float :'right'}}
          />

    )

}
return ( 
    <div className="message" style={{float:'right' , marginRight:'18px',color:'white' , backgroundColor :'#3B2A50'}}> 
        {message.text} 
    </div>  
);

};

export default MyMessage ;

This is the code of Chatfeed :

import MessageForm from './MessageForm' ;
import MyMessage from './MyMessage' ;
import TheirMessage from './TheirMessage' ;
const ChatFeed = (props) => {
const { chats , activeChat , userName , messages} = props ;

const chat = chats && chats[activeChat] ; 

const renderMessages = () => { 

    const keys = Object.keys(messages) ; 

    return keys.map((key ,index) => { 
        const message = messages[key]; 
        const lastMessageKey = index === 0 ? null : keys[index-1] ;
        const isMyMessage = userName ===message.sender.username;

        return ( 
            <div key={`msg_${index}`} style ={{ width :'100%' }}> 
         <div className="message-block">
        {isMyMessage
          ? <MyMessage message={message} />
          : <TheirMessage message={message} lastMessage={messages[lastMessageKey]} />}
      </div>
            <div className="read-receipts"  style= {{ marginright : isMyMessage? '18px': '0px', marginLeft : isMyMessage ?'0px':'68px'}}>
            read-receipts

            </div>
            
            </div>
            
        )
    })
}


if (!chat)  return 'Loading..' ; 
return  ( 
    <div className="chat-feed" > 
    <div className="chat-title-container">
        <div className="chat-title">  {chat.title}</div>

        <div className="chat-subtitle"> {chat.people.map((person)=>` ${person.person.username}`)} </div>
         </div>
       { renderMessages() }
       
       <div style={{ height: '100px' }} />
  <div className="message-form-container">
    <MessageForm {...props} chatId={activeChat} />
  </div>
</div>
     
);

}

export default ChatFeed ;

Custom File Preview

Hello, I would like the app to display a preview image for files that are not photos. How do we go about that? I appreciate your timely feedback. Thank you.

Hi I am facing this problem

TypeError: Cannot read property 'username' of undefined

When
6 | const isFirstMessageByUser = !lastMessage || lastMessage.sender.username!==message.sender.username;

when the lastMessage is undefined like messages[null]

This error occurred during the build time and cannot be dismissed.

./src/components/ChatFeed.jsx 125:10
Module parse failed: Unexpected token (125:10)
You may need an appropriate loader to handle this file type.
| columnNumber: 9
| }

}, chat?.title), /#PURE/React.createElement("div", {
| className: "chat-subtitle",
| __self: _this,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.