Skip to content

Commit

Permalink
Stashed Commit
Browse files Browse the repository at this point in the history
small changes, to organise the code.

Removed unused files

Added routers and fixed warning messages

Fixes #34 and #48 , and partially #39

upd

upd

upd

Fixed minor bugs
  • Loading branch information
sanchit94 committed Jun 30, 2018
1 parent e88b90a commit 2c1a2c9
Show file tree
Hide file tree
Showing 6 changed files with 7,317 additions and 58 deletions.
17 changes: 9 additions & 8 deletions src/component/Calendar/Calendar.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import React, { Component } from 'react';
import { CalendarHeader } from './CalendarHeader'
import { CalendarBody, daysCounterReset } from './CalendarBody';


import {
CalendarBody,
daysCounterReset
} from './CalendarBody';

import {
displayDate,
today
} from '../../data/DateVars';

import months from '../../data/months';
import months from '../../data/months';


class Calendar extends Component {
constructor(props) {
super(props);
this.state = {
month: today.getMonth(),
month: today.getMonth(),
firstDay: today.getDay()
}
this.changeMonth = this.changeMonth.bind(this);
Expand All @@ -39,22 +40,22 @@ class Calendar extends Component {
});
}
}

if(event.target.innerText === 'Previous Month') {
if(this.state.month === 0) {
today.setMonth(11);
this.setState({
month: 11
});
}
}
else {
today.setMonth(this.state.month - 1);
this.setState({
month: this.state.month - 1
});
}
}

this.setState({
firstDay: today.getDay()
});
Expand Down
19 changes: 9 additions & 10 deletions src/component/DayChecker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class DayChecker extends Component {
super(props);
this.weekCheck = this.weekCheck.bind(this);
}

getDayName(number) {
return days[number];
}
return days[number];
}

weekCheck(dayNum, callback, otherCallback) {
if (dayNum === 6 || dayNum === 0) {
if(typeof callback === "function")
Expand All @@ -27,9 +27,11 @@ class DayChecker extends Component {
}

weekend = () => {return (
<div style={{...styleVars.header, ...styleVars.defaultTextColor, height: '200px'}}>
<div style={{ ...styleVars.header, ...styleVars.defaultTextColor, height: '200px' }}>
<Header />
<h3>Today is {this.getDayName(today)} - You can watch TV all day today!</h3>
<h3>
Today is {this.getDayName(today)} - You can watch TV all day today!
</h3>
</div>
);
}
Expand All @@ -48,12 +50,9 @@ class DayChecker extends Component {
{this.weekCheck(today, this.weekend, this.weekday)}
</div>
);
}
}

}


export { DayChecker }



71 changes: 40 additions & 31 deletions src/component/Modals/AddMealModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, {
Component
} from 'react';
import {
Button,
Button,
Modal,
ModalHeader,
ModalBody,
Expand Down Expand Up @@ -36,36 +36,45 @@ class AddMeal extends Component {


render() {
return(<div>
<Button onClick={this.toggle}>Add Meal</Button>
<Modal isOpen={this.state.modal} toggle={this.toggle} className={this.props.className}>
<ModalHeader toggle={this.toggle}>Add a meal</ModalHeader>
<ModalBody>
<Form>
<FormGroup>
<Label>Meal Name</Label>
<Input type="text" onBlur={this.props.changeHandle} id="mealName" placeholder="Meal name here" />
</FormGroup>
<FormGroup>
<Label>You can also attach an image to your meal</Label>
<Input type="text" onBlur={this.props.handleImage} id="mealImage" placeholder="Image URL here" />
</FormGroup>
<FormGroup>
<Label for="exampleText">Description</Label>
<Input type="textarea" onBlur={this.props.handleDescription} name="text" id="descMeal" />
</FormGroup>
<FormGroup>
<Label for="exampleText">Steps</Label>
<Input type="textarea" onBlur={this.props.handleSteps}name="text" id="stepMeal" />
</FormGroup>
</Form>
</ModalBody>
<ModalFooter>
<Button color="primary" onClick={this.clickHandle}>Add</Button>
<Button color="secondary" onClick={this.toggle}>Cancel</Button>
</ModalFooter>
</Modal>
</div>
return(
<div>
<Button onClick={this.toggle}>
Add Meal
</Button>
<Modal isOpen={this.state.modal} toggle={this.toggle} className={this.props.className}>
<ModalHeader toggle={this.toggle}>
Add a meal
</ModalHeader>
<ModalBody>
<Form>
<FormGroup>
<Label>Meal Name</Label>
<Input type="text" onBlur={this.props.changeHandle} id="mealName" placeholder="Meal name here" />
</FormGroup>
<FormGroup>
<Label>You can also attach an image to your meal</Label>
<Input type="text" onBlur={this.props.handleImage} id="mealImage" placeholder="Image URL here" />
</FormGroup>
<FormGroup>
<Label for="exampleText">Description</Label>
<Input type="textarea" onBlur={this.props.handleDescription} name="text" id="descMeal" />
</FormGroup>
<FormGroup>
<Label for="exampleText">Steps</Label>
<Input type="textarea" onBlur={this.props.handleSteps}name="text" id="stepMeal" />

This comment has been minimized.

Copy link
@atherdon

atherdon Jul 1, 2018

Member

add space between onBlur and name arrtibutes

This comment has been minimized.

Copy link
@sanchit94

sanchit94 Jul 1, 2018

Author Collaborator

Done!

</FormGroup>
</Form>
</ModalBody>
<ModalFooter>
<Button color="primary" onClick={this.clickHandle}>
Add
</Button>
<Button color="secondary" onClick={this.toggle}>
Cancel
</Button>
</ModalFooter>
</Modal>
</div>
);
}
}
Expand Down
14 changes: 10 additions & 4 deletions src/component/Modals/ModalWork.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { Component } from 'react';
import { ListGroupItem, Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
import {
ListGroupItem, Button, Modal, ModalHeader, ModalBody, ModalFooter
} from 'reactstrap';


let dummyText = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
Expand All @@ -24,7 +26,9 @@ class Modals extends Component {
render() {
return(
<div>
<ListGroupItem style={{height : this.props.data.height}} className={this.props.data.tag} onClick={this.toggle}>
<ListGroupItem style={{height : this.props.data.height}}
className={this.props.data.tag}
onClick={this.toggle}>
<div>
{this.props.data.time}
</div>{this.props.data.text}
Expand All @@ -35,7 +39,9 @@ class Modals extends Component {
{dummyText}
</ModalBody>
<ModalFooter>
<Button color="primary" onClick={this.toggle}>Do Something</Button>{' '}
<Button color="primary" onClick={this.toggle}>
Do Something
</Button>{' '}
<Button color="secondary" onClick={this.toggle}>Cancel</Button>
</ModalFooter>
</Modal>
Expand All @@ -45,4 +51,4 @@ class Modals extends Component {
}
}

export { Modals }
export { Modals }
16 changes: 11 additions & 5 deletions src/component/WorkSchedule/WorkSched.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React, { Component } from 'react';
import React, {
Component
} from 'react';
import { Container, Row } from 'reactstrap';
import './WorkSched.css';
import { ScheduleRender, TimeLine } from './Schedule'
Expand All @@ -8,17 +10,21 @@ class WorkSched extends Component {
return(
<div>
<div className='header'>
<h1>Schedule</h1>
<h1>
Schedule
</h1>
</div>
<Container>
<Row>
<div className='timeline'><TimeLine /></div>
<div className='timeline'>
<TimeLine />
</div>
<ScheduleRender />
</Row>
</Container>
</div>
);
}
}
export { WorkSched }

export { WorkSched }
Loading

0 comments on commit 2c1a2c9

Please sign in to comment.