LoginQR
Last updated
Last updated
The LoginQR component is a component that allows dApp to login to ZIGAP through QR recognition.
prop | type | description |
---|---|---|
After successful login, set the type and expiration time(seconds) for the user information to expire.
type | description |
---|---|
type | description |
---|---|
prop | type | default value | description |
---|---|---|---|
dapp
string
Name of the dApp to
use
url
string
The url of dApp to connect
availableNetworks
string[]
List of connectable networks in dApp
sigMessage
string
Messages signed to verify the identity of the user
validSeconds
number
QR code valid seconds
expire
{ type: 'NONE' | 'EXTEND' | 'FIX', seconds: number }
type and time for user login to expire
onReceive
({ status }) => void
Function called after login request. The status type is divided into 4 states: 'REQUEST', 'ACCOUNT', 'SUCCESS', and 'FAIL'. Detailed processing can be performed according to each state.
icon
string
Your dapp icon url to be displayed on zigap app
processingMark
{ type: 'NONE' | 'DEFAULT' | 'CUSTOM', component: React.ReactNode }
How to show the QR image when it's being processed. This prop is optional and the default value is { type: 'DEFAULT' }.
NONE
The login information does not expire until the user presses the logout button himself.
EXTEND
If the user moves the page before the set seconds have passed, the valid date time is extended by the set seconds.
FIX
After the first successful login, the expiration date time will unconditionally expire after the set seconds.
NONE
Even if it's in progress, the QR image still looks the same
DEFAULT
When it's in progress, you'll see the default text 'processing...'
CUSTOM
You can show the component you want when it's in progress (e.g. spinner). React component must be included together as a required value.
size
number
128
canvas width
bgColor
string
#fff
background color
fgColor
string
#000
foreground color
style
CSSProperties
custom css style
isShowLogo
boolean
false
Zigap logo in the middle of the QR code
logoSize
number
30
logo width & height