@toppr-engg/instalearn-components v1.1.5-alpha.9
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
Props | Description | Type | Required |
---|---|---|---|
apiBaseUrl | Base path of search apis (Default is prod Api) | string | No |
origin | From which source api is being called (Default value is instalearn) | string | Yes |
userId | Id of the user | number | Yes |
authKey | Search QnA Service Auth key | string | Yes |
docToken | User Token for instant doubt solver | string | Yes |
docApiBaseUrl | Base path of instant doubt solver api's (Default is prod Api) | string | No |
docClientId | Specific to tenants | string | Yes |
searchText | Text search by user | string | Yes |
searchType | Type of search whether its is image or text. (Default type is text) | string | Yes |
imageData | Image data in base64 format | string | No |
showActivationCta | whether to show/hide the activation cta (Default value is false) | boolean | No |
activationBarCtaHeading | Heading on the Activation Bar (Default value is Need more explanation?) | string | No |
activationBarCtaSubHeading | SubHeading on the Activation Bar (Default value is Connect to a tutor) | string | No |
activationBarPositioningClassName | To change the positioning of the Activation Bar | string | No |
activationBarColorClassName | To change the background color of the Activation Bar | string | No |
layoutClassName | To change the layout of the search page | string | No |
handleSearchListClick | To handle the click on search result List | function | Yes |
getSubjectRelatedToSearch | To get the subjectId based on search Text | function | Yes |
handleActivationCtaClick | To handle click on activation Bar | function | No |
getSubjectRelatedToSearch | To get the subjectId based on search Text | function | Yes |
handleRenewClick | To renew the doubt count | function | No |
isTodFeature | to enable the tutor on demand feature (Default value is false) | boolean | No |
isPaymentDone | to show the banner regarding payment done (Default value is false) | boolean | No |
isUserVisitedFirstTime | to show the information about the product to the user (Default value is false) | boolean | No |
handleBackClick | To handle back click | function | yes |
showBackButton | to show or hide the back button (Default value is true) | boolean | No |
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
Props | Description | Type | Required |
---|---|---|---|
apiBaseUrl | Base path of search apis (Default is prod Api) | string | No |
origin | From which source api is being called (Default value is instalearn) | string | Yes |
userId | Id of the user | number | Yes |
authKey | Search QnA Service Auth key | string | Yes |
heading | Heading text on home Page (Default is Instant Doubt Solver) | string | No |
bannerHeadingHTmlFormat | Heading provide to the banner in html format used for styling or in text format (Default value : Connect with tutors & get your doubts resolved instantly ) | string | No |
bannerSubHeadingHTmlFormat | Sub-heading provide to the banner in html format used for styling or in text format | string | No |
videoBannerHeadingHtmlFormat | Heading provide to the video banner in html format used for styling or in text format ( Default value : 1:1 doubt resolution over video calls ) | string | No |
videoBannerSubHeadingHtmlFormat | 'Get your questions resolved by tutors face to face | string | Yes |
isNewfeature | To show/hide new feature tag (Default value : true) | boolean | No |
showActivationCta | whether to show/hide the activation cta (Default value is false) | boolean | No |
askExpertBtnHeading | A string which is used for heading of a Button (Default : Ask a doubt) | string | No |
askExpertBtnClassName | A string containing css which used for styling the button component. | string | No |
layoutClassName | To change the layout of the search page | string | No |
onSuggestionClick | A function which gets triggered on clicking any suggestion item | function | Yes |
onCustomSearch | A function which gets triggered on pressing enter after search | function | Yes |
handleActivationCtaClick | To handle click on activation Bar | function | No |
handleRenewClick | To renew the doubt count | function | No |
isTodFeature | to able the tutor on demand (Default value is false) | boolean | No |
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
Props | Description | Type | Required |
---|---|---|---|
onClosePopup | A function which gets called when popup is closed | function | Yes |
onSubmitTextDoubt | A function which gets called when text doubt is submitted | function | Yes |
onUploadImage | A function which gets called when image starts uploading | function | No |
onImageUploaded | A function which gets called when image finishes uploading | function | Yes |
onTypeCameraClick | A function which gets called when type image is clicked | string | No |
initialScreenTitle | A string corresponding to first screen title | string | No |
cropScreenTitle | A string corresponding to crop screen title | string | No |
imageUploadingTitle | A string corresponding to image uploading screen title | string | No |
apiBaseUrl | A string corresponding to the base url for api calls. Default value is the prod api url | string | No |
authKey | Search QnA Service Auth key | string | Yes |
userId | User Id to be used in api calls user | number | No |
docApiBaseUrl | Base path of instant doubt solver api's (Default is prod Api) | string | No |
docToken | User Token for instant doubt solver | string | No |
docClientId | A unique id specific to tenants | string | No |
directSearchViaAskADoubt | Invoke askTutor package on searching query(image/text) item | boolean | No |
isClickFromAskExpert | To determine whether function invoked from clicking ask a doubt or from search | boolean | No |
imageCropperData | To pass props for ImageCropper component | object | No |
cameraWrapperData | To pass props for CameraWrapper component | object | No |
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
Props | Description | Type | Required |
---|---|---|---|
onCameraClose | A function which gets triggered when close is clicked | function | Yes |
onImageUploaded | A function which gets triggered when image gets uploaded | function | Yes |
onTypeClick | A function which gets triggered when type icon is clicked | function | No |
apiBaseUrl | A string corresponding to the base url for api calls. Default value is the prod api url | string | No |
authKey | Search QnA Service Auth key | string | Yes |
userId | User Id to be used in api calls user | number | No |
cameraIconClassName | A string containing css which appends to the camera icons css | string | No |
footerClassName | A string containing css which appends to the footer container css | string | No |
videoConstraints | An object specifying the constraints for react-webcam library | object | No |
modalData | An object for passing props to Modal component | object | No |
cameraPermissionAskData | An object for passing props to CameraPermission component for asking permission screen | object | No |
cameraPermissionErrorData | An object for passing props to CameraPermission component for permission denied screen | object | No |
imageCropperData | An object for passing props to ImageCropper component for permission denied screen | object | No |
reactWebcamData | An object for passing props to ReactWebcam library component | object | No |
isD4Device | A boolean to conditionally render the D4Camera | boolean | No |
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
Props | Description | Type | Required |
---|---|---|---|
onGetEditedImage | A function which gets triggered when crop state is changed or image is rotated by user | function | No |
onDeleteImage | A function which gets called whenever the user clicks on the bin icon | function | No |
onClickBack | A function which gets called whenever the user clicks on the back icon | ||
onCloseClick | A function which gets called whenever the user clicks on the submit button icon | function | Yes |
onSubmitImage | A function which gets called whenever the user clicks on the submit button icon | function | No |
onGetImageRef | A function which gets called to give the ref of the selected image | function | No |
className | A string containing css which appends to the container css | string | No |
footerClassName | A string containing css which appends to the footer container css | function | No |
imgClassName | A string containing css which appends to the selected image | string | No |
base64Img | A string containing base64 data of the image | string | No |
title | A string containing title of the image cropper | string | No |
titleClassName | AA string containing css which appends to the title | string | No |
iconClassName | A string containing css which appends to the icons | string | No |
animationMessage | A string containing the message to show when the final image is being processed | string | No |
animationMessageClassName | A string containing the css which appends to the animation message | string | No |
selectedFile | A file blob object for an image | object | No |
hideFooter | A boolean, if true hides the footer | boolean | No |
hideHeader | A boolean, if true hides the header | boolean | No |
hideClockwise | A boolean, if true hides the rotate clockwise icon | boolean | No |
hideAnticlockwise | A boolean, if true hides the rotate anticlockwise icon | boolean | No |
hideDeleteImage | A boolean, if true hides the delete icon | boolean | No |
hideBack | A boolean, if true hides the back icon | boolean | No |
hideCross | A boolean, if true hides the cross icon | boolean | No |
btnProps | An object which contains the btn props | object | No |
isImageAnimationVisible | A boolean which denotes when to show the animation | boolean | No |
reactImageCropperData | An object for passing props in react-image-crop lib component | object | No |
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
Props | Description | Type | Required |
---|---|---|---|
apiBaseUrl | Base path of search apis (Default is prod Api) | string | No |
origin | From which source api is being called (Default value is instalearn) | string | Yes |
userId | Id of the user | number | Yes |
authKey | Search QnA Service Auth key | string | Yes |
questionSlug | Question slug you receive from clicking on question of searchPage components | string | Yes |
isBottomBar | provide extra space in bottom of the page (Default is true) | boolean | No |
showActivationCta | whether to show/hide the activation cta (Default value is false) | boolean | No |
activationBarCtaHeading | Heading on the Activation Bar (Default value is Need more explanation?) | string | No |
activationBarCtaSubHeading | SubHeading on the Activation Bar (Default value is Connect to a tutor) | string | No |
activationBarPositioningClassName | To change the positioning of the Activation Bar | string | No |
activationBarColorClassName | To change the background color of the Activation Bar | string | No |
layoutClassName | To change the layout of the search page | string | No |
handleSearchListClick | To handle the click on search result List | function | Yes |
getSubjectRelatedToSearch | To get the subjectId based on search Text | function | Yes |
handleActivationCtaClick | To handle click on activation Bar | function | No |
siteBaseUrl | Base path of hosted app | string | Yes |
docApiBaseUrl | Base path of instant doubt solver api's (Default is prod Api) | string | No |
docToken | User Token for instant doubt solver | string | Yes |
docClientId | A unique id specific to tenants | string | Yes |
handleBackClick | To handle back click | function | yes |
showBackButton | to show or hide the back button (Default value is true) | boolean | No |
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,
});
12 months ago
12 months ago
11 months ago
11 months ago
1 year ago
1 year ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago