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 search component
handle.invalid
6 months ago
0423717e
64685228
verified
This commit was signed with the committer's
known signature
.
handle.invalid
SSH Key Fingerprint:
SHA256:mBrT4x0JdzLpbVR95g1hjI1aaErfC02kmLRkPXwsYCk=
+15
-18
1 changed file
expand all
collapse all
unified
split
src
components
search.tsx
+15
-18
src/components/search.tsx
···
43
43
if (useLocation().pathname !== "/") searchInput.focus();
44
44
});
45
45
46
46
-
const processInput = async (input: string) => {
46
46
+
const processInput = (input: string) => {
47
47
input = input.trim().replace(/^@/, "");
48
48
if (!input.length) return;
49
49
setShowSearch(false);
···
65
65
66
66
return (
67
67
<form
68
68
-
class="flex w-full max-w-[22rem] flex-col sm:max-w-[24rem]"
69
69
-
id="uriForm"
68
68
+
class="w-[22rem] sm:w-[24rem]"
70
69
onsubmit={(e) => {
71
70
e.preventDefault();
72
71
processInput(searchInput.value);
···
75
74
<label for="input" class="hidden">
76
75
PDS URL, AT URI, or handle
77
76
</label>
78
78
-
<div class="flex w-full items-center gap-2">
79
79
-
<div class="dark:bg-dark-100 dark:shadow-dark-800 flex grow items-center gap-2 rounded-lg border-[0.5px] border-neutral-300 bg-white px-2 py-1 shadow-xs focus-within:outline-[1.5px] focus-within:outline-neutral-900 dark:border-neutral-700 dark:focus-within:outline-neutral-200">
80
80
-
<input
81
81
-
type="text"
82
82
-
spellcheck={false}
83
83
-
placeholder="PDS URL, AT URI, or handle"
84
84
-
ref={searchInput}
85
85
-
id="input"
86
86
-
class="grow select-none placeholder:text-sm focus:outline-none"
87
87
-
/>
88
88
-
<button
89
89
-
type="submit"
90
90
-
class="iconify lucide--arrow-right text-lg text-neutral-500 dark:text-neutral-400"
91
91
-
></button>
92
92
-
</div>
77
77
+
<div class="dark:bg-dark-100 dark:shadow-dark-800 flex items-center gap-2 rounded-lg border-[0.5px] border-neutral-300 bg-white px-2 py-1 shadow-xs focus-within:outline-[1.5px] focus-within:outline-neutral-900 dark:border-neutral-700 dark:focus-within:outline-neutral-200">
78
78
+
<input
79
79
+
type="text"
80
80
+
spellcheck={false}
81
81
+
placeholder="PDS URL, AT URI, or handle"
82
82
+
ref={searchInput}
83
83
+
id="input"
84
84
+
class="grow select-none placeholder:text-sm focus:outline-none"
85
85
+
/>
86
86
+
<button
87
87
+
type="submit"
88
88
+
class="iconify lucide--arrow-right text-lg text-neutral-500 dark:text-neutral-400"
89
89
+
></button>
93
90
</div>
94
91
</form>
95
92
);