Skip to content

Commit

Permalink
Merge pull request #16 from bookracy/fix/mobile-styling-issues
Browse files Browse the repository at this point in the history
mobile styling fixes
  • Loading branch information
JorrinKievit authored Aug 26, 2024
2 parents b2b957a + 9468901 commit 33217b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/components/books/book-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function BookItem(props: BookItemProps) {
<BookmarkButton book={props} />
</div>

<div className="flex flex-col gap-4 md:flex-row md:gap-6">
<div className="flex flex-col gap-4 pt-12 sm:pt-0 md:flex-row md:gap-6">
<div className="mx-2 w-full max-w-[200px] md:w-1/4">
<AspectRatio ratio={5 / 8} className="flex items-center">
<img
Expand All @@ -34,7 +34,7 @@ export function BookItem(props: BookItemProps) {
onError={(e) => {
e.currentTarget.src = PlaceholderImage;
}}
onClick={() => open(props.book_image, "_blank")}
onClick={() => setIsReaderOpen(true)}
/>
</AspectRatio>
</div>
Expand Down
6 changes: 1 addition & 5 deletions src/components/layout/sheet-menu.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import { MenuIcon } from "lucide-react";
import React from "react";
import { Button } from "@/components/ui/button";
import { Sheet, SheetHeader, SheetContent, SheetTrigger } from "@/components/ui/sheet";
import { Link } from "@tanstack/react-router";
import { Menu } from "./menu";
import { useLayoutStore } from "@/stores/layout";

import LogoHeader from "@/assets/logo_header.svg";
import LogoHeaderDark from "@/assets/logo_header_dark.svg";
import Logo from "@/assets/logo.svg";
import { useSettingsStore } from "@/stores/settings";

export function SheetMenu() {
const sidebar = useLayoutStore((state) => state.sidebar);
const theme = useSettingsStore((state) => state.theme);

return (
Expand All @@ -26,7 +22,7 @@ export function SheetMenu() {
<SheetHeader>
<Button className="flex items-center justify-center pb-2 pt-1" variant="link" asChild>
<Link to="/" className="flex items-center gap-2" search={{ q: "" }}>
{theme === "dark" ? <img src={sidebar.isOpen ? LogoHeader : Logo} className="h-13" /> : <img src={sidebar.isOpen ? LogoHeaderDark : Logo} className="h-13" />}
{theme === "dark" ? <img src={LogoHeader} className="h-12" /> : <img src={LogoHeaderDark} className="h-12" />}
</Link>
</Button>
</SheetHeader>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/featured.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function Feature() {
.map((word: string) => word.charAt(0).toUpperCase() + word.slice(1))
.join(" ")}
</h1>
<div className="grid grid-cols-2 gap-4">{data[category].length > 0 ? data[category].map((book) => <BookItem key={book.md5} {...book} />) : null}</div>
<div className="flex flex-col gap-4 md:grid md:grid-cols-2">{data[category].length > 0 ? data[category].map((book) => <BookItem key={book.md5} {...book} />) : null}</div>
</div>
))}
</div>
Expand Down

0 comments on commit 33217b0

Please sign in to comment.