added skeleton for jacket art
This commit is contained in:
@ -1,24 +1,11 @@
|
||||
"use client";
|
||||
|
||||
import { ColumnDef } from "@tanstack/react-table";
|
||||
import { MoreHorizontal } from "lucide-react";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuLabel,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { generateShareToken } from "@/app/(sharing)/[token]/token";
|
||||
import { ArrowUpDown, MoreHorizontalIcon } from "lucide-react";
|
||||
import { ArrowUpDown } from "lucide-react";
|
||||
import { chuni_score_playlog } from "@/prisma/schemas/artemis/generated/artemis";
|
||||
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";
|
||||
@ -32,17 +19,29 @@ export const columns: ColumnDef<chunithm>[] = [
|
||||
|
||||
cell: ({ row }) => {
|
||||
const jacketPath = row.original.jacketPath?.replace(".dds", ".png");
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
|
||||
const handleImageLoad = () => {
|
||||
setIsLoading(false);
|
||||
};
|
||||
|
||||
const handleImageError = () => {
|
||||
setIsLoading(false);
|
||||
};
|
||||
return (
|
||||
<div className="flex w-[300px] items-center truncate font-medium">
|
||||
{!jacketPath ? (
|
||||
<Skeleton className="mr-2 inline-block h-8 w-8" />
|
||||
) : (
|
||||
{jacketPath ? (
|
||||
<img
|
||||
src={`/jacketArts/${jacketPath}`}
|
||||
alt="Jacket"
|
||||
className="mr-2 inline-block h-[70px] w-[70px]"
|
||||
className={`mr-2 inline-block h-[70px] w-[70px] ${
|
||||
isLoading ? "hidden" : ""
|
||||
}`}
|
||||
onLoad={handleImageLoad}
|
||||
onError={handleImageError}
|
||||
/>
|
||||
) : (
|
||||
<Skeleton className="mr-2 inline-block h-[70px] w-[70px]" />
|
||||
)}
|
||||
<span className="truncate">{row.original.title}</span>
|
||||
</div>
|
||||
|
@ -1,5 +1,8 @@
|
||||
import React, { FC } from "react";
|
||||
"use client";
|
||||
|
||||
import React, { FC, useState } from "react";
|
||||
import { getDifficultyText } from "@/lib/helpers";
|
||||
import { Skeleton } from "../ui/skeleton";
|
||||
|
||||
type userRatingBaseList = {
|
||||
title: string;
|
||||
@ -32,15 +35,30 @@ export const ChunithmHotPlays: FC<ChunithmProfileHotPlays> = ({
|
||||
".dds",
|
||||
".png",
|
||||
);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
|
||||
const handleImageLoad = () => {
|
||||
setIsLoading(false);
|
||||
};
|
||||
|
||||
const handleImageError = () => {
|
||||
setIsLoading(false);
|
||||
};
|
||||
return (
|
||||
<div key={index} className="flex flex-col items-center p-2">
|
||||
<div className="font-bold"></div>
|
||||
{jacketPath && (
|
||||
{jacketPath ? (
|
||||
<img
|
||||
src={`/jacketArts/${jacketPath}`}
|
||||
alt="Jacket"
|
||||
className="h-28 w-28"
|
||||
className={`mr-2 inline-block h-[100px] w-[100px] ${
|
||||
isLoading ? "hidden" : ""
|
||||
}`}
|
||||
onLoad={handleImageLoad}
|
||||
onError={handleImageError}
|
||||
/>
|
||||
) : (
|
||||
<Skeleton className="mr-2 inline-block h-[100px] w-[100px]" />
|
||||
)}
|
||||
<div>
|
||||
<ul className="mt-2 text-center">
|
||||
|
@ -1,9 +1,7 @@
|
||||
import React, { FC } from "react";
|
||||
import {
|
||||
chuni_profile_rating,
|
||||
chuni_static_music,
|
||||
} from "@/prisma/schemas/artemis/generated/artemis";
|
||||
"use client";
|
||||
import React, { FC, useState } from "react";
|
||||
import { getDifficultyText } from "@/lib/helpers";
|
||||
import { Skeleton } from "../ui/skeleton";
|
||||
|
||||
type userRatingBaseList = {
|
||||
title: string;
|
||||
@ -37,15 +35,30 @@ export const ChunithmTopPlays: FC<chunithmTopPlays> = ({
|
||||
".dds",
|
||||
".png",
|
||||
);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
|
||||
const handleImageLoad = () => {
|
||||
setIsLoading(false);
|
||||
};
|
||||
|
||||
const handleImageError = () => {
|
||||
setIsLoading(false);
|
||||
};
|
||||
return (
|
||||
<div key={index} className="flex flex-col items-center p-2">
|
||||
<div className="font-bold"></div>
|
||||
{jacketPath && (
|
||||
{jacketPath ? (
|
||||
<img
|
||||
src={`/jacketArts/${jacketPath}`}
|
||||
alt="Jacket"
|
||||
className="h-28 w-28"
|
||||
className={`mr-2 inline-block h-[100px] w-[100px] ${
|
||||
isLoading ? "hidden" : ""
|
||||
}`}
|
||||
onLoad={handleImageLoad}
|
||||
onError={handleImageError}
|
||||
/>
|
||||
) : (
|
||||
<Skeleton className="mr-2 inline-block h-[100px] w-[100px]" />
|
||||
)}
|
||||
<ul className="mt-2 text-center">
|
||||
<li>
|
||||
|
@ -1,5 +1,7 @@
|
||||
import React, { FC } from "react";
|
||||
"use client";
|
||||
import React, { FC, useState } from "react";
|
||||
import { getDifficultyText } from "@/lib/helpers";
|
||||
import { Skeleton } from "../ui/skeleton";
|
||||
|
||||
type userRatingBaseList = {
|
||||
title: string;
|
||||
@ -32,15 +34,30 @@ export const ChunithmNextPlays: FC<ChunithmProfileHotPlays> = ({
|
||||
".dds",
|
||||
".png",
|
||||
);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
|
||||
const handleImageLoad = () => {
|
||||
setIsLoading(false);
|
||||
};
|
||||
|
||||
const handleImageError = () => {
|
||||
setIsLoading(false);
|
||||
};
|
||||
return (
|
||||
<div key={index} className="flex flex-col items-center p-2">
|
||||
<div className="font-bold"></div>
|
||||
{jacketPath && (
|
||||
{jacketPath ? (
|
||||
<img
|
||||
src={`/jacketArts/${jacketPath}`}
|
||||
alt="Jacket"
|
||||
className="h-28 w-28"
|
||||
className={`mr-2 inline-block h-[100px] w-[100px] ${
|
||||
isLoading ? "hidden" : ""
|
||||
}`}
|
||||
onLoad={handleImageLoad}
|
||||
onError={handleImageError}
|
||||
/>
|
||||
) : (
|
||||
<Skeleton className="mr-2 inline-block h-[100px] w-[100px]" />
|
||||
)}
|
||||
<div>
|
||||
<ul className="mt-2 text-center">
|
||||
|
Reference in New Issue
Block a user