0.2.5 • Published 12 months ago

volkeno-react-messenger v0.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

volkeno-react-messenger

The 'volkeno-react-messenger' module is a powerful and flexible messaging solution designed specifically for Volkeno's internal needs. Seamlessly integrating with Volkeno's internal data structure, this module provides a smooth and intuitive messaging experience for users.

NPM JavaScript Style Guide

Install

npm install --save volkeno-react-messenger

Usage

import VolkenoReactMessenger from 'volkeno-react-messenger'
import 'volkeno-react-messenger/dist/index.css'

class Example extends Component {
  render() {
    return (
      <VolkenoReactMessenger
        user={user}
        token={'token'}
        apiBaseUrl={'api_base_url'}
        setApiPostEndpoint={'/api/messages'}
        setApiListUsersEndpoint={'/api/List_user_url'}
        setApiConversationUserEndpoint={'/api/List_conversation_user_url'}
        socketUrl={'socket_url'}
     />
    )
  }
}

Configuration - Props

Props require

PropertyTypeRequiredValueDefaultDescription
userobjecttrue-{ }Provide logged in user data
tokenstringtrue-' 'Provide logged in user token
apiBaseUrlstringtrue-' 'Provide api base url
setApiPostEndpointstringfalse-'/api/messages'Provide the endpoint to post messages
setApiListUsersEndpointstringtrue-' 'Provide an endpoint for the first list or list of all users the user can chat with
setApiConversationUserEndpointstringtrue-' 'Provide the endpoint for the user's list of all conversations
<!--socketUrlstringtrue'164.92.136.142:4026'Provide socket url-->

Other props

PropertyTypeRequiredValueDefaultDescription
titlestringfalse-'Messagerie'Set the name of the chat
newMessageTitlestringfalse-'Nouvelle discussion'Set the name of new discussion modal
setStylestringfalse'yad' | 'dag''yad'Set the messaging style
isMultiListbooleanfalse-'false'Define whether the list of users for chat is multiple or not
setSecondListUsersEndpointstringfalse-' 'Provide an endpoint for the second list the user can chat with
setFirstListLabelstringfalse-'Liste utilisateurs'Set label for first user list
setSecondListLabelstringfalse-'Liste utilisateur 2'Set label for second user list
dataStructurestringfalse'old' | 'new''old'Define the messaging databstructure

Styles

Some attribute for custom css

Attribute ('yad' / 'dag')TargetDescription
._3oISP / ._Ib6zqText block of messages sendTo be used to customize the style of the block for messages sent by the user
._N0eEV /  ._3PC7-Text block of received messagesUse to customize the style of the block for messages received by the user
._3-4mn /  ._2RbgVInput textareaUse to customize the style of the textarea input
._3rDVm /  ._3kpUpInput searchUse to customize the style of the conversations input search
._yBqpy /  ._13Qr-Button new conversationUse to customize the style of the add new conversation button
._3sqmx /  ._300klConversation itemUse to customize the style of conversation items (list-group-item)
._3nSUg /  ._2o4zqConversation (user name)Use to customize the username style in conversation item
._P9G0Y /  ._35ReqConversation (time)Use to customize the style of the sending date in conversation item
._1RfSY /  ._1RfSYConversation (last message preview)Use to customize the style of the preview of the last message in conversation item
._1wrfJModal (user item)To be used to customize the style of the user list of the new discussion modal

Troubleshoot

After installing the module, you may notice a style problem regarding the active conversation. This is due to the default style of bootstrap | react bootstrap. Add these lines of css code to your index.css file and that should solve the problem :)

Yad style

._3sqmx {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
._3sqmx.active,
._3sqmx:hover {
  background-color: #F5F6FD;
  border-color: #F5F6FD;
  color: #102844;
  cursor: pointer !important;
}

Dag style

._300kl {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
._300kl.active,
._300kl:hover {
  background-color: #00C2CB1A;
  border: none;
  color: #1D2026;
  cursor: pointer !important;
}

License

MIT © Papaul-msibiii

0.1.0

1 year ago

0.2.1

1 year ago

0.1.2

1 year ago

0.2.0

1 year ago

0.1.1

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.9

1 year ago

0.2.3

1 year ago

0.1.4

1 year ago

0.2.2

1 year ago

0.1.3

1 year ago

0.2.5

12 months ago

0.1.6

1 year ago

0.2.4

1 year ago

0.1.5

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.10

1 year ago

0.0.21

1 year ago

0.0.11

1 year ago

0.0.12

1 year ago

0.0.20

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago