From f76004b6baf045478093ffdbccf2d84fcab0303a Mon Sep 17 00:00:00 2001 From: Maha Date: Wed, 16 Oct 2024 23:21:25 -0400 Subject: [PATCH] adding additem, sharelist into list page view --- src/views/Layout.scss | 3 +- src/views/authenticated/List.scss | 5 +-- src/views/authenticated/List.tsx | 65 ++++++++++++++++++++----------- 3 files changed, 46 insertions(+), 27 deletions(-) diff --git a/src/views/Layout.scss b/src/views/Layout.scss index de8cbbd..693fd80 100644 --- a/src/views/Layout.scss +++ b/src/views/Layout.scss @@ -32,5 +32,6 @@ margin: 0 auto; padding-block: 0; padding-block-end: 6.26rem; - width: min(72ch, 100%); + //width: min(72ch, 100%); + width: 100%; } diff --git a/src/views/authenticated/List.scss b/src/views/authenticated/List.scss index 0df04f1..f186889 100644 --- a/src/views/authenticated/List.scss +++ b/src/views/authenticated/List.scss @@ -13,7 +13,6 @@ text-align: center; } -.ListContainer { - max-width: 100%; - width: fit-content; +.ListPageContainer { + width: 100%; } diff --git a/src/views/authenticated/List.tsx b/src/views/authenticated/List.tsx index eb1767f..18c2e5a 100644 --- a/src/views/authenticated/List.tsx +++ b/src/views/authenticated/List.tsx @@ -5,7 +5,9 @@ import { ListItemCheckBox } from "../../components/ListItem"; import { FilterListInput } from "../../components/FilterListInput"; import { ListItem, comparePurchaseUrgency } from "../../api"; import { Container } from "react-bootstrap"; +import { AddItemForm } from "../../components/forms/AddItemForm"; import Button from "react-bootstrap/Button"; +import ShareListForm from "../../components/forms/ShareListForm"; interface Props { data: ListItem[]; @@ -63,34 +65,51 @@ export function List({ data: unfilteredListItems, listPath }: Props) { // Main content when list is not empty return ( - <> +

{listName}

-
+
+ {/* This is the div for the filter and adding items. */} + {/* Width should be 100% */} +
+
+ {unfilteredListItems.length > 0 && ( + + )} -
- {unfilteredListItems.length > 0 && ( - - )} + +
- -
+
+ {filteredListItems.map((item) => ( + + ))} +
+
-
- {filteredListItems.map((item) => ( - - ))} -
- + {/* Width of this section should be 50%. */} +
+
+
+
+
+ +
+
+ +
+
+
+ ); }