Skip to content

About

A Samsung-style washing machine product listing page (Polish UI) built with React 19, TypeScript and Vite. Originally a web-dev test task for Cheil Poland.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Samsung Product Listing Component

A Samsung-style washing machine product listing page (Polish UI) built with React 19, TypeScript and Vite. Originally a web-dev test task for Cheil Poland.

Live demo: web-dev-test-task-cheil.vercel.app

Features

  • 🔍 Debounced search — filters by product name 250ms after the last keystroke
  • 🗂 Sort & filter dropdowns — popularity / price / capacity sorting, plus function, energy class and capacity filters (all combinable with search)
  • ➕ "Pokaż więcej" — loads 6 more cards per click, resets when filters change
  • 🔢 Live result counter
  • 📱 Fully responsive card grid (3 → 2 → 1 columns)
  • 🖼 WebP product images, self-hosted Samsung fonts
  • 🐳 Docker support (Bun build → Nginx)

Tech Stack

React 19 · TypeScript 5.8 · Vite 7 (SWC) · SCSS · Bun · ESLint 9

State is managed with React Context + custom hooks — no external state libraries.

Getting Started

Requires Bun ≥ 1.2 (npm works too, but the lockfile is bun.lock).

git clone https://github.com/CharlesSBL/Samsung-component_implementation.git
cd Samsung-component_implementation
bun install
bun run dev        # → http://localhost:5173

Scripts

Command Description
bun run dev Start dev server with HMR
bun run build Production build → dist/
bun run preview Preview the production build
bun run lint Run ESLint

Docker

docker build -t cheil-poland .
docker run -d -p 8080:80 cheil-poland   # → http://localhost:8080

Multi-stage build: oven/bun:1 compiles the app, nginx:stable-alpine serves the static output. A run.sh helper script is included.

Project Structure

public/
├── data/products/products.json    # Dataset (15 products) + field docs
├── fonts/ images/                 # Samsung fonts, WebP images, SVG icons
src/
├── main.tsx                       # Entry point
├── css/                           # SCSS: styles, fonts, reset
└── feature/product-listing/
    ├── ProductListing.tsx         # Root component & state owner
    ├── context/                   # React contexts (products, count, card limit)
    ├── hooks/                     # FilterHook (fetch/sort/filter), SearchInputHook (debounce)
    ├── functions/                 # Pure helpers (filtering, data → card mapping)
    ├── types/ interfaces/         # Data & prop types
    └── components/                # Header, Filter, Counter, Listing/Card, Footer

How It Works

  1. FilterHook fetches products.json whenever the search term or a dropdown option changes.
  2. The pipeline applies: name search → sorting → function/energy/capacity filters.
  3. Results go into context; Listing maps them to card view-models and renders the first N (N = 6, +6 per "show more" click).
  4. Dropdowns close on outside click; the visible-card limit resets on any criteria change.

Notes

  • UI text is in Polish; the dataset uses nullable installments (hidden on cards without offers).
  • Task brief: docs/webDevTestTask.pdf. Samsung fonts/imagery are proprietary, used here for a recruitment exercise only.

About

A Samsung-style washing machine product listing page (Polish UI) built with React 19, TypeScript and Vite. Originally a web-dev test task for Cheil Poland.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages