small fixes
This commit is contained in:
parent
cc36a34149
commit
9f213ad71e
@ -1,4 +1,4 @@
|
|||||||
import { Suspense, useEffect, useRef, useState } from "react";
|
import { Suspense, useRef, useState } from "react";
|
||||||
import { BottomSheet } from "react-spring-bottom-sheet";
|
import { BottomSheet } from "react-spring-bottom-sheet";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { useRouter, Routes } from "blitz";
|
import { useRouter, Routes } from "blitz";
|
||||||
@ -14,13 +14,16 @@ export default function NewMessageBottomSheet() {
|
|||||||
const [recipient, setRecipient] = useState("");
|
const [recipient, setRecipient] = useState("");
|
||||||
const recipientRef = useRef<HTMLInputElement>(null);
|
const recipientRef = useRef<HTMLInputElement>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
recipientRef.current?.focus();
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BottomSheet
|
<BottomSheet
|
||||||
open={isOpen}
|
open={isOpen}
|
||||||
|
initialFocusRef={recipientRef}
|
||||||
|
onSpringEnd={(event) => {
|
||||||
|
if (event.type === "OPEN") {
|
||||||
|
// doesn't work with iOS safari *sigh*
|
||||||
|
recipientRef.current?.focus();
|
||||||
|
}
|
||||||
|
}}
|
||||||
onDismiss={() => setIsOpen(false)}
|
onDismiss={() => setIsOpen(false)}
|
||||||
snapPoints={({ maxHeight }) => maxHeight / 2}
|
snapPoints={({ maxHeight }) => maxHeight / 2}
|
||||||
header={
|
header={
|
||||||
@ -40,6 +43,7 @@ export default function NewMessageBottomSheet() {
|
|||||||
ref={recipientRef}
|
ref={recipientRef}
|
||||||
onChange={(event) => setRecipient(event.target.value)}
|
onChange={(event) => setRecipient(event.target.value)}
|
||||||
className="bg-none border-none outline-none flex-1 text-black"
|
className="bg-none border-none outline-none flex-1 text-black"
|
||||||
|
type="tel"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Suspense fallback={null}>
|
<Suspense fallback={null}>
|
||||||
|
@ -18,7 +18,7 @@ export default resolver.pipe(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const organizationId = user.memberships[0]!.id;
|
const organizationId = user.memberships[0]!.organizationId;
|
||||||
await db.organization.update({
|
await db.organization.update({
|
||||||
where: { id: organizationId },
|
where: { id: organizationId },
|
||||||
data: {
|
data: {
|
||||||
|
Loading…
Reference in New Issue
Block a user