about summary refs log tree commit diff
path: root/src/components/dms/NewChatDialog/index.tsx
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-05-20 22:23:36 +0100
committerGitHub <noreply@github.com>2024-05-20 22:23:36 +0100
commitd3d2dc8ad46890dda945f3401375529f1f8a8d02 (patch)
tree8ae63a575b48ca1f5a0fe272a7af701ef7f04558 /src/components/dms/NewChatDialog/index.tsx
parente5aa8c081a16a58f8c29b1a00c039f36f68fbc35 (diff)
downloadvoidsky-d3d2dc8ad46890dda945f3401375529f1f8a8d02.tar.zst
[🐴] Appeal form for disabled DMs (#4126)
* add appeal dialog

* use useMutation for the labels on me dialog

* replace text button with small button
Diffstat (limited to 'src/components/dms/NewChatDialog/index.tsx')
-rw-r--r--src/components/dms/NewChatDialog/index.tsx16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/components/dms/NewChatDialog/index.tsx b/src/components/dms/NewChatDialog/index.tsx
index fb20b8f4c..e57b0aa8f 100644
--- a/src/components/dms/NewChatDialog/index.tsx
+++ b/src/components/dms/NewChatDialog/index.tsx
@@ -1,4 +1,10 @@
-import React, {useCallback, useMemo, useRef, useState} from 'react'
+import React, {
+  useCallback,
+  useLayoutEffect,
+  useMemo,
+  useRef,
+  useState,
+} from 'react'
 import type {TextInput as TextInputType} from 'react-native'
 import {View} from 'react-native'
 import {AppBskyActorDefs, moderateProfile, ModerationOpts} from '@atproto/api'
@@ -293,7 +299,7 @@ function SearchablePeopleList({
   const control = Dialog.useDialogContext()
   const listRef = useRef<BottomSheetFlatListMethods>(null)
   const {currentAccount} = useSession()
-  const inputRef = React.useRef<TextInputType>(null)
+  const inputRef = useRef<TextInputType>(null)
 
   const [searchText, setSearchText] = useState('')
 
@@ -306,7 +312,7 @@ function SearchablePeopleList({
     limit: 12,
   })
 
-  const items = React.useMemo(() => {
+  const items = useMemo(() => {
     let _items: Item[] = []
 
     if (isError) {
@@ -368,7 +374,7 @@ function SearchablePeopleList({
     items.push({type: 'empty', key: 'empty', message: _(msg`No results`)})
   }
 
-  const renderItems = React.useCallback(
+  const renderItems = useCallback(
     ({item}: {item: Item}) => {
       switch (item.type) {
         case 'profile': {
@@ -395,7 +401,7 @@ function SearchablePeopleList({
     [moderationOpts, onCreateChat],
   )
 
-  React.useLayoutEffect(() => {
+  useLayoutEffect(() => {
     if (isWeb) {
       setImmediate(() => {
         inputRef?.current?.focus()