This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: wallet connect and initial multisig creation ui (#16)
- Loading branch information
1 parent
75cd351
commit a40a05e
Showing
29 changed files
with
645 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,32 @@ | ||
import { IS_BROWSER } from "$fresh/runtime.ts" | ||
import classNames from "classnames" | ||
import { JSX } from "preact" | ||
import type { ComponentChildren } from "preact" | ||
|
||
export function Button(props: JSX.HTMLAttributes<HTMLButtonElement>) { | ||
export const Button = ( | ||
{ variant, size, disabled, className, iconLeft, iconRight, children, ...rest }: | ||
& JSX.IntrinsicAttributes | ||
& JSX.HTMLAttributes<HTMLButtonElement> | ||
& { variant: "fill" | "ghost"; iconLeft?: ComponentChildren; iconRight?: ComponentChildren }, | ||
) => { | ||
return ( | ||
<button | ||
{...props} | ||
disabled={!IS_BROWSER || props.disabled} | ||
class="px-2 py-1 border(gray-100 2) hover:bg-gray-200" | ||
/> | ||
className={classNames( | ||
"flex flex-row gap-3 items-center justify-center rounded-full w-full", | ||
"font-semibold py-3 px-10", | ||
"outline-none focus:outline-none", | ||
{ "bg-transparent text-tuna hover:text-pink-800": variant === "ghost" }, | ||
{ | ||
// TODO add hover state | ||
"bg-tuna text-white": variant === "fill", | ||
}, | ||
className, | ||
)} | ||
disabled={disabled} | ||
{...rest} | ||
> | ||
{iconLeft} | ||
{children} | ||
{iconRight} | ||
</button> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import classNames from "classnames" | ||
import type { ComponentChildren } from "preact" | ||
|
||
export const Card = ( | ||
{ children, className }: { children: ComponentChildren; className?: string }, | ||
) => { | ||
return ( | ||
<div | ||
className={classNames( | ||
"rounded-lg shadow w-full bg-white border border-nebula py-10 px-4", | ||
className, | ||
)} | ||
> | ||
{children} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { JSX } from "preact/jsx-runtime" | ||
|
||
export const IconPlus = (props: JSX.IntrinsicAttributes & JSX.SVGAttributes<SVGSVGElement>) => ( | ||
<svg | ||
width="15" | ||
height="14" | ||
viewBox="0 0 15 14" | ||
fill="currentColor" | ||
xmlns="http://www.w3.org/2000/svg" | ||
{...props} | ||
> | ||
<path | ||
d="M14.5 8H8.5V14H6.5V8H0.5V6H6.5V0H8.5V6H14.5V8Z" | ||
fill="currentColor" | ||
fill-opacity="0.89" | ||
/> | ||
</svg> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./IconPlus.tsx" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import type { ComponentChildren } from "preact" | ||
import { TestBlock } from "../TestBlock.tsx" | ||
import WalletConnect from "../../islands/WalletConnect.tsx" | ||
import { PolkadotLogo } from "../PolkadotLogo.tsx" | ||
|
||
export function Header({ title }: { title: ComponentChildren }) { | ||
export function Header() { | ||
return ( | ||
<header> | ||
<TestBlock className="flex flex-row flex-nowrap justify-between"> | ||
{title && <div className="flex">{title}</div>} | ||
<div className="flex"> | ||
<TestBlock>Wallet connect</TestBlock> | ||
<TestBlock>Dark / Light mode</TestBlock> | ||
<TestBlock>Settings</TestBlock> | ||
<header className="bg-white py-2 px-6 rounded-t border border-nebula"> | ||
<div className="flex flex-row flex-nowrap items-center justify-between gap-4"> | ||
<div className="w-40"> | ||
<PolkadotLogo /> | ||
</div> | ||
</TestBlock> | ||
<div className="flex items-center gap-4"> | ||
<WalletConnect /> | ||
</div> | ||
</div> | ||
</header> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
import type { ComponentChildren } from "preact" | ||
import { TestBlock } from "../TestBlock.tsx" | ||
|
||
export function Navbar() { | ||
return ( | ||
<nav> | ||
<TestBlock> | ||
<div className="flex justify-end"> | ||
<TestBlock> | ||
<a href="/create-multisig" className="hover:text-indigo-500">New multisig</a> | ||
</TestBlock> | ||
<TestBlock> | ||
<a href="/create-transaction" className="hover:text-indigo-500">New transaction</a> | ||
</TestBlock> | ||
<TestBlock> | ||
<a href="/transactions" className="hover:text-indigo-500">Transaction History</a> | ||
</TestBlock> | ||
</div> | ||
</TestBlock> | ||
</nav> | ||
) | ||
} | ||
export const Navbar = ({ title }: { title: ComponentChildren }) => ( | ||
<nav> | ||
<div className="flex items-center justify-between bg-white py-2 px-6 rounded-b border border-nebula -mt-px"> | ||
<div> | ||
{title && <div className="flex">{title}</div>} | ||
</div> | ||
<div className="flex justify-end"> | ||
<TestBlock> | ||
<a href="/create-multisig" className="hover:text-indigo-500">New multisig</a> | ||
</TestBlock> | ||
<TestBlock> | ||
<a href="/create-transaction" className="hover:text-indigo-500">New transaction</a> | ||
</TestBlock> | ||
</div> | ||
</div> | ||
</nav> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
export * from "./Button.tsx" | ||
export * from "./Card.tsx" | ||
export * from "./icons/mod.ts" | ||
export * from "./layout/mod.tsx" | ||
export * from "./PolkadotLogo.tsx" | ||
export * from "./TestBlock.tsx" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,9 +14,15 @@ | |
"ddb_doc/": "https://esm.sh/v106/@aws-sdk/[email protected]/", | ||
"ts_ddb_types/": "https://esm.sh/v106/[email protected]/lib/", | ||
"ts_ddb_runtime/": "https://esm.sh/v106/[email protected]/es2022/lib/", | ||
"@headlessui/react": "https://esm.sh/@headlessui/[email protected]?external=react,react-dom,@types/react,@types/react-dom", | ||
"react": "https://esm.sh/[email protected]/compat", | ||
"react-dom": "https://esm.sh/[email protected]/compat", | ||
"@talisman-connect/wallets": "https://esm.sh/@talisman-connect/[email protected]", | ||
"@twind/forms": "https://esm.sh/v99/@twind/[email protected][email protected]", | ||
"capi": "http://localhost:4646/mod.ts", | ||
"components": "./components/mod.ts", | ||
"islands/": "./islands/", | ||
"server/": "./server/" | ||
"server/": "./server/", | ||
"misc": "./misc/mod.ts" | ||
} | ||
} |
Oops, something went wrong.