store received items
This commit is contained in:
@@ -12,7 +12,7 @@ import {
|
||||
import { Chat } from "../Model/chatModel";
|
||||
import { translation } from "../translations";
|
||||
|
||||
const chatConverter: React.ListItemConverter<Chat> = (chat) => {
|
||||
const chatConverter: React.StateItemConverter<Chat> = (chat) => {
|
||||
function select() {
|
||||
selectChat(chat);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ export function ChatOptionModal(chat: Chat, isPresented: React.State<boolean>) {
|
||||
shouldShowKey.value == true ? "text" : "password"
|
||||
);
|
||||
|
||||
const secondaryChannelConverter: React.ListItemConverter<string> = (
|
||||
const secondaryChannelConverter: React.StateItemConverter<string> = (
|
||||
secondaryChannel
|
||||
) => {
|
||||
function remove() {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import * as React from "bloatless-react";
|
||||
|
||||
import { Chat } from "../Model/chatModel";
|
||||
import { Chat, Item } from "../Model/chatModel";
|
||||
|
||||
import { translation } from "../translations";
|
||||
|
||||
export function ChatToolView(chat: Chat) {
|
||||
@@ -11,11 +12,15 @@ export function ChatToolView(chat: Chat) {
|
||||
});
|
||||
}
|
||||
|
||||
const itemConverter: React.StateItemConverter<Item> = (item) => {
|
||||
return <span>{item.title}</span>;
|
||||
};
|
||||
|
||||
return (
|
||||
<div class="chat-tool-view">
|
||||
<button on:click={createItem}>+</button>
|
||||
<hr></hr>
|
||||
|
||||
<div children:append={[chat.items, itemConverter]}></div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
|
||||
import { translation } from "../translations";
|
||||
|
||||
const addressConverter: React.ListItemConverter<string> = (address) => {
|
||||
const addressConverter: React.StateItemConverter<string> = (address) => {
|
||||
return <option>{address}</option>;
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Chat, ChatMessage } from "../Model/chatModel";
|
||||
import { translation } from "../translations";
|
||||
|
||||
export function ThreadView(chat: Chat) {
|
||||
const messageConverter: React.ListItemConverter<ChatMessage> = (message) => {
|
||||
const messageConverter: React.StateItemConverter<ChatMessage> = (message) => {
|
||||
function resendMessage() {
|
||||
chat.resendMessage(message);
|
||||
}
|
||||
@@ -72,7 +72,7 @@ export function ThreadView(chat: Chat) {
|
||||
);
|
||||
};
|
||||
|
||||
const outboxMessageConverter: React.ListItemConverter<ChatMessage> = (
|
||||
const outboxMessageConverter: React.StateItemConverter<ChatMessage> = (
|
||||
message
|
||||
) => {
|
||||
function remove() {
|
||||
|
||||
Reference in New Issue
Block a user