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