tangled
alpha
login
or
join now
teal.fm
/
teal
109
fork
atom
Your music, beautifully tracked. All yours. (coming soon)
teal.fm
teal-fm
atproto
109
fork
atom
overview
issues
pulls
pipelines
it works
mmatt.net
1 year ago
547ae18d
4ec179fe
+38
-17
3 changed files
expand all
collapse all
unified
split
apps
amethyst
app
(tabs)
index.tsx
package.json
pnpm-lock.yaml
+32
-15
apps/amethyst/app/(tabs)/index.tsx
···
1
1
import * as React from "react";
2
2
import { View } from "react-native";
3
3
-
import { Avatar, AvatarFallback, AvatarImage } from "../../components/ui/avatar";
3
3
+
import {
4
4
+
Avatar,
5
5
+
AvatarFallback,
6
6
+
AvatarImage,
7
7
+
} from "../../components/ui/avatar";
4
8
import {
5
9
Card,
6
10
CardContent,
7
7
-
CardDescription,
8
8
-
CardFooter,
9
11
CardHeader,
10
12
CardTitle,
11
13
} from "../../components/ui/card";
12
14
import { Text } from "../../components/ui/text";
13
13
-
import AuthOptions from "../auth/options";
14
15
import { useStore } from "../../stores/mainStore";
16
16
+
import AuthOptions from "../auth/options";
15
17
16
18
import { Response } from "@atproto/api/src/client/types/app/bsky/actor/getProfile";
17
19
···
27
29
const isReady = useStore((state) => state.isAgentReady);
28
30
React.useEffect(() => {
29
31
if (agent) {
30
30
-
agent.getProfile({actor: "natalie.sh"}).then((profile) => {
31
31
-
console.log(profile)
32
32
-
return setProfile(profile);
33
33
-
}).catch((e)=>{
34
34
-
console.log(e)
35
35
-
})
32
32
+
agent
33
33
+
.getProfile({ actor: agent.did ?? "teal.fm" })
34
34
+
.then((profile) => {
35
35
+
console.log(profile);
36
36
+
return setProfile(profile);
37
37
+
})
38
38
+
.catch((e) => {
39
39
+
console.log(e);
40
40
+
});
36
41
} else {
37
37
-
console.log("No agent")
42
42
+
console.log("No agent");
38
43
}
39
44
}, [isReady]);
40
45
···
51
56
<Card className="w-full max-w-full p-6 rounded-2xl">
52
57
<CardHeader className="items-center">
53
58
<Avatar alt="Rick Sanchez's Avatar" className="w-24 h-24">
54
54
-
<AvatarImage source={{ uri: profile?.data.avatar ?? GITHUB_AVATAR_URI }} />
59
59
+
<AvatarImage
60
60
+
source={{ uri: profile?.data.avatar ?? GITHUB_AVATAR_URI }}
61
61
+
/>
55
62
<AvatarFallback>
56
56
-
<Text>{profile?.data.displayName?.substring(0,1) ?? " Richard"}</Text>
63
63
+
<Text>
64
64
+
{profile?.data.displayName?.substring(0, 1) ?? " Richard"}
65
65
+
</Text>
57
66
</AvatarFallback>
58
67
</Avatar>
59
68
<View className="p-3" />
60
60
-
<CardTitle className="text-center">{profile?.data.displayName ?? " Richard"}</CardTitle>
69
69
+
<CardTitle className="text-center">
70
70
+
{profile?.data.displayName ?? " Richard"}
71
71
+
</CardTitle>
61
72
<CardContent className="text-center w-full">
62
62
-
{profile ? (profile.data?.description?.split('\n').map((str,i) => <Text className="text-center" key={i}>{str}</Text>) || "A very mysterious person") : "Loading..."}
73
73
+
{profile
74
74
+
? profile.data?.description?.split("\n").map((str, i) => (
75
75
+
<Text className="text-center" key={i}>
76
76
+
{str}
77
77
+
</Text>
78
78
+
)) || "A very mysterious person"
79
79
+
: "Loading..."}
63
80
</CardContent>
64
81
</CardHeader>
65
82
</Card>
+3
-2
apps/amethyst/package.json
···
29
29
"@rn-primitives/slot": "^1.1.0",
30
30
"@rn-primitives/tooltip": "^1.1.0",
31
31
"@rn-primitives/types": "^1.1.0",
32
32
+
"@teal/lexicons": "workspace:*",
32
33
"class-variance-authority": "^0.7.1",
33
34
"clsx": "^2.1.1",
34
35
"eslint-plugin-react-compiler": "19.0.0-beta-37ed2a7-20241206",
35
36
"expo": "~52.0.17",
37
37
+
"expo-constants": "^17.0.3",
36
38
"expo-font": "~13.0.1",
37
39
"expo-linking": "~7.0.3",
38
40
"expo-router": "~4.0.1",
···
53
55
"react-native-svg": "15.8.0",
54
56
"react-native-web": "~0.19.13",
55
57
"tailwind-merge": "^2.5.5",
56
56
-
"zustand": "^5.0.1",
57
57
-
"@teal/lexicons": "workspace:*"
58
58
+
"zustand": "^5.0.1"
58
59
},
59
60
"devDependencies": {
60
61
"@babel/core": "^7.26.0",
+3
pnpm-lock.yaml
···
80
80
expo:
81
81
specifier: ~52.0.17
82
82
version: 52.0.23(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@expo/metro-runtime@4.0.0(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@types/react@18.3.12)(react@18.3.1)))(babel-plugin-react-compiler@19.0.0-beta-37ed2a7-20241206)(react-compiler-runtime@19.0.0-beta-37ed2a7-20241206(react@18.3.1))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@types/react@18.3.12)(react@18.3.1))(react@18.3.1)
83
83
+
expo-constants:
84
84
+
specifier: ^17.0.3
85
85
+
version: 17.0.3(expo@52.0.23(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@expo/metro-runtime@4.0.0(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@types/react@18.3.12)(react@18.3.1)))(babel-plugin-react-compiler@19.0.0-beta-37ed2a7-20241206)(react-compiler-runtime@19.0.0-beta-37ed2a7-20241206(react@18.3.1))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@types/react@18.3.12)(react@18.3.1))(react@18.3.1))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@types/react@18.3.12)(react@18.3.1))
83
86
expo-font:
84
87
specifier: ~13.0.1
85
88
version: 13.0.2(expo@52.0.23(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@expo/metro-runtime@4.0.0(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@types/react@18.3.12)(react@18.3.1)))(babel-plugin-react-compiler@19.0.0-beta-37ed2a7-20241206)(react-compiler-runtime@19.0.0-beta-37ed2a7-20241206(react@18.3.1))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@types/react@18.3.12)(react@18.3.1))(react@18.3.1))(react@18.3.1)