Giter Site home page Giter Site logo

garando / react-freshdesk-widget Goto Github PK

View Code? Open in Web Editor NEW

This project forked from personare/react-freshdesk-widget

0.0 1.0 0.0 437 KB

:speech_balloon: A component of React for use the Freshdesk Widget

License: MIT License

JavaScript 100.00%

react-freshdesk-widget's Introduction

react-freshdesk-widget Build Status

A component of React for use the Freshdesk Widget


Freshdesk Logotype


Demo

Check it live :)

Installation

npm install @personare/react-freshdesk-widget --save

Basic Usage

import FreshdeskWidget from '@personare/react-freshdesk-widget';

...
render() {
    return (
        <FreshdeskWidget url="https://support.freshdesk.com" />
    );
}
...

Freshdesk Incorporated Widget

With custom button

import FreshdeskWidget from '@personare/react-freshdesk-widget';

...
render() {
    return (
        <FreshdeskWidget url="https://support.freshdesk.com" type="pop-up">
            <button>Send Feedback</button>
        </FreshdeskWidget>
    );
}
...

Freshdesk with custom button

Props

url (required)

An URL of the service of your Freshdesk

For example:

...
render() {
    return (
        <FreshdeskWidget url="https://support.freshdesk.com" />
    );
}
...

type - one of ['pop-up', 'incorporated']

The type of widget you want to insert the page.

Currently you can perform through two ways:

  1. Through a pop-up where the user must click to display the widget.
  2. Incorporating direct in your HTML.

default: incorporated

For example:

...
render() {
    return (
        <FreshdeskWidget 
            url="https://support.freshdesk.com"
            type="pop-up"
        />
    );
}
...

formTitle (optional)

What will be the title of the form.

default: Help and support

For example:

...
render() {
    return (
        <FreshdeskWidget 
            url="https://support.freshdesk.com"
            formTitle="This is a custom title"
        />
    );
}
...

formHeight

The height of the form.

default: 500px

For example:

...
render() {
    return (
        <FreshdeskWidget 
            url="https://support.freshdesk.com"
            formHeight="700px"
        />
    );
}
...

submitThanks

The message that appears after the user send feedback.

default: Thank you, one of our representatives will respond to you soon! =)

For example:

...
render() {
    return (
        <FreshdeskWidget 
            url="https://support.freshdesk.com"
            submitThanks="Thank you!!!"
        />
    );
}
...

buttonType - one of ['text', 'image']

The type of button when use pop-up.

default: text

Note: When do you use an image type is necessary to pass buttonBackgroundImage property.

For example:

...
render() {
    return (
        <FreshdeskWidget 
            url="https://support.freshdesk.com"
            type="pop-up"
            buttonType="image"
            buttonBackgroundImage="my-custom-button.png"
        />
    );
}
...

buttonText - (optional)

The text of button.

default: Support

For example:

...
render() {
    return (
        <FreshdeskWidget 
            url="https://support.freshdesk.com"
            type="pop-up"
            buttonType="text"
            buttonText="Send feedback!"
        />
    );
}
...

buttonColor - (optional)

The font color of button text.

default: white

For example:

...
render() {
    return (
        <FreshdeskWidget 
            url="https://support.freshdesk.com"
            type="pop-up"
            buttonType="text"
            buttonText="Send feedback!"
            buttonColor="yellow"
        />
    );
}
...

buttonBackgroundColor - (optional)

The background-color of button.

default: #015453

For example:

...
render() {
    return (
        <FreshdeskWidget 
            url="https://support.freshdesk.com"
            type="pop-up"
            buttonType="text"
            buttonText="Send feedback!"
            buttonColor="yellow"
            buttonBackgroundColor="#012471"
        />
    );
}
...

buttonPosition - one of ['left', 'right', 'top', 'bottom']

The position of button in the window.

default: top

For example:

...
render() {
    return (
        <FreshdeskWidget 
            url="https://support.freshdesk.com"
            type="pop-up"
            buttonType="text"
            buttonText="Send feedback!"
            buttonColor="yellow"
            buttonBackgroundColor="#012471"
            buttonPosition="bottom"
        />
    );
}
...

buttonOffset - (optional)

The offset of button.

default: 235px

For example:

...
render() {
    return (
        <FreshdeskWidget 
            url="https://support.freshdesk.com"
            type="pop-up"
            buttonType="text"
            buttonText="Send feedback!"
            buttonColor="yellow"
            buttonBackgroundColor="#012471"
            buttonPosition="bottom"
            buttonOffset="150px"
        />
    );
}
...

buttonBackgroundImage - (optional)

When you use the buttonType with image, need to specify the URL and this property is for this.

default: 235px

For example:

...
render() {
    return (
        <FreshdeskWidget 
            url="https://support.freshdesk.com"
            type="pop-up"
            buttonType="image"
            buttonBackgroundImage="http://localhost/my-custom-image.png"
            buttonPosition="bottom"
            buttonOffset="150px"
        />
    );
}
...

Development

To start developing in the project run:

npm run serve

Then ready at http://localhost:9001.

Tests

Just run:

npm run tests

This scaffolding will be generated by @Personare/react-component-generator

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.