This repo is the example of react package published
npm install my-library-popup-huehue
or
yarn add my-library-popup-huehue
Add MyNiceModal
to your component:
import React from 'react'
import ReactDOM from 'react-dom/client'
import { MyNiceModal } from "my-library-popup-huehue";
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
root.render(
<React.StrictMode>
<div>
<MyNiceModal
buttonText="Connecto Huehue"
buttonStyle={{
border: "1px solid gray",
padding: "10px",
borderRadius: "10px",
color: "black",
}}
modalStyle={{
backgroundColor: "",
border: "1px solid gray",
padding: "10px",
borderRadius: "10px",
width: "450px",
height: "700px",
}}
sdkKey="your_expected_sdk_key"
onSuccess={(user) => console.log("Login Success:", user)}
onExit={() => console.log("Yep The Modal Closed")}
/>
</div>
</React.StrictMode>,
)