0.1.3 • Published 2 years ago

mercury-react-chat-test v0.1.3

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Mercury Chat - React Chat

Welcome To Mercury Chat! This library is used to seamlessly embed Cardano Wallet to Wallet communication into any Cardano Application!

This library supports React / NextJS. We have other libraries that support Vue3 and Vue2

1: Installation:

npm install @mercury-chat/react-chat

2: Usage:

The aim of Mercury Chat is to be able to embed a chat system into your application as seamlessly as possible (ideally with only 1 line of code).

Import MercuryChat into a component like this:

import { MercuryChat } from '@mercury-chat/react-chat';

And use it inside a component like this:

<MercuryChat />

The default MercuryChat implementation has a chat button appear the bottom right of the component (you can place such that the chat bubble appears in the bottom right section of the screen)

3: Optional Parameters

MercuryChat has several optional props that can be used to customize functionality

<MercuryChat position={'bottom-right'} hasFullscreen={true} showBackground={true} />
  • position: 'bottom-right' | 'standard' - defaults to 'bottom-right'. The position prop determines where on the screen the chat bubble will appear. If the position is 'bottom-right' than the chat bubble will appear on the bottom right of the component. If the position is 'standard' the chat bubble can be moved around the component at will.

  • hasFullscreen: boolean - defaults to true. The hasFullscreen prop determines if the chat will open up in a large screen or not. Some dapps may want fullscreen chat, while others such as NFT marketplaces may want to turn hasFullscreen to false to allow users to browse the marketplace while chatting

  • showBackground: boolean - defaults to true. The showBackground tag determines if there will be a black transparent background behind the chat that will be clickable to close the chat

  • triggerMercury: number - defaults to 0. This allows the client application to control the opening and closing of Mercury with their own system. Pass 1 into this prop to open Mercury, and pass 2 into this prop to close Mercury. Passing 0 into this prop will have control be given over to the standard component button.

  • showNotifications: boolean - defaults to true. This prop determines if the user will see a red notification circle in the top left of their image when Mercury is closed.

  • showNotificationNumbers: boolean - defaults to true. This prop determines if a user will see numbers in the red notification circle.

  • onOpen: function - defaults to () => void 0. A callback function you can use to trigger functionality when Mercury is opened.

  • onClose: function - defaults to () => void 0. A callback function you can use to trigger functionality when Mercury is closed.

  • onSignIn: function - defaults to () => void 0. A callback function you can use to trigger functionality when a user signs into Mercury.

  • onSignOut: function - defaults to () => void 0. A callback function you can use to trigger functionality when a user signs out of Mercury.

  • chatImage: string - defaults to "https://saturn-production.nyc3.digitaloceanspaces.com/Assets/chat-ocean-500.png". The URL of a hosted chat image. This image will be the chat image that is seen by your users.

  • hoverChatImage: string - defaults to "https://saturn-production.nyc3.digitaloceanspaces.com/Assets/chat-ocean-900.png". The URL of a hosted hover chat image. This image will be the chat image that is seen by your users when they are hovering over the chat image.

  • branding: strings - defaults to ''. This is used to adjust the branding inside Mercury and is a payed feature from the Mercury integration page

  • user: string - defaults to ''. This user can be a Cardano address or ADAHandle that will directly go to chat between the logged in user and the user that is set as this prop. Useful for buttons on a profile or sale page where you want users to quickly and directly chat. Functionality available in version 0.1.1.

  • message: string - defaults to ''. This will be a pre-written message that is loaded into the users message bar when they open Mercury. The user does not have to send this message. Functionality available in version 0.1.1.

  • community: string - defaults to ''. This is the community that will open up when the user opens Mercury. Useful for giving users visibility into your community. Functionality available in version 0.1.1.

  • dappCommunity: string - defaults to ''. This is the community that will exist at the top of the community panel while Mercury is open. Useful for giving users visibility into your community. Functionality available in version 0.1.1.

If you have any feedback or suggestions you can message them in the Town Square on Mercury Chat or ask on our Twitter or Discord (http://discord.gg/NvVNfQmPjp)

I hope you all enjoy chatting!

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago