Feedback Workflow Component

A versatile interface for user communication, offering options to report issues, provide feedback, request features, or contact support, ensuring user engagement and problem-solving.

Components Visuals

Installation

To install the Quest react-native-sdk into your project, follow these steps:

  • Open your terminal/command prompt.

  • Navigate to your project's root directory using the cd command if you're not already there.

  • Run the following command to install the quest-sdk package using npm:

npm install @questlabs/react-native-sdk

This command will download and install the package and its dependencies into your project.

Make sure your project has npm and Node.js installed, and that you have the necessary permissions to install packages in your project directory.

Usage

Root Component

  • Import the QuestProvider Component: Import the QuestProvider component from the @questlabs/react-sdk package.

import { QuestProvider } from '@questlabs/react-sdk';
  • Pass the Required Props: Pass the required props to the QuestProvider. The required props are apiKey, apiSecret, entityId and authenticationToken.

Component Usage

To integrate the FeedBackWorkFlow component into your React native application, follow these steps.

  • Import useFeedBackWorkFlow Hook: Import the useFeedBackWorkFlow component from the @questlabs/react-sdk package.

  • Import the FeedBackWorkFlow Component: Import the FeedBackWorkFlow component from the @questlabs/react-sdk package.

  • Pass the Required Props: Pass the required props to the useFeedBackWorkFlow . The required props are questId, questUserId, and userToken or if user don't have quest User id then they can pass own userId to get questUserId and Token.

import { FeedBackWorkFlow , useFeedBackWorkFlow } from "@questlabs/react-native-sdk";

Don't not use QuestProvider and useFeedBackWorkFlow Hook in same file.

Props of FeedBackWorkFlow Component

The Onboarding component accepts the following props

Props NameTypeRequireDetails

ContactUs

object

optional

For card And inner form heading and description

GeneralFeedback

object

optional

For card And inner form heading and description

ReportBug

object

optional

For card And inner form heading and description

RequestFeature

object

optional

For card And inner form heading and description

contactUrl

String

optional

Support team contact URL.

onCross

Function

optional

create the function for onCross.

onError

Function

optional

For Showing the Error.

questUserId

string

optional

provied quest user id

userToken

string

optional

Provied quest token

actions

ICriteria[]

optional

user need to provied filled data related to the section action name.

loading

boolean

optional

don't use in offline mode.

campaignVariationId

string

optional

Id For verification.

styleConfig

object

optional

An object containing Styling properties for styling various components within the get started process, including form, topbar, headings, descriptions, and buttons.

Styles Props

styleConfig {
  Heading?: TextStyle;
  Description?: TextStyle;
  TopBar?: ViewStyle;
  Form?: ViewStyle;
  Label?: TextStyle;
  Input?: ViewStyle;
  PrimaryButton?: ViewStyle;
  Footer?: {
    FooterStyle?: ViewStyle;
    FooterText?: TextStyle;
    FooterIcon?: TextStyle;
  };
  listHeading?: TextStyle;
  listDescription?: TextStyle;
  Card?: ViewStyle;
  ThanksPopup?: { ShowFooter?: boolean };
}

Example Usage

App.js

import { SafeAreaView, StyleSheet, StatusBar } from "react-native";
import React, { useState } from "react";
import { QuestProvider } from "@questlabs/react-native-sdk";
import DemoComponent from "./DemoComponent";

export default function App() {
return (
    <SafeAreaView style={styles.container}>
      <StatusBar />
      <QuestProvider
        apiKey="Your-Api-Key"
        apiSecret="Your-Api-Secret"
        entityId="Your-Api-entityId"
        authenticationToken="Your-authentication-token"  >
        
        <DemoComponent />
        
        </QuestProvider>
   
    </SafeAreaView>
  );
}

DemoComponent.tsx

import React from "react";
import {FeedBackWorkFlow ,useFeedBackWorkFlow} from "@questlabs/react-native-sdk";
const DemoComponent = () => {
  // const FeedBackWorkFlow= useFeedBackWorkFlow({
  //   questId: "Your-Quest_ID" ,
  //   userId:"5235trfet365try67ywry5"
  //   })

  const FeedBackWorkFlow = useFeedBackWorkFlow({
    questId: "Your-Quest_ID" ,
    questUserId: "Your-user-id",
    questToken: "Your-Token-id" 
    });
  return (
    <>
      <FeedBackWorkFlow
        questToken={feedback.questToken}
        questUserId={feedback.questUserId}
        actions={feedback.actions}
        loading={feedback.loading}
        ContactUs={{
          // heading:"My Contact",
          description: "this is the contact info",
        }}
        GeneralFeedback={{
          formHeading:"form heading genral",
          // heading:"My Genral",
          description: "This is the genral feedback",
        }}
        ReportBug={{
          // heading:"my Bug",
          formHeading:"form heading bug",
          description: "This is the bug report",
        }}
        RequestFeature={{
          // heading:"my feature",
          description: "please request for the feature",
        }}
        onError={console.log}
        contactUrl="https://calendly.com/shubham-quest/chat"
      styleConfig={{
       Form:{backgroundColor:"#c8cde6"},
       Card:{backgroundColor:"#a1aad4",marginVertical:5,borderRadius:10},
       Description:{color:"red"},
       Footer:{
        FooterIcon:{color:"red"},
        FooterStyle:{backgroundColor:"#63677a"}
       },
       Heading:{color:"red"},
       Input:{backgroundColor:"#bec1cf"},
       Label:{color:"blue"},
       listDescription:{color:"yellow"},
       listHeading:{color:"#0c1436"},
       PrimaryButton:{backgroundColor:"#434a6e"},
       ThanksPopup:{
        ShowFooter:true
       }
      }}
      />
    </>
  );
};
export default DemoComponent;

Demo

Last updated