From 76340b348bb4a1c4087988de88bbe9d7b8deca76 Mon Sep 17 00:00:00 2001 From: Jorrin Date: Tue, 27 Aug 2024 16:36:24 +0200 Subject: [PATCH 1/3] styling fixes for mobile --- index.html | 13 ++++++++----- src/components/books/book-item.tsx | 6 ++++-- src/components/books/book-list.tsx | 17 +++++++++++++++++ src/components/layout/sheet-menu.tsx | 2 +- src/main.tsx | 6 +++++- src/routes/featured.tsx | 4 ++-- src/routes/index.tsx | 12 +++++------- src/routes/lists.tsx | 8 ++------ 8 files changed, 44 insertions(+), 24 deletions(-) create mode 100644 src/components/books/book-list.tsx diff --git a/index.html b/index.html index 3625299..22e65ed 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,7 @@ "@type": "WebSite", "url": "https://bookracy.org/", "name": "Bookracy", - "description": "Why Pay for Knowledge? Why Pay for Books? Why Pay for Education? Welcome to Bookracy, where our motto is that knowledge and education should be free! We have the largest database of over 2,000 books, articles, publications, and more from many sources, all compiled into one place. Go ahead and search for novels, books, magazines, and even news publications—we've got it all! Because education should be a right, not something to exploit. Furthermore, we are a public library and archive similar to archive.org. You can download books and read them or use our onsite reader without paying or 'borrowing' the item. We hold no license or distribution rights, and all publications are from their original owners under the Creative Commons License. However, by using our site, you grant us permission to use your content without the need for a license and without consent. We are not affiliated with any of the publishers, nor do we support piracy or the usage of pirated materials. We ask that you upload your content to us in good faith and only if you are able to do so. Our content will not be removed and will remain in our database indefinitely. Please upload and share your content as we hope to spread the knowledge of education to the masses without having to search and use multiple untrustworthy sites.", + "description": "Why Pay for Knowledge? Why Pay for Books? Why Pay for Education? Welcome to Bookracy, where our motto is that knowledge and education should be free! We have the largest database of over 2,000,000 books, articles, publications, and more from many sources, all compiled into one place. Go ahead and search for novels, books, magazines, and even news publications—we've got it all! Because education should be a right, not something to exploit. Furthermore, we are a public library and archive similar to archive.org. You can download books and read them or use our onsite reader without paying or 'borrowing' the item. We hold no license or distribution rights, and all publications are from their original owners under the Creative Commons License. However, by using our site, you grant us permission to use your content without the need for a license and without consent. We are not affiliated with any of the publishers, nor do we support piracy or the usage of pirated materials. We ask that you upload your content to us in good faith and only if you are able to do so. Our content will not be removed and will remain in our database indefinitely. Please upload and share your content as we hope to spread the knowledge of education to the masses without having to search and use multiple untrustworthy sites.", "publisher": { "@type": "Organization", "name": "Bookracy", @@ -84,7 +84,7 @@ - + - + - + @@ -126,7 +129,7 @@ diff --git a/src/components/books/book-item.tsx b/src/components/books/book-item.tsx index f2e298a..f40db23 100644 --- a/src/components/books/book-item.tsx +++ b/src/components/books/book-item.tsx @@ -9,10 +9,12 @@ import { Skeleton } from "../ui/skeleton"; import { BookOpen, DownloadIcon } from "lucide-react"; import { EpubReader } from "./epub-reader"; import { BookmarkButton } from "./bookmark"; +import { useIsMobile } from "@/hooks/use-ismobile"; type BookItemProps = BookItemResponse; export function BookItem(props: BookItemProps) { + const { isMobile } = useIsMobile(); const [isReaderOpen, setIsReaderOpen] = useState(false); const isEpub = Boolean(props.link?.toLowerCase().endsWith(".epub")); @@ -48,12 +50,12 @@ export function BookItem(props: BookItemProps) {
{isEpub && ( )}
diff --git a/src/components/books/book-list.tsx b/src/components/books/book-list.tsx new file mode 100644 index 0000000..65a5583 --- /dev/null +++ b/src/components/books/book-list.tsx @@ -0,0 +1,17 @@ +import { BookItemResponse } from "@/api/backend/types"; +import { BookItem } from "./book-item"; + +interface BookListProps { + books: BookItemResponse[]; + className?: string; +} + +export function BookList({ books, className = "flex flex-col gap-4 md:grid md:grid-cols-2" }: BookListProps) { + return ( +
+ {books.map((book) => ( + + ))} +
+ ); +} diff --git a/src/components/layout/sheet-menu.tsx b/src/components/layout/sheet-menu.tsx index eb88a12..4c38fe7 100644 --- a/src/components/layout/sheet-menu.tsx +++ b/src/components/layout/sheet-menu.tsx @@ -20,7 +20,7 @@ export function SheetMenu() { - - + setIsOpen(false)} /> ); diff --git a/src/routes/featured.tsx b/src/routes/featured.tsx index a865383..ef95031 100644 --- a/src/routes/featured.tsx +++ b/src/routes/featured.tsx @@ -28,7 +28,7 @@ function Feature() { .map((word: string) => word.charAt(0).toUpperCase() + word.slice(1)) .join(" ")} -
{data[category].length > 0 ? : null}
+
{data[category].length > 0 ? : null}
))} From 655f107b3a559dbdf505a5dc41bf3f1cae23d919 Mon Sep 17 00:00:00 2001 From: Jorrin Date: Tue, 27 Aug 2024 16:44:16 +0200 Subject: [PATCH 3/3] settings mobile fix --- src/routes/settings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/settings.tsx b/src/routes/settings.tsx index 0fa7ee4..a5247e0 100644 --- a/src/routes/settings.tsx +++ b/src/routes/settings.tsx @@ -17,7 +17,7 @@ function Settings() { const { language, setLanguage, backendURL, setBackendURL } = useSettingsStore(); return (
-
+
Application Language