Skip to content

Commit

Permalink
update all props
Browse files Browse the repository at this point in the history
  • Loading branch information
claireolmstead committed Dec 2, 2024
1 parent 00be832 commit cd41dbf
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 17 deletions.
9 changes: 7 additions & 2 deletions src/components/ConnectProvider.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<script lang="ts">
import Modal from '../components/Modal.svelte';
import LoginForm from './LoginForm.svelte';
export let close = () => {};
export let isOpen: boolean = false;
interface Props {
close: () => {};
isOpen: boolean;
}
let { close, isOpen = false }: Props = $props();
</script>

<Modal id="connect-provider" {close} {isOpen}>
Expand Down
26 changes: 19 additions & 7 deletions src/components/DropDownMenu.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
<script lang="ts" generics="T extends { toString: () => string }">
export let label: string;
export let id: string = '';
export let options: T[]; // eslint-disable-line no-undef
export let value: T | null = null; // eslint-disable-line no-undef
export let placeholder: string = '';
export let onChange: (() => void) | undefined = undefined;
export let formatter: (value: T) => string = (value) => value.toString(); // eslint-disable-line no-undef
interface Props {
label: string;
id: string;
options: T[];
value: T | null;
placeholder: string;
onChange: (() => void) | undefined;
formatter: (value: T) => string;
}
let {
label,
id = '',
options,
value = null,
placeholder = '',
onChange = undefined,
formatter = (value) => value.toString(),
}: Props = $props();
</script>

<div>
Expand Down
10 changes: 7 additions & 3 deletions src/components/Modal.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<script lang="ts">
export let id: string;
export let close = () => {};
export let isOpen: boolean = false;
interface Props {
id: string;
close: () => {};
isOpen: boolean
}
let { id, close, isOpen = false }: Props = $props();
</script>

{#if isOpen}
Expand Down
14 changes: 9 additions & 5 deletions src/components/NavItem.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<script lang="ts">
export let href: string = '';
export let isActive: boolean = false;
export let onClick: () => void = () => {};
export let id: string = '';
export let target: string = '';
interface Props {
href: string;
isActive: boolean;
onClick: () => void;
id: string;
target: string;
}
let { href = '', isActive = false, onClick = () => {}, id = '', target = '' }: Props = $props();
</script>

<a
Expand Down

0 comments on commit cd41dbf

Please sign in to comment.