diff --git a/src/App.jsx b/src/App.jsx index c55076b..aef8fb1 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -57,7 +57,10 @@ export function App() { /> } /> - } /> + } + /> ( * A button that signs the user out of the app using Firebase Auth. */ export const SignOutButton = () => ( - ); diff --git a/src/pictures/addFirstItem.png b/src/pictures/addFirstItem.png new file mode 100644 index 0000000..65fb455 Binary files /dev/null and b/src/pictures/addFirstItem.png differ diff --git a/src/views/List.css b/src/views/List.css new file mode 100644 index 0000000..84621a0 --- /dev/null +++ b/src/views/List.css @@ -0,0 +1,17 @@ +.containerAddItem { + display: flex; + flex-direction: column; +} + +.addItemGif { + border: 1px solid #ddd; + border-radius: 4px; + padding: 5px; + box-shadow: 0 0 2px 1px rgba(66, 69, 70, 0.5); + width: 500px; +} + +#addFirstItem { + margin-top: 10px; + width: fit-content; +} diff --git a/src/views/List.jsx b/src/views/List.jsx index a354420..f72b393 100644 --- a/src/views/List.jsx +++ b/src/views/List.jsx @@ -1,11 +1,14 @@ import { useState, useEffect } from 'react'; import { ListItem } from '../components'; import SearchList from '../components/SearchList'; -import { useParams } from 'react-router-dom'; +import { useParams, useNavigate } from 'react-router-dom'; +import './List.css'; +import addFirstItem from '../pictures/addFirstItem.png'; -export function List({ data }) { +export function List({ data, lists }) { const [newList, setNewList] = useState([]); const { path } = useParams(); + const navigate = useNavigate(); useEffect(() => { setNewList(data); @@ -16,12 +19,48 @@ export function List({ data }) {

You are on the {path} list!

- -
    - {newList.map((item) => ( - - ))} -
+ {data.length === 0 && lists.length === 1 && ( +
+

Well done! You have created your very first list!

+

+ You can now add some items and specify when you need to purchase + them. In the box for "Add item" you put the item you need to + purchase and then select how soon you need it on "When do I need it" +

+ add item example + + +
+ )} + {data.length === 0 && lists.length > 1 && ( +
+

Well done! You have created a new list!

+

+ You can now add some items and specify when you need to purchase + them. +

+ + +
+ )} + {data.length > 0 && ( +
+ +
    + {newList.map((item) => ( + + ))} +
+
+ )} ); } diff --git a/src/views/ManageList.jsx b/src/views/ManageList.jsx index a0cdc87..bf45752 100644 --- a/src/views/ManageList.jsx +++ b/src/views/ManageList.jsx @@ -83,13 +83,13 @@ export function ManageList({ listPath, userId, userEmail }) { -
+