Skip to content

flowerpowerdao/fpdao-ui

Repository files navigation

FPDAO UI

Shared FPDAO UI components

How to start using fpdao-ui

  1. Run npm install fpdao-ui

  2. Add "./node_modules/fpdao-ui/**/*" to content in tailwind.config.cjs

  3. 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",
});
  1. 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>);