feat(frontend): add fediverse handle format hints to search page
This commit is contained in:
@@ -40,11 +40,15 @@ export default async function SearchPage({ searchParams }: SearchPageProps) {
|
|||||||
<p className="text-muted-foreground">
|
<p className="text-muted-foreground">
|
||||||
Find users and thoughts across the platform.
|
Find users and thoughts across the platform.
|
||||||
</p>
|
</p>
|
||||||
|
<p className="text-xs text-muted-foreground mt-1">
|
||||||
|
To find someone on Mastodon, type their full handle: @alice@mastodon.social
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const isHandle = HANDLE_RE.test(query);
|
const isHandle = HANDLE_RE.test(query);
|
||||||
|
const isPartialHandle = !isHandle && query.includes("@");
|
||||||
|
|
||||||
const [results, remoteActor, me] = await Promise.all([
|
const [results, remoteActor, me] = await Promise.all([
|
||||||
isHandle ? null : search(query, token).catch(() => null),
|
isHandle ? null : search(query, token).catch(() => null),
|
||||||
@@ -61,6 +65,11 @@ export default async function SearchPage({ searchParams }: SearchPageProps) {
|
|||||||
</p>
|
</p>
|
||||||
</header>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
|
{isPartialHandle && (
|
||||||
|
<p className="text-xs text-muted-foreground mb-4">
|
||||||
|
Looks like a fediverse handle. Use the full format: @alice@mastodon.social
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
{isHandle ? (
|
{isHandle ? (
|
||||||
remoteActor ? (
|
remoteActor ? (
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
|
|||||||
Reference in New Issue
Block a user