Skip to content

Commit

Permalink
Merge pull request #25 from the-collab-lab/wc-nk-read-shopping-lists-…
Browse files Browse the repository at this point in the history
…and-items

[ISSUE 2] - read shopping lists and items - WarrenC NikaK
  • Loading branch information
dilekbaykara authored Aug 17, 2024
2 parents aa638df + 2e40643 commit dfdd161
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
16 changes: 12 additions & 4 deletions src/views/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import './Home.css';
import { SingleList } from '../components';

export function Home({ data, setListPath }) {
return (
<div className="Home">
<p>
Hello from the home (<code>/</code>) page!
</p>

<ul>
{/**
* TODO: write some JavaScript that renders the `lists` array
* so we can see which lists the user has access to.
*/}
{data.map((item, index) => {
return (
<SingleList
key={item.name + index}
name="First List"
path={item.path}
setListPath={setListPath}
/>
);
})}
</ul>
</div>
);
Expand Down
8 changes: 3 additions & 5 deletions src/views/List.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ export function List({ data }) {
Hello from the <code>/list</code> page!
</p>
<ul>
{/**
* TODO: write some JavaScript that renders the `data` array
* using the `ListItem` component that's imported at the top
* of this file.
*/}
{Object.values(data).map((item) => (
<ListItem key={item.id} name={item.name} />
))}
</ul>
</>
);
Expand Down

0 comments on commit dfdd161

Please sign in to comment.