-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c65806
commit 13eeeee
Showing
5 changed files
with
67 additions
and
30 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import * as React from 'react'; | ||
import { connect } from 'react-redux'; | ||
|
||
import { AppState, tasks } from '../modules'; | ||
import taskData from './tasks'; | ||
|
||
interface ActionProps { | ||
setTasks(tasks: tasks.Task[]): void; | ||
} | ||
|
||
interface Props { | ||
history: any; | ||
routes: any; | ||
} | ||
|
||
export const loadDummyData = (WrappedComponent: React.ComponentClass<{}>) => { | ||
class LoadData extends React.Component<Props & ActionProps, {}> { | ||
public componentDidMount() { | ||
this.props.setTasks(taskData); | ||
} | ||
|
||
public render() { | ||
return (<WrappedComponent {...this.props} />); | ||
} | ||
} | ||
|
||
const mapActionsToProps = { | ||
setTasks: tasks.actionCreators.setList, | ||
}; | ||
|
||
return connect<{}, ActionProps, Props>(undefined, mapActionsToProps)(LoadData); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { tasks } from '../modules'; | ||
|
||
const data: tasks.Task[] = [{ | ||
id: 1, | ||
name: 'Test Task One', | ||
type: [ | ||
'dummy data', | ||
], | ||
tags: [ | ||
'example', | ||
'test', | ||
], | ||
duration: 60, | ||
startDate: 1480394079073, | ||
endDate: 1480394079073, | ||
location: { | ||
latitude: 1111, | ||
longitude: 1111, | ||
}, | ||
notes: 'This is a note on how to complete this task', | ||
steps: [{ | ||
name: 'Do this first', | ||
template: 'template string', | ||
data: {}, | ||
}], | ||
}]; | ||
|
||
export default data; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters