Skip to content

Commit

Permalink
No errors being thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
claireolmstead committed Dec 2, 2024
1 parent 6dd311b commit d572757
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 21 deletions.
13 changes: 7 additions & 6 deletions src/components/AddAccountId.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@
}
</script>

<Modal id="add-account-id" {isOpen} close={onCancel}>
<span slot="title">
Add an Account Id to MSA (<span class="font-light">{$user.msaId}</span>)
</span>

<div slot="body">
<Modal
id="add-account-id"
{isOpen}
close={onCancel}
title="Add an Account Id to MSA (<span class='font-light'>{$user.msaId}</span>)"
>
<div>
<form class="column">
<DropDownMenu
id="AddAccountId"
Expand Down
5 changes: 2 additions & 3 deletions src/components/ConnectProvider.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
let { close, isOpen = false }: Props = $props();
</script>

<Modal id="connect-provider" {close} {isOpen}>
<span slot="title">Connect Provider</span>
<LoginForm slot="body" onConnect={close} onCancel={close} />
<Modal id="connect-provider" {close} {isOpen} title="Connect Provider">
<LoginForm onConnect={close} onCancel={close} />
</Modal>
6 changes: 3 additions & 3 deletions src/components/DropDownMenu.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts" generics="T extends { toString: () => string }">
interface Props {
interface Props<T> {
label: string;
id: string;
options: T[];
Expand All @@ -19,12 +19,12 @@
onChange = undefined,
formatter = (value) => value.toString(),
disabled = false,
}: Props = $props();
}: Props<T> = $props();
</script>

<div>
<label class="label mb-3.5 block" for={id}>{label}</label>
<select {...$$restProps} {id} bind:value on:change={onChange} data-test-id={id} {disabled}>
<select {id} {value} onchange={onChange} data-test-id={id} {disabled}>
{#if placeholder !== ''}
<option class="text-disabled" value={null} disabled selected>{placeholder}</option>
{/if}
Expand Down
18 changes: 13 additions & 5 deletions src/components/Modal.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
<script lang="ts">
import type { Snippet } from 'svelte';
interface Props {
title: string;
id: string;
close: () => void;
isOpen: boolean;
children: Snippet;
}
let { id, close, isOpen = false }: Props = $props();
let { title, id, close, isOpen = false, children }: Props = $props();
function handleStopProp(e: Event) {
e.stopPropagation();
}
</script>

{#if isOpen}
Expand All @@ -19,13 +27,13 @@
>
<div
class="content-block flex w-modal cursor-default flex-col gap-7"
on:click|stopPropagation={() => {}}
on:keyup|stopPropagation={() => {}}
onclick={handleStopProp}
onkeyup={handleStopProp}
tabindex="0"
role="button"
>
<h2 class="section-title-underlined"><slot name="title" /></h2>
<slot name="body" />
<h2 class="section-title-underlined">{title}</h2>
{@render children()}
</div>
</div>
{/if}
6 changes: 2 additions & 4 deletions src/components/Stake.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
let { isOpen, close, stakeAmount = 1n }: Props = $props();
</script>

<Modal id="stake-to-provider" {isOpen} {close}>
<span slot="title">Stake to Provider</span>

<div slot="body">
<Modal id="stake-to-provider" {isOpen} {close} title="Stake to Provider">
<div>
<StakeForm {close} {stakeAmount} />

<span class="min-w-full border-b border-b-divider"></span>
Expand Down

0 comments on commit d572757

Please sign in to comment.