Starting to implement subscriptions.
This commit is contained in:
parent
0dde189741
commit
9f396a167a
|
@ -1,5 +1,5 @@
|
||||||
import { createForm } from '@felte/solid';
|
import { createForm } from '@felte/solid';
|
||||||
import { Component, Index, Match, onMount, Switch } from 'solid-js';
|
import { Component, Index, Match, onMount, Show, Switch } from 'solid-js';
|
||||||
import { TextField, Button } from '@kobalte/core';
|
import { TextField, Button } from '@kobalte/core';
|
||||||
import reporter from '@felte/reporter-tippy';
|
import reporter from '@felte/reporter-tippy';
|
||||||
import './style.css';
|
import './style.css';
|
||||||
|
@ -130,7 +130,8 @@ const User: Component<Props> = (props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
function addSubscription(index?: number) {
|
function addSubscription(index?: number) {
|
||||||
return () => addField(`subscriptions`, { user: '', direction: '' }, index);
|
return () =>
|
||||||
|
addField(`subscriptions`, { username: '', direction: '' }, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log({
|
console.log({
|
||||||
|
@ -141,6 +142,10 @@ const User: Component<Props> = (props) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
<Show when={!isNew()}>
|
||||||
|
<h2>{userId(data('username'), data('database'))}</h2>
|
||||||
|
</Show>
|
||||||
<form use:form>
|
<form use:form>
|
||||||
<TextField.Root>
|
<TextField.Root>
|
||||||
<TextField.Label>Mail address</TextField.Label>
|
<TextField.Label>Mail address</TextField.Label>
|
||||||
|
@ -192,8 +197,7 @@ const User: Component<Props> = (props) => {
|
||||||
+
|
+
|
||||||
</button>
|
</button>
|
||||||
</th>
|
</th>
|
||||||
<th>User</th>
|
<th>User name</th>
|
||||||
<th>Direction</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -209,19 +213,9 @@ const User: Component<Props> = (props) => {
|
||||||
<TextField.Root>
|
<TextField.Root>
|
||||||
<TextField.Input
|
<TextField.Input
|
||||||
type='text'
|
type='text'
|
||||||
name={`subscriptions.${index}.user`}
|
name={`subscriptions.${index}.username`}
|
||||||
required={true}
|
required={true}
|
||||||
placeholder='user'
|
placeholder='user name'
|
||||||
/>
|
|
||||||
</TextField.Root>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<TextField.Root>
|
|
||||||
<TextField.Input
|
|
||||||
type='text'
|
|
||||||
name={`subscriptions.${index}.direction`}
|
|
||||||
required={true}
|
|
||||||
placeholder='direction'
|
|
||||||
/>
|
/>
|
||||||
</TextField.Root>
|
</TextField.Root>
|
||||||
</td>
|
</td>
|
||||||
|
@ -241,6 +235,7 @@ const User: Component<Props> = (props) => {
|
||||||
</Switch>
|
</Switch>
|
||||||
<Button.Root onclick={cancelHandler}>Cancel</Button.Root>
|
<Button.Root onclick={cancelHandler}>Cancel</Button.Root>
|
||||||
</form>
|
</form>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue