From a67f50399bba6a036aa218588edf02f4a7e7edd3 Mon Sep 17 00:00:00 2001 From: Thomas Deverin Date: Thu, 9 Apr 2026 14:13:20 -0400 Subject: [PATCH] Added unplugged books to teacher resources page --- frontend/src/components/ActivityBookList.tsx | 67 ++++++++++++++------ frontend/src/pages/TeacherResources.tsx | 26 +++++--- 2 files changed, 66 insertions(+), 27 deletions(-) diff --git a/frontend/src/components/ActivityBookList.tsx b/frontend/src/components/ActivityBookList.tsx index 4b6dcbad..380abcbb 100644 --- a/frontend/src/components/ActivityBookList.tsx +++ b/frontend/src/components/ActivityBookList.tsx @@ -56,16 +56,18 @@ function BookPreviewList({ linkSuffix, loading, showPublished, + useOwnGrid, }: { pageBookData: Book[]; linkPrefix: string; linkSuffix: string; loading: boolean; showPublished: boolean; + useOwnGrid: boolean; }) { const emptyBookData = Array.from({ length: 6 }, () => ({})); - return ( - + ); + + if (useOwnGrid) { + return ( + + ); + } else { + return content; + } } export default function ActivityBookList({ @@ -98,33 +110,44 @@ export default function ActivityBookList({ linkSuffix, loading, showPublished, - isUnplugged, + useOwnGrid = true, }: { books: Book[]; linkPrefix: string; linkSuffix: string; loading?: boolean; showPublished?: boolean; - isUnplugged?: boolean; + useOwnGrid?: boolean; }) { - return ( + const content = ( <> -
- -
+ ); + + if (useOwnGrid) { + return
{content}
; + } else { + return content; + } } -export function BookPreviewUnplugged({ BookData }: { BookData: Array }) { - return ( -
+export function BookPreviewUnplugged({ + BookData, + useOwnGrid = true, +}: { + BookData: Array; + useOwnGrid?: boolean; +}) { + const content = ( + <> {BookData.map((book, index) => ( ))} -
+ ); + + if (useOwnGrid) { + return
{content}
; + } else { + return content; + } } diff --git a/frontend/src/pages/TeacherResources.tsx b/frontend/src/pages/TeacherResources.tsx index 4f9ebc73..4ba5ddb9 100644 --- a/frontend/src/pages/TeacherResources.tsx +++ b/frontend/src/pages/TeacherResources.tsx @@ -4,7 +4,10 @@ import Background from "../components/Background"; import PostPreview from "../components/PostPreview"; import { useCallback, useEffect, useState } from "react"; import { Book, BooksService } from "../api"; -import ActivityBookList from "../components/ActivityBookList"; +import ActivityBookList, { + BookPreviewUnplugged, +} from "../components/ActivityBookList"; +import { unpluggedBooks } from "../util/UnpluggedBooks"; export default function ActivityPostList() { const [results, setResults] = useState([]); @@ -70,13 +73,20 @@ export default function ActivityPostList() {
-

Books for Teachers

- +

Books for Teachers

+
    + + +