Skip to content
This repository was archived by the owner on Mar 23, 2019. It is now read-only.

Commit 9221013

Browse files
sammysamx20helfi92
authored andcommitted
#201 Added "Add task" button (#231)
1 parent c8f9e33 commit 9221013

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/views/Tasks/CreateTask/index.jsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import FormControlLabel from '@material-ui/core/FormControlLabel';
1919
import PlusIcon from 'mdi-react/PlusIcon';
2020
import RotateLeftIcon from 'mdi-react/RotateLeftIcon';
2121
import ClockOutlineIcon from 'mdi-react/ClockOutlineIcon';
22+
import Tooltip from '@material-ui/core/Tooltip';
2223
import SpeedDial from '../../../components/SpeedDial';
2324
import SpeedDialAction from '../../../components/SpeedDialAction';
2425
import HelpView from '../../../components/HelpView';
@@ -31,6 +32,7 @@ import {
3132
} from '../../../utils/constants';
3233
import urls from '../../../utils/urls';
3334
import createTaskQuery from '../createTask.graphql';
35+
import Button from '../../../components/Button';
3436

3537
const defaultTask = {
3638
provisionerId: 'aws-provisioner-v1',
@@ -60,6 +62,10 @@ const defaultTask = {
6062
@withStyles(theme => ({
6163
createIcon: {
6264
...theme.mixins.successIcon,
65+
...theme.mixins.fab,
66+
position: 'fixed',
67+
bottom: theme.spacing.double,
68+
right: theme.spacing.unit * 11,
6369
},
6470
}))
6571
export default class CreateTask extends Component {
@@ -277,18 +283,20 @@ export default class CreateTask extends Component {
277283
value={task || ''}
278284
onChange={this.handleTaskChange}
279285
/>
280-
<SpeedDial>
281-
<SpeedDialAction
286+
<Tooltip title="Create Task">
287+
<Button
282288
requiresAuth
283-
tooltipOpen
284-
icon={<PlusIcon />}
289+
variant="fab"
290+
className={classes.createIcon}
285291
onClick={this.handleCreateTask}
286-
tooltipTitle="Create Task"
287-
classes={{ button: classes.createIcon }}
288292
ButtonProps={{
289293
disabled: !task || invalid || loading,
290294
}}
291-
/>
295+
>
296+
<PlusIcon />
297+
</Button>
298+
</Tooltip>
299+
<SpeedDial>
292300
<SpeedDialAction
293301
tooltipOpen
294302
icon={<RotateLeftIcon />}

0 commit comments

Comments
 (0)