diff --git a/app/(password-reset)/forgot-password/page.tsx b/app/(password-reset)/forgot-password/page.tsx index 87fbd3a..c2d5a31 100644 --- a/app/(password-reset)/forgot-password/page.tsx +++ b/app/(password-reset)/forgot-password/page.tsx @@ -20,7 +20,6 @@ export default function ForgotPassword() {
- {" "}

Reset password

Enter your email address to get instructions for resetting your diff --git a/app/(password-reset)/password-reset/[token]/page.tsx b/app/(password-reset)/password-reset/[token]/page.tsx index 02ecbb4..48246c9 100644 --- a/app/(password-reset)/password-reset/[token]/page.tsx +++ b/app/(password-reset)/password-reset/[token]/page.tsx @@ -8,7 +8,7 @@ import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; import { resetPassword } from "./token"; -export default function ({ params }: { params: { token: string } }) { +export default function SharePage({ params }: { params: { token: string } }) { const [error, setError] = useState(""); async function submit(data: FormData) { @@ -17,8 +17,8 @@ export default function ({ params }: { params: { token: string } }) { } return ( -

- +
+ {" "}

Choose a new password

@@ -29,11 +29,11 @@ export default function ({ params }: { params: { token: string } }) { type="password" placeholder="Confirm password" /> - {error &&

{error}

} + {error &&

{error}

} Return to Login diff --git a/app/(sharing)/[token]/[id]/page.tsx b/app/(sharing)/[token]/[id]/page.tsx index e213d34..da8d298 100644 --- a/app/(sharing)/[token]/[id]/page.tsx +++ b/app/(sharing)/[token]/[id]/page.tsx @@ -84,22 +84,22 @@ export default async function Share({ ))} -
{chunithm.map((song) => (
- - {song.isFullCombo && "FULL COMBO!"} - -
- - Max combo: {song.maxCombo} +
+ + {song.isFullCombo ? `FULL COMBO! ${song.maxCombo}` : ""} + {!song.isFullCombo && ( + + Max combo: {song.maxCombo} + + )}
))}
-
{chunithm.map((song) => (
diff --git a/components/(customization)/avatarcustomization/page.tsx b/components/(customization)/avatarcustomization/page.tsx index aa349a9..e16fbd3 100644 --- a/components/(customization)/avatarcustomization/page.tsx +++ b/components/(customization)/avatarcustomization/page.tsx @@ -249,11 +249,12 @@ export const AvatarCustomization: FC = ({
{Object.entries(AvatarTextures).map(([key, { className, src }]) => (
- {""} + {key}
))}
+
diff --git a/components/(customization)/mapiconcustomization/page.tsx b/components/(customization)/mapiconcustomization/page.tsx index 1ba4aee..950aa9e 100644 --- a/components/(customization)/mapiconcustomization/page.tsx +++ b/components/(customization)/mapiconcustomization/page.tsx @@ -119,17 +119,15 @@ export const MapIconCustomization: FC = ({ return (
-
- {Object.entries(MapIconTextures).map(([key, { src }]) => ( -
- {mapIconId{" "} -
- ))} -
+ {Object.entries(MapIconTextures).map(([key, { src }]) => ( +
+ {mapIconId +
+ ))}
diff --git a/components/(customization)/nameplatecustomization/page.tsx b/components/(customization)/nameplatecustomization/page.tsx index fc6306e..2fbbda4 100644 --- a/components/(customization)/nameplatecustomization/page.tsx +++ b/components/(customization)/nameplatecustomization/page.tsx @@ -119,15 +119,12 @@ export const NameplateCustomization: FC = ({ return (
- {/* Avatar Customization Section */}
-
- {Object.entries(namePlateTextures).map(([key, { src }]) => ( -
- {""} -
- ))} -
+ {Object.entries(namePlateTextures).map(([key, { src }]) => ( +
+ {`Name +
+ ))}
diff --git a/components/(customization)/systemvoicecustomization/page.tsx b/components/(customization)/systemvoicecustomization/page.tsx index b1b6b04..c745b06 100644 --- a/components/(customization)/systemvoicecustomization/page.tsx +++ b/components/(customization)/systemvoicecustomization/page.tsx @@ -126,15 +126,16 @@ export const SystemVoiceCustomization: FC = ({ return (
- {/* Avatar Customization Section */}
-
- {Object.entries(systemVoiceTextures).map(([key, { src }]) => ( -
- {""} -
- ))} -
+ {Object.entries(systemVoiceTextures).map(([key, { src }]) => ( +
+ {`System +
+ ))}
diff --git a/components/(customization)/trophycustomization/page.tsx b/components/(customization)/trophycustomization/page.tsx index 35b1337..2cceaa5 100644 --- a/components/(customization)/trophycustomization/page.tsx +++ b/components/(customization)/trophycustomization/page.tsx @@ -102,8 +102,6 @@ export const TrophyCustomization: FC = ({ return (
- {/* Avatar Customization Section */} -
diff --git a/components/scoreplaylog/colums.tsx b/components/scoreplaylog/colums.tsx index 77351fc..ce3b76f 100644 --- a/components/scoreplaylog/colums.tsx +++ b/components/scoreplaylog/colums.tsx @@ -21,7 +21,7 @@ import { chuni_static_music } from "@/prisma/schemas/artemis/generated/artemis"; import { chuni_score_best } from "@/prisma/schemas/artemis/generated/artemis"; import { getDifficultyText, getGrade } from "@/lib/helpers"; import { Skeleton } from "../ui/skeleton"; - +import ActionsCell from "./moreAction"; type chunithm = chuni_score_playlog & chuni_static_music & chuni_score_best; export const columns: ColumnDef[] = [ @@ -161,47 +161,10 @@ export const columns: ColumnDef[] = [
{row.original.playCount}
), }, - + // for fixing react-hooks/rules-of-hooks { id: "actions", header: () =>
More
, - cell: ({ row }) => { - const [error, setError] = useState(""); - // eslint-disable-next-line react-hooks/rules-of-hooks - const router = useRouter(); - - const handleGenerateShareToken = async () => { - const { token, error } = await generateShareToken(row.original.id); - if (error) { - setError(error); - } else { - const newTab = window.open(`/${token}/${row.original.id}`); - if (newTab) { - newTab.focus(); - } else { - router.push(`/${token}/${row.original.id}`); - } - } - }; - - return ( - - - - - - Actions - - - - Share Song - - - - ); - }, + cell: ({ row }) => , }, ]; diff --git a/components/scoreplaylog/moreAction.tsx b/components/scoreplaylog/moreAction.tsx new file mode 100644 index 0000000..a1625d6 --- /dev/null +++ b/components/scoreplaylog/moreAction.tsx @@ -0,0 +1,56 @@ +import { useState } from "react"; +import { useRouter } from "next/navigation"; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuSeparator, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu"; +import { Button } from "@/components/ui/button"; +import { MoreHorizontal } from "lucide-react"; +import { generateShareToken } from "@/app/(sharing)/[token]/token"; + +interface ActionsCellProps { + row: any; //unsure what to use here +} + +const ActionsCell: React.FC = ({ row }) => { + const [error, setError] = useState(""); + const router = useRouter(); + + const handleGenerateShareToken = async () => { + const { token, error } = await generateShareToken(row.original.id); + if (error) { + setError(error); + } else { + const newTab = window.open(`/${token}/${row.original.id}`); + if (newTab) { + newTab.focus(); + } else { + router.push(`/${token}/${row.original.id}`); + } + } + }; + + return ( + + + + + + Actions + + + Share Song + + + + ); +}; + +export default ActionsCell;