Nachalarmieren select
Alarmieren aus Einsatz erstellen Maske Map-Tiles SDS sound: Status J SDS Nachricht: public-User Audio: Es kann nur ein Nutzer gleichzeitig Funken Select in Report und Chat: default value -> OnChange
This commit is contained in:
@@ -39,7 +39,7 @@ export const Chat = () => {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if(!session.data?.user.id) return;
|
||||
if (!session.data?.user.id) return;
|
||||
setOwnId(session.data?.user.id);
|
||||
}, [session.data?.user.id]);
|
||||
|
||||
@@ -47,7 +47,7 @@ export const Chat = () => {
|
||||
const filteredAircrafts = aircrafts?.filter((a) => a.userId !== session.data?.user.id);
|
||||
|
||||
return (
|
||||
<div className={cn("dropdown dropdown-right", chatOpen && "dropdown-open")}>
|
||||
<div className={cn("dropdown dropdown-right dropdown-center", chatOpen && "dropdown-open")}>
|
||||
<div className="indicator">
|
||||
{Object.values(chats).some((c) => c.notification) && (
|
||||
<span className="indicator-item status status-info"></span>
|
||||
@@ -68,9 +68,9 @@ export const Chat = () => {
|
||||
{chatOpen && (
|
||||
<div
|
||||
tabIndex={0}
|
||||
className="dropdown-content card bg-base-200 w-150 shadow-md z-[1100] ml-2 border-1 border-primary"
|
||||
className="dropdown-content card bg-base-200 w-150 shadow-md z-[1100] max-h-[400px] ml-2 border-1 border-primary"
|
||||
>
|
||||
<div className="card-body">
|
||||
<div className="card-body overflow-y-auto">
|
||||
<h2 className="inline-flex items-center gap-2 text-lg font-bold mb-2">
|
||||
<ChatBubbleIcon /> Chat
|
||||
</h2>
|
||||
@@ -118,7 +118,7 @@ export const Chat = () => {
|
||||
<span className="text-xl">+</span>
|
||||
</button>
|
||||
</div>
|
||||
<div className="tabs tabs-lift">
|
||||
<div className="tabs tabs-lift max-h-full">
|
||||
{Object.keys(chats).map((userId) => {
|
||||
const chat = chats[userId];
|
||||
if (!chat) return null;
|
||||
@@ -126,7 +126,6 @@ export const Chat = () => {
|
||||
<Fragment key={userId}>
|
||||
<input
|
||||
type="radio"
|
||||
name="my_tabs_3"
|
||||
className="tab"
|
||||
aria-label={`<${chat.name}>`}
|
||||
checked={selectedChat === userId}
|
||||
@@ -140,7 +139,7 @@ export const Chat = () => {
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<div className="tab-content bg-base-100 border-base-300 p-6">
|
||||
<div className="tab-content bg-base-100 border-base-300 p-6 overflow-y-auto">
|
||||
{chat.messages.map((chatMessage) => {
|
||||
const isSender = chatMessage.senderId === session.data?.user.id;
|
||||
return (
|
||||
@@ -173,6 +172,22 @@ export const Chat = () => {
|
||||
onChange={(e) => {
|
||||
setMessage(e.target.value);
|
||||
}}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter" && !e.shiftKey) {
|
||||
e.preventDefault();
|
||||
if (message.length < 1) return;
|
||||
if (!selectedChat) return;
|
||||
setSending(true);
|
||||
sendMessage(selectedChat, message)
|
||||
.then(() => {
|
||||
setMessage("");
|
||||
setSending(false);
|
||||
})
|
||||
.catch(() => {
|
||||
setSending(false);
|
||||
});
|
||||
}
|
||||
}}
|
||||
value={message}
|
||||
/>
|
||||
</label>
|
||||
|
||||
@@ -38,7 +38,9 @@ export const Report = () => {
|
||||
const filteredAircrafts = aircrafts?.filter((a) => a.userId !== session.data?.user.id);
|
||||
|
||||
return (
|
||||
<div className={cn("dropdown dropdown-right", reportTabOpen && "dropdown-open")}>
|
||||
<div
|
||||
className={cn("dropdown dropdown-right dropdown-center", reportTabOpen && "dropdown-open")}
|
||||
>
|
||||
<div className="indicator">
|
||||
<button
|
||||
className="btn btn-soft btn-sm btn-error"
|
||||
@@ -70,12 +72,11 @@ export const Report = () => {
|
||||
Keine Nutzer gefunden
|
||||
</option>
|
||||
)}
|
||||
{filteredDispatcher?.length ||
|
||||
(filteredAircrafts?.length && (
|
||||
<option disabled value="default">
|
||||
Nutzer auswählen
|
||||
</option>
|
||||
))}
|
||||
{(filteredDispatcher?.length || filteredAircrafts?.length) && (
|
||||
<option disabled value="default">
|
||||
Nutzer auswählen
|
||||
</option>
|
||||
)}
|
||||
|
||||
{filteredDispatcher?.map((dispatcher) => (
|
||||
<option key={dispatcher.userId} value={dispatcher.userId}>
|
||||
|
||||
Reference in New Issue
Block a user