mirror of
https://github.com/luxfi/kit.git
synced 2026-10-30 16:22:01 +00:00
53 lines
1.1 KiB
Plaintext
53 lines
1.1 KiB
Plaintext
### LuxKit Actions
|
|
|
|
```ts
|
|
const luxKit = createModal({
|
|
chains,
|
|
wagmi,
|
|
projectId,
|
|
appName,
|
|
});
|
|
//open LuxKit modal
|
|
luxKit.open();
|
|
|
|
//get open status
|
|
luxKit.getOpenState();
|
|
|
|
//close modal
|
|
luxKit.close();
|
|
|
|
luxKit.getOpenState();
|
|
|
|
//set dark mode
|
|
luxKit.setTheme("dark");
|
|
```
|
|
|
|
```ts
|
|
type LuxKitActions = {
|
|
open: (params?: { forceOpen?: boolean } & Hook) => void;
|
|
close: () => void;
|
|
subscribeModalState: (fn: (open: boolean) => void) => () => void;
|
|
getOpenState: () => boolean;
|
|
|
|
getTheme: () => Theme;
|
|
setTheme: (theme: Theme) => void;
|
|
setThemeVariables: (themeVariables?: ThemeVariables) => void;
|
|
|
|
getDisclaimer: () => Disclaimer | undefined;
|
|
setDisclaimer: (disclaimer?: Disclaimer) => void;
|
|
|
|
getCustomButtons: () => CustomButton[] | undefined;
|
|
setCustomButtons: (customButtons?: CustomButton[]) => void;
|
|
|
|
getLanguage: () => SUPPORT_LANGUAGES;
|
|
// setLanguage: (language: SUPPORT_LANGUAGES) => void;
|
|
};
|
|
|
|
type Hook = {
|
|
onConnect?: () => void;
|
|
onConnectError?: (error: Error) => void;
|
|
onModalClosed?: () => void;
|
|
onModalClosedByManualOperation?: () => void;
|
|
};
|
|
```
|