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
39 changes: 0 additions & 39 deletions app/components/BookCard/BookCard.module.css

This file was deleted.

9 changes: 4 additions & 5 deletions app/components/BookCard/BookCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import styles from "./BookCard.module.css";
import { BookCover } from "~/components/BookCover/BookCover";
import { FavoriteButton } from "~/components/FavoriteButton/FavoriteButton";
import type { Book } from "~/api/types";
Expand All @@ -12,22 +11,22 @@ function BookCard({ book }: BookCardProps) {
const [searchParams] = useSearchParams();

return (
<article className={styles.bookCard}>
<article className="relative flex flex-col h-full box-border rounded-base border border-border bg-surface">
<FavoriteButton book={book} />

<Link
to={{
pathname: `/book/${book.id}`,
search: searchParams.toString(),
}}
className={styles.bookCardLink}
className="flex flex-1 flex-col h-full w-full cursor-pointer box-border rounded-base p-6 hover:border hover:border-theme"

aria-label={`View details for ${book.title}`}
>
<BookCover book={book} />

<section className={styles.info}>
<h3 className={styles.title}>{book.title}</h3>
<section className="mt-4 text-[0.9rem]">
<h3 className="mb-2 text-base">{book.title}</h3>
<p>{book.author.join(", ")}</p>
<p>{book.publishedYear ?? "Unknown"}</p>
</section>
Expand Down
18 changes: 0 additions & 18 deletions app/components/BookCover/BookCover.module.css

This file was deleted.

7 changes: 4 additions & 3 deletions app/components/BookCover/BookCover.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import styles from "./BookCover.module.css";
import type { Book } from "~/api/types";

interface BookCoverProps {
Expand All @@ -10,10 +9,12 @@ function BookCover({ book }: BookCoverProps) {
<img
src={book.coverImage}
alt={`Book cover of ${book.title}`}
className={styles.coverImage}
className="w-full object-contain px-6 py-3"
/>
) : (
<p className={styles.coverPlaceholder}>No cover available</p>
<p className="flex items-center justify-center mx-6 my-3 aspect-2/3 rounded-base bg-background text-center text-sm text-theme">
No cover available
</p>
);
}

Expand Down
25 changes: 0 additions & 25 deletions app/components/FavoriteButton/FavoriteButton.module.css

This file was deleted.

3 changes: 1 addition & 2 deletions app/components/FavoriteButton/FavoriteButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useState } from "react";
import styles from "./FavoriteButton.module.css";
import { CheckIcon } from "~/components/icons/CheckIcon";
import type { Book } from "~/api/types";

Expand Down Expand Up @@ -31,7 +30,7 @@ function FavoriteButton({ book }: FavoriteButtonProps) {
return (
<button
type="button"
className={`${styles.favoriteButton} ${favorites.includes(book.id) ? styles.favoriteButtonActive : ""}`}
className={`absolute right-2 top-2 flex items-center justify-center h-8 w-8 cursor-pointer bg-surface text-2xl rounded-base border ${favorites.includes(book.id) ? "border-success text-success" : "border-border text-theme hover:border-theme"}`}
onClick={saveFavorite}
aria-label={
// Toggle the accessibility label based on the current state for screen readers
Expand Down
55 changes: 0 additions & 55 deletions app/components/FilterBooksSection/FilterBooksSection.module.css

This file was deleted.

20 changes: 10 additions & 10 deletions app/components/FilterBooksSection/FilterBooksSection.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import styles from "./FilterBooksSection.module.css";
import type { BookFilters } from "~/api/types";
import { languageCodes } from "~/api/languageCodes";
import { CircleQuestionMark } from "~/components/icons/CircleQuestionMark";
Expand Down Expand Up @@ -71,17 +70,17 @@ function FilterBooksSection() {
}, [debouncedFilters, rawFilters, setSearchParams]);

return (
<section className={styles.filterBooksSection}>
<h2>Filter Books</h2>
<ul className={styles.filterInputsList}>
<section className="flex flex-col items-center mb-8">
<h2 className="my-4">Filter Books</h2>
<ul className="grid grid-cols-2 gap-4 max-[900px]:grid-cols-1">
{FILTER_INPUTS.map((input) => (
<li key={input.name} className={styles.filterInputContainer}>
<label htmlFor={input.name} className={styles.filterLabel}>
<li key={input.name} className="flex flex-col gap-2">
<label htmlFor={input.name} className="flex items-center gap-2">
{input.name.charAt(0).toUpperCase() + input.name.slice(1)}
</label>
<input
type="text"
className={styles.filterInput}
className="rounded-base border border-border bg-surface p-2 text-base hover:border-theme"
name={input.name}
aria-label={input.ariaLabel}
placeholder={input.placeholder}
Expand All @@ -93,18 +92,19 @@ function FilterBooksSection() {
/>
</li>
))}
<li className={styles.filterInputContainer}>
<label htmlFor="language" className={styles.filterLabel}>
<li className="flex flex-col gap-2">
<label htmlFor="language" className="flex items-center gap-2">
Language
<span
className="flex items-center"
title="Only show books that have an edition in the selected language"
role="tooltip"
>
<CircleQuestionMark />
</span>
</label>
<select
className={styles.filterInput}
className="rounded-base border border-border bg-surface p-2 text-base hover:border-theme"
name="language"
aria-label="Search for language"
value={filters.language ?? ""}
Expand Down
16 changes: 0 additions & 16 deletions app/components/Footer/Footer.module.css

This file was deleted.

4 changes: 1 addition & 3 deletions app/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import styles from "./Footer.module.css";

function Footer() {
return (
<footer className={styles.footer}>
<footer className="flex items-center justify-between bg-footer px-10 py-8 text-sm text-surface max-[800px]:flex-col max-[800px]:justify-center max-[800px]:gap-1">
<p>IT2810 Webutvikling - Gruppe 37 - Prosjekt 1</p>
<p>2026</p>
</footer>
Expand Down
13 changes: 0 additions & 13 deletions app/components/Header/Header.module.css

This file was deleted.

6 changes: 2 additions & 4 deletions app/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import styles from "./Header.module.css";

function Header() {
return (
<header className={styles.header}>
<h1 className={styles.title}>Readr</h1>
<header className="flex items-center justify-between border-b-2 border-theme bg-surface px-10 py-3.75">
<h1 className="m-0 text-2xl">Readr</h1>
</header>
);
}
Expand Down
7 changes: 0 additions & 7 deletions app/components/MainLoading/MainLoading.module.css

This file was deleted.

4 changes: 1 addition & 3 deletions app/components/MainLoading/MainLoading.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import styles from "./MainLoading.module.css";

function MainLoading() {
return (
<main className={styles.mainLoading}>
<main className="flex flex-col items-center justify-center gap-4">
<p>Welcome to Readr!</p>
<p>Loading...</p>
</main>
Expand Down
40 changes: 0 additions & 40 deletions app/components/Pagination/Pagination.module.css

This file was deleted.

Loading