tangled
alpha
login
or
join now
stream.place
/
streamplace
Live video on the AT Protocol
74
fork
atom
overview
issues
1
pulls
pipelines
remove unused state and imports
Natalie B.
8 months ago
d5eefd0e
3cbb9824
+7
-38
2 changed files
expand all
collapse all
unified
split
js
app
components
login
login.tsx
signup.tsx
+6
-25
js/app/components/login/login.tsx
···
1
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
9
-
selectPDS,
10
8
selectUserProfile,
11
11
-
setPDS,
12
9
} from "features/bluesky/blueskySlice";
13
10
import { useEffect, useState } from "react";
14
14
-
import { Keyboard, KeyboardAvoidingView } from "react-native";
11
11
+
import { KeyboardAvoidingView } from "react-native";
15
12
import { useAppDispatch, useAppSelector } from "store/hooks";
16
13
import {
17
14
Button,
18
15
Form,
19
19
-
H3,
20
20
-
H5,
21
16
Input,
22
22
-
Label,
23
23
-
Sheet,
24
17
Spinner,
25
18
Text,
26
26
-
useTheme,
27
19
View,
28
20
XStack,
29
21
YStack,
30
22
} from "tamagui";
31
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
35
-
import AQLink from "components/aqlink";
36
26
37
27
export default function Login() {
38
28
const dispatch = useAppDispatch();
39
39
-
const theme = useTheme();
40
29
const chatProfile = useAppSelector(selectChatProfile);
41
30
const userProfile = useAppSelector(selectUserProfile);
42
42
-
const pds = useAppSelector(selectPDS);
43
31
const loginState = useAppSelector(selectLogin);
44
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
49
-
const onOpenChange = (open: boolean) => {
50
50
-
setOpen(open);
51
51
-
Keyboard.dismiss();
36
36
+
37
37
+
const submit = () => {
38
38
+
dispatch(login(handle));
52
39
};
53
53
-
54
40
const onEnterPress = (e: any) => {
55
41
if (e.nativeEvent.key === "Enter") {
56
56
-
dispatch(login(handle));
42
42
+
submit();
57
43
}
58
44
};
59
45
···
109
95
110
96
return (
111
97
<KeyboardAvoidingView style={{ flex: 1 }} behavior="padding">
112
112
-
<Form
113
113
-
flex={1}
114
114
-
onSubmit={async () => {
115
115
-
await dispatch(login(handle));
116
116
-
}}
117
117
-
>
98
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
8
-
import {
9
9
-
Keyboard,
10
10
-
KeyboardAvoidingView,
11
11
-
Linking,
12
12
-
Pressable,
13
13
-
} from "react-native";
8
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
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
33
-
const theme = useTheme();
34
27
const userProfile = useAppSelector(selectUserProfile);
35
28
const loginState = useAppSelector(selectLogin);
36
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
41
-
const onOpenChange = (open: boolean) => {
42
42
-
setOpen(open);
43
43
-
Keyboard.dismiss();
44
44
-
};
45
33
46
34
const onSubmit = () => {
47
35
let thisPds = pds;