2.2.2 • Published 2 months ago
fpdao-ui v2.2.2
FPDAO UI
Shared FPDAO UI components
How to start using fpdao-ui
Run
npm install fpdao-ui
Add
"./node_modules/fpdao-ui/**/*"
tocontent
intailwind.config.cjs
Create AuthStore
import { AuthStore, createAuthStore } from 'fpdao-ui/auth-store';
let authStore = createAuthStore({
whitelist: [], // canister ids...
host: process.env.DFX_NETWORK !== "ic" ? "http://localhost:4943" : "https://icp0.io",
});
- In
App.svelte
check wallet connections
onMount(async () => {
await authStore.checkConnections();
});
Include styles
import "fpdao-ui/styles/global.css";
Use svelte componentes
import Footer from "fpdao-ui/components/Footer.svelte";
<Footer {authState}></Footer>
Include favicon
<link rel="icon" type="image/svg+xml" href="/node_modules/fpdao-ui/images/fpd-logo.svg" />
Transfer ICP using a connected wallet
await authStore.transfer("<account-id>", <amount-e8s>);