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
cleanup code
handle.invalid
6 months ago
751f3f52
368b6074
+20
-21
2 changed files
expand all
collapse all
unified
split
src
components
navbar.tsx
layout.tsx
+14
-14
src/components/navbar.tsx
···
12
export const [validSchema, setValidSchema] = createSignal<boolean | undefined>(undefined);
13
14
const swapIcons: Record<string, string> = {
15
-
"did:plc:vwzwgnygau7ed7b7wt5ux7y2": "iconify lucide--microchip",
16
-
"did:plc:oisofpd7lj26yvgiivf3lxsi": "iconify lucide--bone",
17
-
"did:plc:uu5axsmbm2or2dngy4gwchec": "iconify lucide--train-track",
18
-
"did:plc:7x6rtuenkuvxq3zsvffp2ide": "iconify lucide--rabbit",
19
-
"did:plc:ia76kvnndjutgedggx2ibrem": "iconify lucide--rabbit",
20
-
"did:plc:hvakvedv6byxhufjl23mfmsd": "iconify lucide--rat",
21
-
"did:plc:ezhjhbzqt32bqprrn6qjlkri": "iconify lucide--film",
22
-
"did:plc:6v6jqsy7swpzuu53rmzaybjy": "iconify lucide--fish",
23
-
"did:plc:hx53snho72xoj7zqt5uice4u": "iconify lucide--rose",
24
-
"did:plc:wzsilnxf24ehtmmc3gssy5bu": "iconify lucide--music-2",
25
-
"did:plc:bnqkww7bjxaacajzvu5gswdf": "iconify lucide--gem",
26
-
"did:plc:hdhoaan3xa3jiuq4fg4mefid": "iconify lucide--sparkles",
27
};
28
29
const NavBar = (props: { params: Params }) => {
···
144
setShowHandle(!showHandle());
145
}}
146
class={
147
-
`shrink-0 text-lg transition-transform duration-400 ${showHandle() ? "rotate-y-180" : ""} ` +
148
-
(swapIcons[props.params.repo] ?? "iconify lucide--arrow-left-right")
149
}
150
></button>
151
</Tooltip>
···
12
export const [validSchema, setValidSchema] = createSignal<boolean | undefined>(undefined);
13
14
const swapIcons: Record<string, string> = {
15
+
"did:plc:vwzwgnygau7ed7b7wt5ux7y2": "lucide--microchip",
16
+
"did:plc:oisofpd7lj26yvgiivf3lxsi": "lucide--bone",
17
+
"did:plc:uu5axsmbm2or2dngy4gwchec": "lucide--train-track",
18
+
"did:plc:7x6rtuenkuvxq3zsvffp2ide": "lucide--rabbit",
19
+
"did:plc:ia76kvnndjutgedggx2ibrem": "lucide--rabbit",
20
+
"did:plc:hvakvedv6byxhufjl23mfmsd": "lucide--rat",
21
+
"did:plc:ezhjhbzqt32bqprrn6qjlkri": "lucide--film",
22
+
"did:plc:6v6jqsy7swpzuu53rmzaybjy": "lucide--fish",
23
+
"did:plc:hx53snho72xoj7zqt5uice4u": "lucide--rose",
24
+
"did:plc:wzsilnxf24ehtmmc3gssy5bu": "lucide--music-2",
25
+
"did:plc:bnqkww7bjxaacajzvu5gswdf": "lucide--gem",
26
+
"did:plc:hdhoaan3xa3jiuq4fg4mefid": "lucide--sparkles",
27
};
28
29
const NavBar = (props: { params: Params }) => {
···
144
setShowHandle(!showHandle());
145
}}
146
class={
147
+
`iconify shrink-0 text-lg transition-transform duration-400 ${showHandle() ? "rotate-y-180" : ""} ` +
148
+
(swapIcons[props.params.repo] ?? "lucide--arrow-left-right")
149
}
150
></button>
151
</Tooltip>
+6
-7
src/layout.tsx
···
1
import { createEffect, createSignal, ErrorBoundary, Show, Suspense } from "solid-js";
2
-
import { A, RouteSectionProps, useLocation, useNavigate, useParams } from "@solidjs/router";
3
import { agent } from "./components/login.jsx";
4
import { RecordEditor } from "./components/create.jsx";
5
import Tooltip from "./components/tooltip.jsx";
···
18
}>({ show: false });
19
20
const Layout = (props: RouteSectionProps<unknown>) => {
21
-
const params = useParams();
22
const location = useLocation();
23
const navigate = useNavigate();
24
let timeout: number;
25
26
createEffect(async () => {
27
-
if (params.repo && !params.repo.startsWith("did:")) {
28
-
const did = await resolveHandle(params.repo as Handle);
29
-
navigate(location.pathname.replace(params.repo, did));
30
}
31
});
32
···
72
<Show when={location.pathname !== "/jetstream" && location.pathname !== "/firehose"}>
73
<Search />
74
</Show>
75
-
<Show when={params.pds}>
76
-
<NavBar params={params} />
77
</Show>
78
<Show keyed when={location.pathname}>
79
<ErrorBoundary
···
1
import { createEffect, createSignal, ErrorBoundary, Show, Suspense } from "solid-js";
2
+
import { A, RouteSectionProps, useLocation, useNavigate } from "@solidjs/router";
3
import { agent } from "./components/login.jsx";
4
import { RecordEditor } from "./components/create.jsx";
5
import Tooltip from "./components/tooltip.jsx";
···
18
}>({ show: false });
19
20
const Layout = (props: RouteSectionProps<unknown>) => {
0
21
const location = useLocation();
22
const navigate = useNavigate();
23
let timeout: number;
24
25
createEffect(async () => {
26
+
if (props.params.repo && !props.params.repo.startsWith("did:")) {
27
+
const did = await resolveHandle(props.params.repo as Handle);
28
+
navigate(location.pathname.replace(props.params.repo, did));
29
}
30
});
31
···
71
<Show when={location.pathname !== "/jetstream" && location.pathname !== "/firehose"}>
72
<Search />
73
</Show>
74
+
<Show when={props.params.pds}>
75
+
<NavBar params={props.params} />
76
</Show>
77
<Show keyed when={location.pathname}>
78
<ErrorBoundary