change home page

This commit is contained in:
Bilal Catic
2019-08-28 13:55:49 +02:00
parent 485c95a929
commit 6f1645a479
3 changed files with 31 additions and 20 deletions

View File

@@ -5,7 +5,7 @@ import { Menu } from 'semantic-ui-react';
import { mainMenuItems } from '../../constants/menuItems';
const MainMenu = () =>
(<Menu>
(<Menu size={'huge'}>
{
mainMenuItems.map(mainMenuItem => {
if (!mainMenuItem.showInMenu){

View File

@@ -9,6 +9,7 @@ export const mainMenuItems = [
{
id: 'home',
showInMenu: true,
showOnHomePage: false,
title: 'Home',
url: '/',
component: Home,
@@ -16,42 +17,53 @@ export const mainMenuItems = [
{
id: 'memberPracticeSummaryReport',
showInMenu: true,
showOnHomePage: true,
title: 'Member Practice Summary Report',
url: '/member-practice-summary-report',
component: MemberPracticeSummaryReport,
description: 'Generate a report for a year, for all members',
},
{
id: 'specificMemberIncidentsReport',
showInMenu: true,
showOnHomePage: true,
title: 'Member Incidents Report',
url: '/specific-member-incidents-report',
component: SpecificMemberIncidentsReport,
description: 'Displays all incidents with a total charge amount in a selected month for a selected member. It is also possible to send displayed fees to the ORD',
},
{
id: 'specificMemberIncidentsReportWithMemberId',
showInMenu: false,
showOnHomePage: false,
url: '/specific-member-incidents-report/:memberId',
component: SpecificMemberIncidentsReport,
},
{
id: 'report',
showInMenu: true,
showOnHomePage: true,
title: 'Incidents Report',
url: '/incidents-report',
component: IncidentsReport,
description: 'Display all incidents in a selected month for all members. It is also possible to send displayed fees to the ORD',
},
{
id: 'uploadDLockData',
showInMenu: true,
showOnHomePage: true,
title: 'DLock',
url: '/dlock',
component: UploadDLockData,
description: 'Upload DLock files to the system',
},
{
id: 'roomOfficeNameMapping',
showInMenu: true,
showOnHomePage: true,
title: 'Room Office Mapping',
url: '/room-office-name-mapping',
component: RoomOfficeNameMapping,
description: 'Edit / delete existing office-room mappings',
}
];

View File

@@ -1,8 +1,9 @@
import React, { Component } from 'react';
import { Container, Form } from 'semantic-ui-react';
import { Container, Message } from 'semantic-ui-react';
import MainMenu from '../../components/MainMenu';
import { mainMenuItems } from '../../constants/menuItems';
class Home extends Component {
@@ -10,25 +11,23 @@ class Home extends Component {
return (
<Container>
<MainMenu/>
<h3>Report</h3>
<h3>SIMA SPACE </h3>
<hr/>
<Form>
<Form.Group widths="equal">
<Form.Input
fluid
required
label="Start date"
type="date"
/>
<Form.Input
fluid
required
label="End date"
type="date"
/>
</Form.Group>
<Form.Button>Show report</Form.Button>
</Form>
{
mainMenuItems.map((menuItem) => {
const { showOnHomePage, title, description, url} = menuItem;
if (showOnHomePage){
return (
<Message size={'large'}>
<a href={url}><Message.Header>{title}</Message.Header></a>
<br/>
{description}
</Message>
);
}
})
}
</Container>
);
}