diff --git a/src/components/forms/AddItemForm.scss b/src/components/forms/AddItemForm.scss index d7e3378..ee3e1a4 100644 --- a/src/components/forms/AddItemForm.scss +++ b/src/components/forms/AddItemForm.scss @@ -15,6 +15,6 @@ position: relative; top: -40px; left: 10px; - background-color: #f3ecd3; + background-color: rgb(241, 230, 204); width: 80%; } diff --git a/src/views/authenticated/List.scss b/src/views/authenticated/List.scss index f123b89..1365274 100644 --- a/src/views/authenticated/List.scss +++ b/src/views/authenticated/List.scss @@ -9,22 +9,45 @@ max-width: 100%; } -.Header { - text-align: center; -} - .ListPageContainer { width: 100%; + display: flex; + flex-wrap: wrap; + box-sizing: border-box; } .Add-ShareList { - flex-grow: 1; - width: 50%; + flex-basis: 20%; +} + +.Share-ListForm { + flex-basis: 80%; +} + +.Add-ItemForm { + flex-basis: 80%; } .ListItemSection, .Add-ShareList { flex-grow: 1; /* Both sections will take up equal width */ - width: 50%; + flex-shrink: 1; align-items: flex-end; + flex-wrap: column; +} + +@media (max-width: 1000px) { + .ListItemSection, + .Add-ShareList { + flex-basis: 50%; + margin: auto; + align-items: flex-end; + } +} + +@media (max-width: 575px) { + .Add-ShareList { + flex-basis: 100%; /* Full width for both sections */ + flex-wrap: wrap; + } } diff --git a/src/views/authenticated/List.tsx b/src/views/authenticated/List.tsx index 00bbaf3..ad5ede1 100644 --- a/src/views/authenticated/List.tsx +++ b/src/views/authenticated/List.tsx @@ -1,5 +1,6 @@ import "./List.scss"; import { useParams, useNavigate } from "react-router-dom"; +import { useRef } from "react"; import { useState, useMemo } from "react"; import { ListItemCheckBox } from "../../components/ListItem"; import { FilterListInput } from "../../components/FilterListInput"; @@ -67,6 +68,15 @@ export function List({ data: unfilteredListItems, listPath }: Props) { ); } + const addShareListRef = useRef(null); + + // Function to handle scrolling to the Add-ShareList section + const scrollToAddShareItem = () => { + if (addShareListRef.current) { + addShareListRef.current.scrollIntoView({ behavior: "smooth" }); + } + }; + // Main content when list is not empty return ( @@ -74,45 +84,42 @@ export function List({ data: unfilteredListItems, listPath }: Props) {

{listName}

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