Skip to content

fixed track preview card #742

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
11 changes: 7 additions & 4 deletions apps/web/components/TrackPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Button } from "../../../packages/ui/src/shad/ui/button";
import { Dialog, DialogContent } from "../../../packages/ui/src/shad/ui/dailog";
import { ArrowRight } from "lucide-react";
import { formatDistanceToNow } from "date-fns";
import { Separator } from "@repo/ui";

type TrackPreviewProps = {
showPreview: boolean;
Expand Down Expand Up @@ -40,9 +41,11 @@ export function TrackPreview({ showPreview, setShowPreview, track }: TrackPrevie

return (
<Dialog open={showPreview} onOpenChange={() => setShowPreview(false)}>
<DialogContent className="flex items-center gap-4">
<div className="flex flex-col gap-4 w-full">
<img src={track.image} className="h-[25vh] w-full object-cover rounded-lg" />
<DialogContent className="flex items-center gap-4 max-h-[90vh] overflow-scroll no-scrollbar">
<div className="flex flex-col space-y-4 w-full">
<Separator className="w-full" />
<Separator className="w-full" />
<img src={track.image} alt={track.title} className="rounded-md mx-auto max-h-[30vh] pt-12" />
<div className="flex flex-col gap-4 bg-primary/5 rounded-lg p-4">
<div className="flex flex-col gap-4">
<h3 className="text-xl md:text-2xl font-semibold w-full tracking-tight">{track.title}</h3>
Expand All @@ -68,7 +71,7 @@ export function TrackPreview({ showPreview, setShowPreview, track }: TrackPrevie
{formatDistanceToNow(new Date(track.createdAt), { addSuffix: true })}
</p>
</div>
<div className="max-h-[25vh] overflow-y-auto flex flex-col gap-3 w-full py-2">
<div className="max-h-[25vh] overflow-y-auto flex flex-col gap-3 w-full py-2 no-scrollbar">
{track.problems.map((topic: any, idx: number) => (
<Link key={topic.id} href={`/tracks/${track.id}/${track.problems[idx]?.id}`}>
<div className="cursor-pointer hover:-translate-y-1 flex items-center justify-between bg-primary/5 rounded-lg px-4 py-3 hover:bg-primary/10 transition-all duration-300 scroll-smooth w-full">
Expand Down
15 changes: 14 additions & 1 deletion apps/web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ module.exports = {

transpilePackages: ["@repo/ui", "@repo/common", "@repo/recoil"],
images: {
domains: ["d2szwvl7yo497w.cloudfront.net", "appx-wsb-gcp.akamai.net.in"], // Add your domain here
remotePatterns: [
{
protocol: "https",
hostname: "d2szwvl7yo497w.cloudfront.net",
port: "",
pathname: "/**",
},
{
protocol: "https",
hostname: "appx-wsb-gcp.akamai.net.in",
port: "",
pathname: "/**",
}
],
},
};