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
|
||||
return Embed({
|
||||
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,
|
||||
});
|
||||
} catch (err) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
import MinecraftButton from "@/components/minecraft-button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
/**
|
||||
@ -23,12 +24,16 @@ const PlayerSearch = ({
|
||||
className="flex flex-col gap-7 justify-center items-center"
|
||||
action={handleRedirect}
|
||||
>
|
||||
<Input
|
||||
name="query"
|
||||
placeholder="Username / UUID"
|
||||
defaultValue={query}
|
||||
maxLength={36}
|
||||
/>
|
||||
<div className="w-full flex flex-col gap-3">
|
||||
<Label>Username or UUID</Label>
|
||||
<Input
|
||||
type="search"
|
||||
name="query"
|
||||
placeholder="Query..."
|
||||
defaultValue={query}
|
||||
maxLength={36}
|
||||
/>
|
||||
</div>
|
||||
<MinecraftButton type="submit">Search</MinecraftButton>
|
||||
</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…
Reference in New Issue
Block a user