Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(MusicCardInfo): close #83 #89

Merged
merged 2 commits into from
Nov 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 29 additions & 32 deletions src/components/contexts_menu/MusicCardInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,35 @@ export function MusicCardInfo({ audio }: { audio: Audio }) {
<DialogTrigger asChild>
<p>Information</p>
</DialogTrigger>
<DialogContent className="bg-white dark:bg-gray-800 p-8 rounded-lg">
<div className="flex items-start space-x-6">
<Image
className="rounded-lg object-cover shadow-lg"
src={byteToImage(audio.cover)}
height={200}
width={200}
alt="Album cover"
style={{
aspectRatio: "1/1",
objectFit: "cover",
overflow: "visible", // Set overflow to visible
}}
/>
<div className="flex flex-col space-y-2">
<p className="text-xl font-semibold dark:text-white">{audio.title}</p>
<div>
<Label className="text-gray-500 dark:text-gray-300">Artist</Label>
<p className="text-gray-500 dark:text-gray-300">{audio.artist}</p>
</div>
<div>
<Label className="text-gray-500 dark:text-gray-300">Duration</Label>
<p className="text-gray-400 dark:text-gray-200">
{format_duration(audio.duration)}
</p>
</div>
<div>
<Label className="text-gray-500 dark:text-gray-300">Folder path</Label>
<p className="text-gray-400 dark:text-gray-200">
{audio.path.substring(0, audio.path.lastIndexOf("/"))}
</p>
</div>
<DialogContent className="bg-white dark:bg-gray-800 p-8 rounded-lg flex items-start gap-6 max-w-2xl">
<Image
className="rounded-lg object-cover shadow-lg aspect-square"
src={byteToImage(audio.cover)}
height={200}
width={200}
alt="Album cover"
/>
<div className="flex flex-col gap-2 flex-1">
<p className="text-xl font-semibold dark:text-white break-all line-clamp-1">
{audio.title}
</p>
<div>
<Label className="text-gray-500 dark:text-gray-300">Artist</Label>
<p className="text-gray-500 dark:text-gray-300 break-all line-clamp-1">
{audio.artist}
</p>
</div>
<div>
<Label className="text-gray-500 dark:text-gray-300">Duration</Label>
<p className="text-gray-400 dark:text-gray-200">
{format_duration(audio.duration)}
</p>
</div>
<div>
<Label className="text-gray-500 dark:text-gray-300">Folder path</Label>
<p className="text-gray-400 dark:text-gray-200 break-all line-clamp-1">
{audio.path.replace(/[/\\][^/\\]*$/, "")}
</p>
</div>
</div>
</DialogContent>
Expand Down