Skip to content

Commit

Permalink
Merge pull request #19 from the-collab-lab/mm-jo-rendered-list
Browse files Browse the repository at this point in the history
Add SingleList to Home component and ListItem to List component
  • Loading branch information
marshjaja authored Aug 17, 2024
2 parents 9b57689 + c01b0d9 commit 4d543cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
13 changes: 9 additions & 4 deletions src/views/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SingleList } from '../components';
import './Home.css';

export function Home({ data, setListPath }) {
Expand All @@ -7,10 +8,14 @@ export function Home({ data, setListPath }) {
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) => (
<SingleList
key={index}
name={item.name}
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.
*/}
{data.map((item) => (
<ListItem key={item.id} name={item.name} />
))}
</ul>
</>
);
Expand Down

0 comments on commit 4d543cd

Please sign in to comment.