tangled
alpha
login
or
join now
vielle.dev
/
pdsls
forked from
pds.ls/pdsls
0
fork
atom
atproto explorer
0
fork
atom
overview
issues
pulls
pipelines
pds tabs
handle.invalid
5 months ago
ecfae1d7
1fd48998
verified
This commit was signed with the committer's
known signature
.
handle.invalid
SSH Key Fingerprint:
SHA256:mBrT4x0JdzLpbVR95g1hjI1aaErfC02kmLRkPXwsYCk=
+78
-39
1 changed file
expand all
collapse all
unified
split
src
views
pds.tsx
+78
-39
src/views/pds.tsx
···
2
2
import { Client, CredentialManager } from "@atcute/client";
3
3
import { InferXRPCBodyOutput } from "@atcute/lexicons";
4
4
import * as TID from "@atcute/tid";
5
5
-
import { A, useParams } from "@solidjs/router";
5
5
+
import { A, useLocation, useParams } from "@solidjs/router";
6
6
import { createResource, createSignal, For, Show } from "solid-js";
7
7
import { Button } from "../components/button";
8
8
import { Modal } from "../components/modal";
···
14
14
15
15
const PdsView = () => {
16
16
const params = useParams();
17
17
+
const location = useLocation();
17
18
const [version, setVersion] = createSignal<string>();
18
19
const [serverInfos, setServerInfos] =
19
20
createSignal<InferXRPCBodyOutput<ComAtprotoServerDescribeServer.mainSchema["output"]>>();
···
103
104
);
104
105
};
105
106
107
107
+
const Tab = (props: { tab: "repos" | "info"; label: string }) => (
108
108
+
<div class="flex items-center gap-0.5">
109
109
+
<A
110
110
+
classList={{
111
111
+
"flex items-center gap-1 border-b-2": true,
112
112
+
"border-transparent hover:border-neutral-400 dark:hover:border-neutral-600":
113
113
+
(!!location.hash && location.hash !== `#${props.tab}`) ||
114
114
+
(!location.hash && props.tab !== "repos"),
115
115
+
}}
116
116
+
href={`/${params.pds}#${props.tab}`}
117
117
+
>
118
118
+
{props.label}
119
119
+
</A>
120
120
+
</div>
121
121
+
);
122
122
+
106
123
return (
107
124
<Show when={repos() || response()}>
108
108
-
<div class="flex w-full flex-col px-2">
109
109
-
<Show when={version()}>
110
110
-
{(version) => (
111
111
-
<div class="flex items-baseline gap-x-1">
112
112
-
<span class="font-semibold">Version</span>
113
113
-
<span class="truncate text-sm">{version()}</span>
125
125
+
<div class="flex w-full flex-col">
126
126
+
<div class="dark:shadow-dark-800 dark:bg-dark-300 mb-2 flex w-full justify-between rounded-lg border-[0.5px] border-neutral-300 bg-neutral-50 px-2 py-1.5 text-sm shadow-xs dark:border-neutral-700">
127
127
+
<div class="flex gap-3">
128
128
+
<Tab tab="repos" label="Repositories" />
129
129
+
<Tab tab="info" label="Info" />
130
130
+
</div>
131
131
+
<Tooltip text="Firehose">
132
132
+
<A
133
133
+
href={`/firehose?instance=wss://${params.pds}`}
134
134
+
class="flex items-center rounded-lg p-1 hover:bg-neutral-200 active:bg-neutral-300 dark:hover:bg-neutral-700 dark:active:bg-neutral-600"
135
135
+
>
136
136
+
<span class="iconify lucide--radio-tower"></span>
137
137
+
</A>
138
138
+
</Tooltip>
139
139
+
</div>
140
140
+
<div class="flex flex-col gap-1 px-2">
141
141
+
<Show when={!location.hash || location.hash === "#repos"}>
142
142
+
<div class="flex flex-col divide-y-[0.5px] divide-neutral-300 dark:divide-neutral-700">
143
143
+
<For each={repos()}>{(repo) => <RepoCard {...repo} />}</For>
114
144
</div>
115
115
-
)}
116
116
-
</Show>
117
117
-
<Show when={serverInfos()}>
118
118
-
{(server) => (
119
119
-
<>
120
120
-
<Show when={server().inviteCodeRequired}>
121
121
-
<span class="font-semibold">Invite Code Required</span>
122
122
-
</Show>
123
123
-
<Show when={server().phoneVerificationRequired}>
124
124
-
<span class="font-semibold">Phone Verification Required</span>
125
125
-
</Show>
126
126
-
<Show when={server().availableUserDomains.length}>
127
127
-
<div class="flex flex-col">
128
128
-
<span class="font-semibold">Available User Domains</span>
129
129
-
<For each={server().availableUserDomains}>
130
130
-
{(domain) => <span class="text-sm wrap-anywhere">{domain}</span>}
131
131
-
</For>
145
145
+
</Show>
146
146
+
<Show when={location.hash === "#info"}>
147
147
+
<Show when={version()}>
148
148
+
{(version) => (
149
149
+
<div class="flex items-baseline gap-x-1">
150
150
+
<span class="font-semibold">Version</span>
151
151
+
<span class="truncate text-sm">{version()}</span>
132
152
</div>
133
133
-
</Show>
134
134
-
</>
135
135
-
)}
136
136
-
</Show>
137
137
-
<p class="w-full font-semibold">{repos()?.length} Repositories</p>
138
138
-
<div class="flex flex-col divide-y-[0.5px] divide-neutral-300 dark:divide-neutral-700">
139
139
-
<For each={repos()}>{(repo) => <RepoCard {...repo} />}</For>
153
153
+
)}
154
154
+
</Show>
155
155
+
<Show when={serverInfos()}>
156
156
+
{(server) => (
157
157
+
<>
158
158
+
<Show when={server().inviteCodeRequired}>
159
159
+
<span class="font-semibold">Invite Code Required</span>
160
160
+
</Show>
161
161
+
<Show when={server().phoneVerificationRequired}>
162
162
+
<span class="font-semibold">Phone Verification Required</span>
163
163
+
</Show>
164
164
+
<Show when={server().availableUserDomains.length}>
165
165
+
<div class="flex flex-col">
166
166
+
<span class="font-semibold">Available User Domains</span>
167
167
+
<For each={server().availableUserDomains}>
168
168
+
{(domain) => <span class="text-sm wrap-anywhere">{domain}</span>}
169
169
+
</For>
170
170
+
</div>
171
171
+
</Show>
172
172
+
</>
173
173
+
)}
174
174
+
</Show>
175
175
+
</Show>
140
176
</div>
141
177
</div>
142
142
-
<Show when={cursor()}>
143
143
-
<div class="dark:bg-dark-500 fixed bottom-0 z-5 flex w-screen justify-center bg-neutral-100 py-3">
144
144
-
<Show when={!response.loading}>
145
145
-
<Button onClick={() => refetch()}>Load More</Button>
146
146
-
</Show>
147
147
-
<Show when={response.loading}>
148
148
-
<span class="iconify lucide--loader-circle animate-spin py-3.5 text-xl"></span>
149
149
-
</Show>
178
178
+
<Show when={!location.hash || location.hash === "#repos"}>
179
179
+
<div class="dark:bg-dark-500 fixed bottom-0 z-5 flex w-screen justify-center bg-neutral-100 py-2">
180
180
+
<div class="flex flex-col items-center gap-1 pb-2">
181
181
+
<p>{repos()?.length} loaded</p>
182
182
+
<Show when={!response.loading && cursor()}>
183
183
+
<Button onClick={() => refetch()}>Load More</Button>
184
184
+
</Show>
185
185
+
<Show when={response.loading}>
186
186
+
<span class="iconify lucide--loader-circle animate-spin py-3.5 text-xl"></span>
187
187
+
</Show>
188
188
+
</div>
150
189
</div>
151
190
</Show>
152
191
</Show>