GithubHelp home page GithubHelp logo

codebrahma / react-chat Goto Github PK

View Code? Open in Web Editor NEW
11.0 13.0 3.0 1.72 MB

Highly customizable / Themable set of components to build your chat app

Home Page: https://codebrahma-lite-chat.netlify.com/

License: MIT License

HTML 0.20% JavaScript 15.90% CSS 83.90%
react chat reusable-components chat-ui react-components

react-chat's Introduction

React Chat Components

React Chat Components is a library of reusable and customizable components for building chat applications in React. Use the default components and themes or modify as you like with your own styles.

Usage:

  1. You can start using our already built user interface right away by :
import React from 'react';
import { ChatListProvider } from './components/'
		
const App = () => {
  return (
    <ChatListProvider userData={yourUserData}/>
  )
}
    
export default App; 

Note : The userData prop is required for displaying the list. If the prop is not passed, only the header and the search bar are rendered.

  1. To use a custom styling, you can pass a chatProviderClass to the ChatListProvider component.
import React from 'react';
import { ChatListProvider } from './components/'
		
const App = () => {
  return (
    <ChatListProvider 
      userData={yourUserData} 
      chatProviderClass="custom-chat-provider-class"
    />
  )
}

export default App;

Similarily, you can pass your own styles to other default components.

Example:

import React from 'react';
import { ChatListProvider, 
  ChatList,  
  ChatListHeader, 
  ChatListSearch 
} from './components';
    
const App = () => {
  return (
    <ChatListProvider 
      userData = {yourUserData}
      chatProviderClass = "your-custom-chat-provider-class" 
    >
      <ChatListHeader 
	chatHeaderClass = "your-custom-chat-header-class"
      />
      <ChatList 
	chatListClass = "your-custom-chat-list-class"
      />
      <ChatListSearch 
	chatSearchClass = "your-custom-chat-search-class"
      />
    </ChatListProvider>
  )
}

export default App; 
  1. To use your custom components for the child components, i.e., Chat List,Chat Header and Chat Search, you can pass your custom built components either as children or as props.
import React from 'react';
import { ChatListProvider } from './components/'
		
const App = () => {
  return (
    <ChatListProvider 
      userData = {yourUserData} 
      customHeader = {//your custom Header}
      customList = {//your custom List}
      customsearch = {//your custom Seacrh bar}
    />
  )
}
    
export default App; 

Components

ChatListProvider

This is the main component and can be used as the only component to start up and use React Chat Component's default interface.

Props :

Prop name Prop type Description
userData object (required) This prop is used for passing user data for rendering the list of users.
chatProviderClass string (optional) This prop can be used for passing custom style for the component.
customHeader react component (optional) This prop can be used for passing custom header component.
customList react component (optional) This prop can be used for passing custom list component.
customSearch react component (optional) This prop can be used for passing custom search component.

ChatList

This is the component containing the list of all users along with their names, avatars and other details.

Props :

Prop name Prop type Description
chatListClass string (optional) This prop can be used for passing custom style for the component.
customChatListItem react component (optional) This prop can be used for passing custom chat list item component.

ChatListHeader

This is the header component of the chat list box.

Props :

Prop name Prop type Description
chatHeaderClass string (optional) This prop can be used for passing custom style for the component.

ChatListSearch

This is the search bar component of the chat list box.

Props :

Prop name Prop type Description
chatSearchClass string (optional) This prop can be used for passing custom style for the component.

User data object :

{
  id: 0,
  avatar: require(urlToAvatarImage),
  name: "Username",
  onlineStatus: "online",
  lastSeen: // last seen time as a Date() object ,
  previewMessage: "Lorem ipsum dolor sit amet.",
  messages: [
    {
      messageId: 1,
      text: 'message text',
      receivedFrom: {},
    },
  ]
}

react-chat's People

Contributors

krrish96 avatar prasanna1211 avatar rishichawda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

react-chat's Issues

Minor CSS fixes

  1. Overflow doesn't work on chat list
  2. Increase font size for type a message placeholder
  3. Increase navbar height and change title as React Chat Components

Adding Emoji functionality

  1. Functionality to add emoji should be there.
  2. By default we should be able to pick a light weight emoji picker.
  3. User can opt out for emoji since it adds additional weight. (Consider on demand loading)
  4. Our API to handle emoji should be flexible enough to change in any customized emoji

Webpack version issue

Because of older version of webpack following error happening.
`(base) administrator@dolap:~/Documents/trail/React-Chat$ yarn start
yarn run v1.12.3
$ webpack-dev-server --mode development --open --hot
/home/administrator/Documents/trail/React-Chat/node_modules/webpack-cli/bin/config-yargs.js:89
describe: optionsSchema.definitions.output.properties.path.description,
^

TypeError: Cannot read property 'properties' of undefined
at module.exports (/home/administrator/Documents/trail/React-Chat/node_modules/webpack-cli/bin/config-yargs.js:89:48)
at Object. (/home/administrator/Documents/trail/React-Chat/node_modules/webpack-dev-server/bin/webpack-dev-server.js:65:25)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47
`

Scrollbar on received status

Scroll bar when we receive message should naturally go down to the latest message. Not sure if this feature is already there since the demo page don't have those.

Adding uploader functionality

  1. Users can upload any data.
  2. It should ask for image / Video / any other docs. If image or video then it should display it as a viewable content.
  3. This feature should be opt in.

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.