Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# DHIS2 Web App Development Academy
# DHIS2 Web App Development Academy - MEDULETU KAMATI Nam

This is the repo that you will use during the Web Academy exercises. Please fork it, clone it and run it following the instructions on the workshop site: https://dhis2.github.io/academy-web-app-dev/docs/resources/set_up_fork.

Before participating, make sure you have gone through [the pre-requisites](https://dhis2.github.io/academy-web-app-dev/docs/before-academy/) for the academy.

For more information about the academy and the topics taught, check the website: https://dhis2.github.io/academy-web-app-dev/
For more information about the academy and the topics taught, check the website: https://dhis2.github.io/academy-web-app-dev/
9 changes: 5 additions & 4 deletions src/navigation/Navigation.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Menu, MenuItem } from '@dhis2/ui'
import PropTypes from 'prop-types'
import React from 'react'
// @TODO: Import the `Menu` and `MenuItem` components
Expand All @@ -10,14 +11,14 @@ const NavigationItem = ({ path, label }) => {
// "null" when not active, "object" when active
const routeMatch = useMatch(path)
// path is matched if routeMatch is not null
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-unuseds-vars
const isActive = Boolean(routeMatch)

// eslint-disable-next-line no-unused-vars
const onClick = () => navigate(path)

// @TODO: Use the `MenuItem` component instead of the `div`
return <div>{label}</div>
return <MenuItem label={label} active={isActive} onClick={onClick}/>
}

NavigationItem.propTypes = {
Expand All @@ -27,7 +28,7 @@ NavigationItem.propTypes = {

export const Navigation = () => (
// @TODO: Use the `Menu` components instead of the `div`
<div>
<Menu>
<NavigationItem
// Menu item for the home page
label="Home"
Expand All @@ -45,5 +46,5 @@ export const Navigation = () => (
label="Form"
path="/form"
/>
</div>
</Menu>
)
2 changes: 1 addition & 1 deletion src/navigation/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './Navigation.js'
export {Navigation} from './Navigation.js'