Live video on the AT Protocol

remove unused state and imports

+7 -38
+6 -25
js/app/components/login/login.tsx
··· 1 - import { AtpBaseClient } from "lexicons"; 2 1 import NameColorPicker from "components/name-color-picker/name-color-picker"; 3 2 import { 4 3 login, ··· 6 5 selectChatProfile, 7 6 selectIsReady, 8 7 selectLogin, 9 - selectPDS, 10 8 selectUserProfile, 11 - setPDS, 12 9 } from "features/bluesky/blueskySlice"; 13 10 import { useEffect, useState } from "react"; 14 - import { Keyboard, KeyboardAvoidingView } from "react-native"; 11 + import { KeyboardAvoidingView } from "react-native"; 15 12 import { useAppDispatch, useAppSelector } from "store/hooks"; 16 13 import { 17 14 Button, 18 15 Form, 19 - H3, 20 - H5, 21 16 Input, 22 - Label, 23 - Sheet, 24 17 Spinner, 25 18 Text, 26 - useTheme, 27 19 View, 28 20 XStack, 29 21 YStack, 30 22 } from "tamagui"; 31 - import useStreamplaceNode from "hooks/useStreamplaceNode"; 32 23 import Loading from "components/loading/loading"; 33 24 import { useToastController } from "@tamagui/toast"; 34 25 import { useNavigation } from "@react-navigation/native"; 35 - import AQLink from "components/aqlink"; 36 26 37 27 export default function Login() { 38 28 const dispatch = useAppDispatch(); 39 - const theme = useTheme(); 40 29 const chatProfile = useAppSelector(selectChatProfile); 41 30 const userProfile = useAppSelector(selectUserProfile); 42 - const pds = useAppSelector(selectPDS); 43 31 const loginState = useAppSelector(selectLogin); 44 - const [open, setOpen] = useState(false); 45 32 const [handle, setHandle] = useState(""); 46 33 const isReady = useAppSelector(selectIsReady); 47 34 const toast = useToastController(); 48 35 const navigation = useNavigation(); 49 - const onOpenChange = (open: boolean) => { 50 - setOpen(open); 51 - Keyboard.dismiss(); 36 + 37 + const submit = () => { 38 + dispatch(login(handle)); 52 39 }; 53 - 54 40 const onEnterPress = (e: any) => { 55 41 if (e.nativeEvent.key === "Enter") { 56 - dispatch(login(handle)); 42 + submit(); 57 43 } 58 44 }; 59 45 ··· 109 95 110 96 return ( 111 97 <KeyboardAvoidingView style={{ flex: 1 }} behavior="padding"> 112 - <Form 113 - flex={1} 114 - onSubmit={async () => { 115 - await dispatch(login(handle)); 116 - }} 117 - > 98 + <Form flex={1} onSubmit={submit}> 118 99 <View 119 100 f={1} 120 101 jc="center"
+1 -13
js/app/components/login/signup.tsx
··· 5 5 selectUserProfile, 6 6 } from "features/bluesky/blueskySlice"; 7 7 import { useEffect, useState } from "react"; 8 - import { 9 - Keyboard, 10 - KeyboardAvoidingView, 11 - Linking, 12 - Pressable, 13 - } from "react-native"; 8 + import { KeyboardAvoidingView, Linking, Pressable } from "react-native"; 14 9 import { useAppDispatch, useAppSelector } from "store/hooks"; 15 10 import { 16 11 Button, ··· 18 13 Input, 19 14 Spinner, 20 15 Text, 21 - useTheme, 22 16 View, 23 17 XStack, 24 18 YStack, ··· 30 24 31 25 export default function SignUp() { 32 26 const dispatch = useAppDispatch(); 33 - const theme = useTheme(); 34 27 const userProfile = useAppSelector(selectUserProfile); 35 28 const loginState = useAppSelector(selectLogin); 36 - const [open, setOpen] = useState<boolean>(false); 37 29 const [pds, setPDS] = useState<string>("https://bsky.social"); 38 30 const isReady = useAppSelector(selectIsReady); 39 31 const toast = useToastController(); 40 32 const navigation = useNavigation(); 41 - const onOpenChange = (open: boolean) => { 42 - setOpen(open); 43 - Keyboard.dismiss(); 44 - }; 45 33 46 34 const onSubmit = () => { 47 35 let thisPds = pds;