Skip to content
Merged
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
52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build Marketplace

on: push

jobs:
backend-check:
name: Backend Checks
runs-on: ubuntu-latest
container:
image: ghcr.io/astral-sh/uv:python3.11-bookworm
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |-
cd backend
uv sync --frozen
- name: Run ruff check
run: |-
cd backend
uv run ruff check .
- name: Run ruff format
run: |-
cd backend
uv run ruff format .

frontend-check:
name: Frontend Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: "pnpm"
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Install dependencies
run: |-
cd frontend
pnpm install --frozen-lockfile
- name: Run ESLint
run: |-
cd frontend
pnpm lint
- name: Run type check
run: |-
cd frontend
pnpm typecheck
5 changes: 3 additions & 2 deletions frontend/components/listings/ListingsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { Calendar } from "lucide-react";
import { Badge } from "@/components/ui/badge";
import { formatPrice, formatCondition, formatDate } from "@/lib/utils";
import { Item, Sublet } from "@/lib/types";
import defaultImage from "@/public/images/default-image.jpg";

const DEFAULT_IMAGE = "/images/default-image.jpg";

interface Props {
listing: Item | Sublet;
Expand Down Expand Up @@ -62,7 +63,7 @@ export const ListingsCard = ({ listing, previewImageUrl, href, isMyListing = fal
{/* image container */}
<div className="relative aspect-square w-full overflow-hidden bg-gray-100">
<Image
src={previewImageUrl || defaultImage}
src={previewImageUrl || DEFAULT_IMAGE}
alt={listing.title}
fill
className="object-cover transition-transform duration-200 group-hover:scale-105"
Expand Down
7 changes: 4 additions & 3 deletions frontend/components/listings/detail/ListingImageGallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import Image from "next/image";
import { useState } from "react";
import defaultImage from "@/public/images/default-image.jpg";
import { cn } from "@/lib/utils";

const DEFAULT_IMAGE = "/images/default-image.jpg";

interface Props {
images: string[];
}
Expand All @@ -17,7 +18,7 @@ export const ListingImageGallery = ({ images }: Props) => {
<div className="relative h-[400px] overflow-hidden rounded-2xl md:h-[450px] lg:h-[500px]">
{/* blurred background */}
<Image
src={images[selectedImage] || defaultImage}
src={images[selectedImage] || DEFAULT_IMAGE}
alt="Background"
fill
className="scale-110 object-cover opacity-50 blur-2xl"
Expand All @@ -27,7 +28,7 @@ export const ListingImageGallery = ({ images }: Props) => {
{/* main selected image */}
<div className="relative flex h-full w-full items-center justify-center">
<Image
src={images[selectedImage] || defaultImage}
src={images[selectedImage] || DEFAULT_IMAGE}
alt="Listing image"
fill
className="object-contain"
Expand Down