diff --git a/src/App.jsx b/src/App.jsx index 38f7126..7e9ac82 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -59,7 +59,7 @@ export function App() { /> } + element={} /> ( * 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 a7d544f..1131911 100644 --- a/src/views/List.jsx +++ b/src/views/List.jsx @@ -1,13 +1,16 @@ 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 { updateItem } from '../api/firebase'; import { isMoreThanADayAgo } from '../utils'; +import './List.css'; +import addFirstItem from '../pictures/addFirstItem.png'; -export function List({ data, listPath }) { +export function List({ data, lists, listPath }) { const [newList, setNewList] = useState([]); const { path } = useParams(); + const navigate = useNavigate(); useEffect(() => { setNewList(data); @@ -29,21 +32,57 @@ export function List({ data, listPath }) {

You are on the {path} list!

- -
    - {newList.map((item) => ( - +

    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 }) { -
+