React component library for Scone
$ npm install scone-js-common
or if you prefer yarn
$ yarn add scone-js-common
import { SconeCalculator } from "scone-js-common";
or;
import SconeCalculator from "scone-js-common/build/components/SconeCalculator";
import { SconeCalculator } from "scone-js-common";
const Demo = () => {
const handleCompletion = (footPrintDetails: any) => {
console.log("completed", footPrintDetails);
};
const handleStepChange = (step: number, footPrintDetails: any) => {
console.log("step", step, footPrintDetails);
};
const handleSkip = (footPrintDetails: any) => {
console.log("skip", footPrintDetails);
};
return (
<SconeCalculator
showSideBar={true}
showSkip={true}
locale={"en-US"}
onCompletion={handleCompletion}
onStepChange={handleStepChange}
onSkip={handleSkip}
calculatorApiUrl={API_RAW_CALCULATE}
/>
);
};
interface SconeCalculatorProps {
showSideBar?: boolean;
calculatorApiUrl?: string;
showSkip?: boolean;
offsetRoute?: string;
locale?: Locale;
onCompletion?: (footPrint: any) => void;
onStepChange?: (step: number, footPrint: any) => void;
onSkip?: (footPrint: any) => void;
}
To generate all *.js
, *.d.ts
files
$ npm run build