-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #384 from greymass/multisig
Adding support for multisig accounts
- Loading branch information
Showing
45 changed files
with
949 additions
and
248 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
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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<script lang="ts"> | ||
import { cn } from '$lib/utils'; | ||
import { type Snippet } from 'svelte'; | ||
import type { HTMLAnchorAttributes } from 'svelte/elements'; | ||
interface Props extends HTMLAnchorAttributes { | ||
href: string; | ||
children?: Snippet; | ||
text?: string; | ||
} | ||
let { href, text = '', children, ...props }: Props = $props(); | ||
</script> | ||
|
||
<a | ||
{href} | ||
class={cn( | ||
'inline-flex items-center gap-2 text-skyBlue-500 hover:text-skyBlue-400 focus-visible:outline focus-visible:outline-solar-500 ', | ||
props.class | ||
)} | ||
> | ||
{#if children} | ||
{@render children()} | ||
{:else} | ||
{text} | ||
{/if} | ||
</a> |
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 |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<script lang="ts"> | ||
import { cn } from '$lib/utils/style'; | ||
import type { Snippet } from 'svelte'; | ||
import type { HTMLInputAttributes } from 'svelte/elements'; | ||
import Code from '../code.svelte'; | ||
interface DatetimeInputProps extends HTMLInputAttributes { | ||
date?: Date; | ||
value?: string; | ||
min?: string; | ||
children?: Snippet; | ||
debug?: boolean; | ||
} | ||
var now = new Date(); | ||
now.setMinutes(now.getMinutes() - now.getTimezoneOffset()); | ||
function dateToInputString(date: Date) { | ||
return date.toISOString().slice(0, 16); | ||
} | ||
let { | ||
date = $bindable(), | ||
value = $bindable(), | ||
min = dateToInputString(now), | ||
class: className, | ||
debug = false, | ||
...props | ||
}: DatetimeInputProps = $props(); | ||
value = undefined; | ||
if (date) { | ||
const utc = new Date(date); | ||
utc.setMinutes(utc.getMinutes() - utc.getTimezoneOffset()); | ||
value = dateToInputString(utc); | ||
} | ||
/** Set the input value from a parent */ | ||
export function set(date: Date | undefined) { | ||
if (!date) { | ||
value = undefined; | ||
} else { | ||
value = dateToInputString(date); | ||
} | ||
} | ||
$effect(() => { | ||
if (value) { | ||
date = new Date(`${value}:00.000`); | ||
} else { | ||
date = undefined; | ||
} | ||
}); | ||
</script> | ||
|
||
<div | ||
class={cn( | ||
'relative flex h-12 gap-2 rounded-lg border-2 border-mineShaft-600 px-4 *:content-center focus-within:border-skyBlue-500 focus-within:ring focus-within:ring-1 focus-within:ring-inset focus-within:ring-skyBlue-500', | ||
className | ||
)} | ||
> | ||
<input | ||
class="placeholder:text-muted w-full rounded-lg bg-transparent font-medium focus:outline-none" | ||
type="datetime-local" | ||
{min} | ||
bind:value | ||
{...props} | ||
/> | ||
<div class="text-muted select-none"> | ||
{@render props.children?.()} | ||
</div> | ||
</div> | ||
|
||
{#if debug} | ||
<div class="mt-4"> | ||
<h3>Component State</h3> | ||
<!-- prettier-ignore --> | ||
<Code> | ||
date: {date} | ||
value: {value} | ||
min: {min} | ||
</Code> | ||
</div> | ||
{/if} |
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
Oops, something went wrong.