Update player search form
All checks were successful
Deploy Frontend / docker (17, 3.8.5) (push) Successful in 3m6s
All checks were successful
Deploy Frontend / docker (17, 3.8.5) (push) Successful in 3m6s
This commit is contained in:
parent
b89fd74515
commit
45f38396c6
Binary file not shown.
@ -80,7 +80,7 @@ export const generateMetadata = async ({
|
|||||||
const player: CachedPlayer = await getPlayer(query); // Get the player to embed
|
const player: CachedPlayer = await getPlayer(query); // Get the player to embed
|
||||||
return Embed({
|
return Embed({
|
||||||
title: `${player.username}'s Player`,
|
title: `${player.username}'s Player`,
|
||||||
description: "Click to view data about this player.",
|
description: `UUID: ${player.uniqueId}\n\nClick to view data about this player.`,
|
||||||
thumbnail: player.skin.parts.HEAD,
|
thumbnail: player.skin.parts.HEAD,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import MinecraftButton from "@/components/minecraft-button";
|
import MinecraftButton from "@/components/minecraft-button";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
|
|
||||||
|
import { Label } from "@/components/ui/label";
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,12 +24,16 @@ const PlayerSearch = ({
|
|||||||
className="flex flex-col gap-7 justify-center items-center"
|
className="flex flex-col gap-7 justify-center items-center"
|
||||||
action={handleRedirect}
|
action={handleRedirect}
|
||||||
>
|
>
|
||||||
<Input
|
<div className="w-full flex flex-col gap-3">
|
||||||
name="query"
|
<Label>Username or UUID</Label>
|
||||||
placeholder="Username / UUID"
|
<Input
|
||||||
defaultValue={query}
|
type="search"
|
||||||
maxLength={36}
|
name="query"
|
||||||
/>
|
placeholder="Query..."
|
||||||
|
defaultValue={query}
|
||||||
|
maxLength={36}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<MinecraftButton type="submit">Search</MinecraftButton>
|
<MinecraftButton type="submit">Search</MinecraftButton>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
|
26
Frontend/src/app/components/ui/label.tsx
Normal file
26
Frontend/src/app/components/ui/label.tsx
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
||||||
|
import { cva, type VariantProps } from "class-variance-authority";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
|
import { cn } from "@/app/lib/utils";
|
||||||
|
|
||||||
|
const labelVariants = cva(
|
||||||
|
"text-sm font-medium text-zinc-300 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
||||||
|
);
|
||||||
|
|
||||||
|
const Label = React.forwardRef<
|
||||||
|
React.ElementRef<typeof LabelPrimitive.Root>,
|
||||||
|
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
|
||||||
|
VariantProps<typeof labelVariants>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<LabelPrimitive.Root
|
||||||
|
ref={ref}
|
||||||
|
className={cn(labelVariants(), className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
));
|
||||||
|
Label.displayName = LabelPrimitive.Root.displayName;
|
||||||
|
|
||||||
|
export { Label };
|
Loading…
x
Reference in New Issue
Block a user