Skip to content

Instantly share code, notes, and snippets.

@buddyeorl
Last active October 13, 2020 06:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buddyeorl/896d2ab5e0411676ebc1eef739805457 to your computer and use it in GitHub Desktop.
Save buddyeorl/896d2ab5e0411676ebc1eef739805457 to your computer and use it in GitHub Desktop.
import React from 'react';
import ChatButton from '../PathToChatButton;
//ChatButton props:
//label:string
//shadow:boolean <= shows the activity indicator
//direction:enum string <= options:left, right,left-reversed,right-reveresed
//onClick:function <= custom function to handle on click events.
//send: boolean <= if true, the shape of the button change to rectangle and color green
// if (send === true), ChatButton MUST be wrapped by a position relative parent
const Example=()=>{
return(
<React.Fragment>
<ChatButton label={'Try me'} shadow={true} direction='right-reversed' />
<ChatButton label={'Try me'} shadow={true} direction='right' />
<ChatButton label={'Try me'} shadow={true} direction='lefts-reversed' />
<ChatButton label={'Try me'} shadow={true} />
<div style={{ width: '300px', position: 'relative' }}>
<ChatButton label={'Try rectangle button'} shadow={true} send={true} onClick={()=>{alert("I'm the only button with onClick events")}}/>
</div>
</React.Fragment>
)}
export default Example;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment