1.1.5-alpha.9 • Published 11 months ago

@toppr-engg/instalearn-components v1.1.5-alpha.9

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago
import { SearchPageComponent } from '@toppr-engg/instalearn-components/lib/esm';
import '@toppr-engg/instalearn-components/lib/esm/index.css';

function SearchPage() {
  return (
    <SearchPageComponent
      apiBaseUrl={apiBaseUrl}
      origin={origin}
      userId={userId}
      authKey={authKey}
      docToken={docToken}
      docApiBaseUrl={docApiBaseUrl}
      docClientId={docClientId}
      searchText={searchText}
      searchType={searchType}
      imageData={imageData}
      showActivationCta={showActivationCta}
      activationBarCtaHeading={activationBarCtaHeading}
      activationBarCtaSubHeading={activationBarCtaSubHeading}
      activationBarPositioningClassName={activationBarPositioningClassName}
      activationBarColorClassName={activationBarColorClassName}
      layoutClassName={layoutClassName}
      handleSearchListClick={handleSearchListClick}
      getSubjectRelatedToSearch={getSubjectRelatedToSearch}
      handleActivationCtaClick={handleActivationCtaClick}
      handleRenewClick={handleRenewClick}
      isTodFeature={isTodFeature}
      isPaymentDone={isPaymentDone}
      isUserVisitedFirstTime={isUserVisitedFirstTime}
      handleBackClick={handleBackClick}
      showBackButton={showBackButton}
    />
  );
}

PROPS TABLE

PropsDescriptionTypeRequired
apiBaseUrlBase path of search apis (Default is prod Api)stringNo
originFrom which source api is being called (Default value is instalearn)stringYes
userIdId of the usernumberYes
authKeySearch QnA Service Auth keystringYes
docTokenUser Token for instant doubt solverstringYes
docApiBaseUrlBase path of instant doubt solver api's (Default is prod Api)stringNo
docClientIdSpecific to tenantsstringYes
searchTextText search by userstringYes
searchTypeType of search whether its is image or text. (Default type is text)stringYes
imageDataImage data in base64 formatstringNo
showActivationCtawhether to show/hide the activation cta (Default value is false)booleanNo
activationBarCtaHeadingHeading on the Activation Bar (Default value is Need more explanation?)stringNo
activationBarCtaSubHeadingSubHeading on the Activation Bar (Default value is Connect to a tutor)stringNo
activationBarPositioningClassNameTo change the positioning of the Activation BarstringNo
activationBarColorClassNameTo change the background color of the Activation BarstringNo
layoutClassNameTo change the layout of the search pagestringNo
handleSearchListClickTo handle the click on search result ListfunctionYes
getSubjectRelatedToSearchTo get the subjectId based on search TextfunctionYes
handleActivationCtaClickTo handle click on activation BarfunctionNo
getSubjectRelatedToSearchTo get the subjectId based on search TextfunctionYes
handleRenewClickTo renew the doubt countfunctionNo
isTodFeatureto enable the tutor on demand feature (Default value is false)booleanNo
isPaymentDoneto show the banner regarding payment done (Default value is false)booleanNo
isUserVisitedFirstTimeto show the information about the product to the user (Default value is false)booleanNo
handleBackClickTo handle back clickfunctionyes
showBackButtonto show or hide the back button (Default value is true)booleanNo

Function Definitions

/**
 *  callback  to handle click on search result
 * @param {object} payload
 */
function handleSearchListClick(data) {}

/**
 *  callback to get the subjectId related to search
 * @param {number} subjectId
 */
function getSubjectRelatedToSearch({ subjectId }) {}

/**
 * callback to invoke ask tutor package
 * @param {string} imageData -   image data after uploading the image to s3 bucket .
 * @param {string} searchText -  text searched by user.
 * @param {string} searchType - image or text search.
 * @param {string} searchResultCount -  search result count.
 */
handleActivationCtaClick({
  imageData,
  searchText,
  searchType,
  searchResultCount: getSlicedSearchResultData?.length,
});
import { HomePageComponent } from '@toppr-engg/instalearn-components/lib/esm';
import '@toppr-engg/instalearn-components/lib/esm/index.css';
import '@toppr-engg/byjus-search-qna/lib/esm/index.css';

function HomePage() {
  return (
    <HomePageComponent
      apiBaseUrl={apiBaseUrl}
      origin={origin}
      userId={userId}
      authKey={authKey}
      docToken={docToken}
      docApiBaseUrl={docApiBaseUrl}
      docClientId={docClientId}
      heading={heading}
      bannerHeadingHTmlFormat={bannerHeadingHTmlFormat}
      bannerSubHeadingHTmlFormat={bannerSubHeadingHTmlFormat}
      videoBannerHeadingHtmlFormat={videoBannerHeadingHtmlFormat}
      videoBannerSubHeadingHtmlFormat={videoBannerSubHeadingHtmlFormat}
      isNewfeature={isNewfeature}
      showActivationCta={showActivationCta}
      showVideoBanner={showVideoBanner}
      askExpertBtnHeading={askExpertBtnHeading}
      askExpertBtnClassName={askExpertBtnClassName}
      layoutClassName={layoutClassName}
      onSuggestionClick={onSuggestionClick}
      onCustomSearch={onCustomSearch}
      handleRenewClick={handleRenewClick}
      isTodFeature={isTodFeature}
    />
  );
}

PROPS TABLE

PropsDescriptionTypeRequired
apiBaseUrlBase path of search apis (Default is prod Api)stringNo
originFrom which source api is being called (Default value is instalearn)stringYes
userIdId of the usernumberYes
authKeySearch QnA Service Auth keystringYes
headingHeading text on home Page (Default is Instant Doubt Solver)stringNo
bannerHeadingHTmlFormatHeading provide to the banner in html format used for styling or in text format (Default value : Connect with tutors & get your doubts resolved instantly )stringNo
bannerSubHeadingHTmlFormatSub-heading provide to the banner in html format used for styling or in text formatstringNo
videoBannerHeadingHtmlFormatHeading provide to the video banner in html format used for styling or in text format ( Default value : 1:1 doubt resolution over video calls )stringNo
videoBannerSubHeadingHtmlFormat'Get your questions resolved by tutors face to facestringYes
isNewfeatureTo show/hide new feature tag (Default value : true)booleanNo
showActivationCtawhether to show/hide the activation cta (Default value is false)booleanNo
askExpertBtnHeadingA string which is used for heading of a Button (Default : Ask a doubt)stringNo
askExpertBtnClassNameA string containing css which used for styling the button component.stringNo
layoutClassNameTo change the layout of the search pagestringNo
onSuggestionClickA function which gets triggered on clicking any suggestion itemfunctionYes
onCustomSearchA function which gets triggered on pressing enter after searchfunctionYes
handleActivationCtaClickTo handle click on activation BarfunctionNo
handleRenewClickTo renew the doubt countfunctionNo
isTodFeatureto able the tutor on demand (Default value is false)booleanNo
import { ImageUploadPopup } from '@toppr-engg/instalearn-components/lib/esm';
import '@toppr-engg/instalearn-components/lib/esm/index.css';

function Home() {
  return (
    <ImageUploadPopup
      onClosePopup={onClosePopup}
      onSubmitTextDoubt={onSubmitTextDoubt}
      onUploadImage={onUploadImage}
      onImageUploaded={onImageUploaded}
      onTypeCameraClick={onTypeCameraClick}
      initialScreenTitle={initialScreenTitle}
      cropScreenTitle={cropScreenTitle}
      imageUploadingTitle={imageUploadingTitle}
      apiBaseUrl={apiBaseUrl}
      authKey={authKey}
      userId={userId}
      docApiBaseUrl={docApiBaseUrl}
      docToken={docToken}
      docClientId={docClientId}
      directSearchViaAskADoubt={directSearchViaAskADoubt}
      isClickFromAskExpert={isClickFromAskExpert}
    />
  );
}

PROPS TABLE

PropsDescriptionTypeRequired
onClosePopupA function which gets called when popup is closedfunctionYes
onSubmitTextDoubtA function which gets called when text doubt is submittedfunctionYes
onUploadImageA function which gets called when image starts uploadingfunctionNo
onImageUploadedA function which gets called when image finishes uploadingfunctionYes
onTypeCameraClickA function which gets called when type image is clickedstringNo
initialScreenTitleA string corresponding to first screen titlestringNo
cropScreenTitleA string corresponding to crop screen titlestringNo
imageUploadingTitleA string corresponding to image uploading screen titlestringNo
apiBaseUrlA string corresponding to the base url for api calls. Default value is the prod api urlstringNo
authKeySearch QnA Service Auth keystringYes
userIdUser Id to be used in api calls usernumberNo
docApiBaseUrlBase path of instant doubt solver api's (Default is prod Api)stringNo
docTokenUser Token for instant doubt solverstringNo
docClientIdA unique id specific to tenantsstringNo
directSearchViaAskADoubtInvoke askTutor package on searching query(image/text) itembooleanNo
isClickFromAskExpertTo determine whether function invoked from clicking ask a doubt or from searchbooleanNo
imageCropperDataTo pass props for ImageCropper componentobjectNo
cameraWrapperDataTo pass props for CameraWrapper componentobjectNo

Function Definitions

/**
 * callback to handle click on click of cross icon
 *  @returns {Void}
 */
function onClosePopup() {}

/**
 * callback which gets triggered when a text doubt is submitted via the CTA
 * @param {string} typedText
 * @returns {Void}
 */
function onSubmitTextDoubt(typedText) {}

/**
 * callback which gets triggered when a user selects an image to upload
 * Consists of image src as a base64 string
 * @param {string} base64ImageData
 * @returns {Void}
 */
function onUploadImage(base64ImageData) {}

/**
 * callback to invoke ask tutor package
 * @param {object} data -  Consists of the api response and the base64 image data
 * {
 *   data: {
 *      status: {
 *         code: 200,
 *         isError: false,
 *      },
 *      text: "What is baye's theorem"
 *   }
 *   imageData: "base64 data of image"
 * }
 */
function onImageUploaded(data) {}
import { CameraWrapper } from '@toppr-engg/instalearn-components/lib/esm';
import '@toppr-engg/instalearn-components/lib/esm/index.css';

function Home() {
  return (
    <CameraWrapper
      onCameraClose={onCameraClose}
      onImageUploaded={onImageUploaded}
      onTypeClick={onTypeClick}
      apiBaseUrl={apiBaseUrl}
      authKey={authKey}
      userId={userId}
      cameraIconClassName={cameraIconClassName}
      footerClassName={footerClassName}
      videoConstraints={videoConstraints}
      modalData={modalData}
      cameraPermissionAskData={cameraPermissionAskData}
      cameraPermissionErrorData={cameraPermissionErrorData}
      imageCropperData={imageCropperData}
      reactWebcamData={reactWebcamData}
    />
  );
}

PROPS TABLE

PropsDescriptionTypeRequired
onCameraCloseA function which gets triggered when close is clickedfunctionYes
onImageUploadedA function which gets triggered when image gets uploadedfunctionYes
onTypeClickA function which gets triggered when type icon is clickedfunctionNo
apiBaseUrlA string corresponding to the base url for api calls. Default value is the prod api urlstringNo
authKeySearch QnA Service Auth keystringYes
userIdUser Id to be used in api calls usernumberNo
cameraIconClassNameA string containing css which appends to the camera icons cssstringNo
footerClassNameA string containing css which appends to the footer container cssstringNo
videoConstraintsAn object specifying the constraints for react-webcam libraryobjectNo
modalDataAn object for passing props to Modal componentobjectNo
cameraPermissionAskDataAn object for passing props to CameraPermission component for asking permission screenobjectNo
cameraPermissionErrorDataAn object for passing props to CameraPermission component for permission denied screenobjectNo
imageCropperDataAn object for passing props to ImageCropper component for permission denied screenobjectNo
reactWebcamDataAn object for passing props to ReactWebcam library componentobjectNo
isD4DeviceA boolean to conditionally render the D4CamerabooleanNo

Function Definitions

/**
 * callback to handle click on click of cross icon
 *  @returns {Void}
 */
function onCameraClose() {}

/**
 * callback which gets triggered when image gets uploaded
 * @param {object} data -  Consists of the api response and the base64 image data
 */
function onImageUploaded(data) {}

/**
 * callback which gets triggered when keyboard icon is clicked
 */
function onTypeClick() {}
import { ImageCropper } from '@toppr-engg/instalearn-components/lib/esm';
import '@toppr-engg/instalearn-components/lib/esm/index.css';

function Home() {
  return (
    <ImageCropper
      onGetEditedImage={onGetEditedImage}
      onDeleteImage={onDeleteImage}
      onClickBack={onClickBack}
      onCloseClick={onCloseClick}
      onSubmitImage={onSubmitImage}
      onGetImageRef={onGetImageRef}
      className={className}
      footerClassName={footerClassName}
      imgClassName={imgClassName}
      base64Img={base64Img}
      selectedFile={selectedFile}
      hideFooter={hideFooter}
      hideHeader={hideHeader}
      hideAnticlockwise={hideAnticlockwise}
      hideDeleteImage={hideDeleteImage}
      hideBack={hideBack}
      hideCross={hideCross}
      title={title}
      titleClassName={titleClassName}
      iconClassName={iconClassName}
      hideClockwise={hideClockwise}
      btnProps={btnProps}
      isImageAnimationVisible={isImageAnimationVisible}
      animationMessage={animationMessage}
      animationMessageClassName={animationMessageClassName}
      reactImageCropperData={reactImageCropperData}
    />
  );
}

PROPS TABLE

PropsDescriptionTypeRequired
onGetEditedImageA function which gets triggered when crop state is changed or image is rotated by userfunctionNo
onDeleteImageA function which gets called whenever the user clicks on the bin iconfunctionNo
onClickBackA function which gets called whenever the user clicks on the back icon
onCloseClickA function which gets called whenever the user clicks on the submit button iconfunctionYes
onSubmitImageA function which gets called whenever the user clicks on the submit button iconfunctionNo
onGetImageRefA function which gets called to give the ref of the selected imagefunctionNo
classNameA string containing css which appends to the container cssstringNo
footerClassNameA string containing css which appends to the footer container cssfunctionNo
imgClassNameA string containing css which appends to the selected imagestringNo
base64ImgA string containing base64 data of the imagestringNo
titleA string containing title of the image cropperstringNo
titleClassNameAA string containing css which appends to the titlestringNo
iconClassNameA string containing css which appends to the iconsstringNo
animationMessageA string containing the message to show when the final image is being processedstringNo
animationMessageClassNameA string containing the css which appends to the animation messagestringNo
selectedFileA file blob object for an imageobjectNo
hideFooterA boolean, if true hides the footerbooleanNo
hideHeaderA boolean, if true hides the headerbooleanNo
hideClockwiseA boolean, if true hides the rotate clockwise iconbooleanNo
hideAnticlockwiseA boolean, if true hides the rotate anticlockwise iconbooleanNo
hideDeleteImageA boolean, if true hides the delete iconbooleanNo
hideBackA boolean, if true hides the back iconbooleanNo
hideCrossA boolean, if true hides the cross iconbooleanNo
btnPropsAn object which contains the btn propsobjectNo
isImageAnimationVisibleA boolean which denotes when to show the animationbooleanNo
reactImageCropperDataAn object for passing props in react-image-crop lib componentobjectNo

Function Definitions

/**
 * callback to handle click on click of cross icon
 *  @returns {Void}
 */
function onCloseClick() {}

/**
 * callback to handle click on click of back icon
 *  @returns {Void}
 */
function onClickBack() {}

/**
 * A callback which gets triggered when crop state is changed or image is rotated by user
 * @param {string} base64Img -  Consists of the base64 image string
 */
function onGetEditedImage(base64Img) {}

/**
 * A callback which gets triggered when submit cta is clicked
 * @param {string} base64Img -  Consists of the base64 image string
 */
function onSubmitImage(base64Img) {}
import { QuestionPageComponent } from '@toppr-engg/instalearn-components/lib/esm';
import '@toppr-engg/instalearn-components/lib/esm/index.css';
function QuestionPage() {
  return (
    <QuestionPageComponent
      apiBaseUrl={apiBaseUrl}
      origin={origin}
      userId={userId}
      authKey={authKey}
      questionSlug={questionSlug}
      searchType={searchType}
      imageData={imageData}
      showDefaultListValue={showDefaultListValue}
      showActivationCta={showActivationCta}
      activationBarCtaHeading={activationBarCtaHeading}
      activationBarCtaSubHeading={activationBarCtaSubHeading}
      activationBarPositioningClassName={activationBarPositioningClassName}
      activationBarColorClassName={activationBarColorClassName}
      layoutClassName={layoutClassName}
      isBottomBar={isBottomBar}
      handleQuestionClick={handleQuestionClick}
      getSubjectRelatedToSearch={getSubjectRelatedToSearch}
      handleActivationCtaClick={handleActivationCtaClick}
      siteBaseUrl={siteBaseUrl}
      docApiBaseUrl={docApiBaseUrl}
      docToken={docToken}
      docClientId={docClientId}
      handleBackClick={handleBackClick}
      showBackButton={showBackButton}
    />
  );
}

PROPS TABLE

PropsDescriptionTypeRequired
apiBaseUrlBase path of search apis (Default is prod Api)stringNo
originFrom which source api is being called (Default value is instalearn)stringYes
userIdId of the usernumberYes
authKeySearch QnA Service Auth keystringYes
questionSlugQuestion slug you receive from clicking on question of searchPage componentsstringYes
isBottomBarprovide extra space in bottom of the page (Default is true)booleanNo
showActivationCtawhether to show/hide the activation cta (Default value is false)booleanNo
activationBarCtaHeadingHeading on the Activation Bar (Default value is Need more explanation?)stringNo
activationBarCtaSubHeadingSubHeading on the Activation Bar (Default value is Connect to a tutor)stringNo
activationBarPositioningClassNameTo change the positioning of the Activation BarstringNo
activationBarColorClassNameTo change the background color of the Activation BarstringNo
layoutClassNameTo change the layout of the search pagestringNo
handleSearchListClickTo handle the click on search result ListfunctionYes
getSubjectRelatedToSearchTo get the subjectId based on search TextfunctionYes
handleActivationCtaClickTo handle click on activation BarfunctionNo
siteBaseUrlBase path of hosted appstringYes
docApiBaseUrlBase path of instant doubt solver api's (Default is prod Api)stringNo
docTokenUser Token for instant doubt solverstringYes
docClientIdA unique id specific to tenantsstringYes
handleBackClickTo handle back clickfunctionyes
showBackButtonto show or hide the back button (Default value is true)booleanNo

Function Definitions

/**
 *  callback  to handle click on search result
 * 
@Param
 {object} payload
 */
function handleSearchListClick(data) {}
/**
 *  callback to get the subjectId related to search
 * 
@Param
 {number} subjectId
 */
function getSubjectRelatedToSearch({ subjectId }) {}
/**
 * callback to invoke ask tutor package
 * 
@Param
 {string} searchText -  text
 */
handleActivationCtaClick({
  searchText,
});
1.1.5-alpha.35

12 months ago

1.1.5-alpha.36

12 months ago

1.1.5-alpha.37

11 months ago

1.1.5-alpha.38

11 months ago

1.1.5-alpha.31

1 year ago

1.1.5-alpha.32

1 year ago

1.1.5-alpha.33

12 months ago

1.1.5-alpha.34

12 months ago

1.1.5-alpha.30

1 year ago

1.1.5-alpha.24

1 year ago

1.1.5-alpha.25

1 year ago

1.1.5-alpha.26

1 year ago

1.1.5-alpha.27

1 year ago

1.1.5-alpha.28

1 year ago

1.1.5-alpha.29

1 year ago

1.1.5-alpha.20

1 year ago

1.1.5-alpha.21

1 year ago

1.1.5-alpha.22

1 year ago

1.1.5-alpha.23

1 year ago

1.1.5-alpha.18

1 year ago

1.1.5-alpha.19

1 year ago

1.1.5-alpha.13

1 year ago

1.1.5-alpha.14

1 year ago

1.1.5-alpha.15

1 year ago

1.1.5-alpha.16

1 year ago

1.1.5-alpha.10

1 year ago

1.1.5-alpha.11

1 year ago

1.1.5-alpha.12

1 year ago

1.1.5-alpha.17

1 year ago

1.1.5-alpha.7

1 year ago

1.1.5-alpha.8

1 year ago

1.1.5-alpha.9

1 year ago

1.1.5-alpha.1

1 year ago

1.1.5-alpha.6

1 year ago

1.1.5-alpha.2

1 year ago

1.1.5-alpha.3

1 year ago

1.1.5-alpha.4

1 year ago

1.1.5-alpha.5

1 year ago

1.1.3-alpha.4

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.4-alpha.1

1 year ago

1.1.3-alpha.1

1 year ago

1.1.3-alpha.3

1 year ago

1.1.3-alpha.2

1 year ago

1.1.1-alpha.1

2 years ago

1.1.1

2 years ago

1.1.3

1 year ago

1.1.2

2 years ago

1.1.2-alpha.5

1 year ago

1.1.0-alpha.2

2 years ago

1.1.0-alpha.3

2 years ago

1.1.0-alpha.4

2 years ago

1.1.2-alpha.3

1 year ago

1.1.2-alpha.4

1 year ago

1.1.2-alpha.1

1 year ago

1.1.2-alpha.2

1 year ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.9-alpha.1

2 years ago

1.0.10-alpha.1

2 years ago

1.1.0

2 years ago

1.0.8-alpha.1

2 years ago

1.1.0-alpha.1

2 years ago

1.0.10

2 years ago

1.0.4-alpha.1

2 years ago

1.0.5-alpha.2

2 years ago

1.0.5-alpha.1

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2-alpha.33

2 years ago

1.0.2-alpha.32

2 years ago

1.0.2-alpha.31

2 years ago

1.0.2-alpha.30

2 years ago

1.0.2-alpha.29

2 years ago

1.0.2-alpha.28

2 years ago

1.0.2-alpha.27

2 years ago

1.0.2-alpha.26

2 years ago

1.0.2-alpha.25

2 years ago

1.0.2-alpha.24

2 years ago

1.0.2-alpha.23

2 years ago

1.0.2-alpha.22

2 years ago

1.0.2-alpha.21

2 years ago

1.0.2-alpha.20

2 years ago

1.0.2-alpha.19

2 years ago

1.0.2-alpha.18

2 years ago

1.0.2-alpha.17

2 years ago

1.0.2-alpha.16

2 years ago

1.0.2-alpha.15

2 years ago

1.0.2-alpha.14

2 years ago

1.0.2-alpha.13

2 years ago

1.0.2-alpha.12

2 years ago

1.0.2-alpha.11

2 years ago

1.0.2-alpha.10

2 years ago

1.0.2-alpha.9

2 years ago

1.0.2-alpha.8

2 years ago

1.0.2-alpha.7

2 years ago

1.0.2-alpha.6

2 years ago

1.0.2-alpha.5

2 years ago

1.0.2-alpha.4

2 years ago

1.0.2-alpha.3

2 years ago

1.0.2-alpha.2

2 years ago

1.0.2-alpha.1

2 years ago

1.0.2-alpha.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago