-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
Copy pathcreate-task-page.tsx
46 lines (38 loc) · 1.19 KB
/
create-task-page.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (C) 2020 Intel Corporation
//
// SPDX-License-Identifier: MIT
import React from 'react';
import { connect } from 'react-redux';
import { CombinedState } from 'reducers/interfaces';
import CreateTaskComponent from 'components/create-task-page/create-task-page';
import { CreateTaskData } from 'components/create-task-page/create-task-content';
import { createTaskAsync } from 'actions/tasks-actions';
interface StateToProps {
status: string;
error: string;
installedGit: boolean;
}
interface DispatchToProps {
onCreate: (data: CreateTaskData) => void;
}
function mapDispatchToProps(dispatch: any): DispatchToProps {
return {
onCreate: (data: CreateTaskData): void => dispatch(createTaskAsync(data)),
};
}
function mapStateToProps(state: CombinedState): StateToProps {
const { creates } = state.tasks.activities;
return {
...creates,
installedGit: state.plugins.list.GIT_INTEGRATION,
};
}
function CreateTaskPageContainer(props: StateToProps & DispatchToProps): JSX.Element {
return (
<CreateTaskComponent {...props} />
);
}
export default connect(
mapStateToProps,
mapDispatchToProps,
)(CreateTaskPageContainer);