generated from UniversityOfHelsinkiCS/toskaboiler
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow question order change without edit mode
- Loading branch information
Showing
3 changed files
with
89 additions
and
51 deletions.
There are no files selected for viewing
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,37 @@ | ||
import React from 'react' | ||
|
||
import { IconButton, Tooltip, Box } from '@material-ui/core' | ||
import UpIcon from '@material-ui/icons/KeyboardArrowUp' | ||
import DownIcon from '@material-ui/icons/KeyboardArrowDown' | ||
import { useTranslation } from 'react-i18next' | ||
|
||
const OrderButtons = ({ | ||
onMoveUp, | ||
onMoveDown, | ||
moveUpDisabled, | ||
moveDownDisabled, | ||
}) => { | ||
const { t } = useTranslation() | ||
|
||
return ( | ||
<Box display="inline-flex"> | ||
<Tooltip title={t('questionEditor:moveUp')}> | ||
<div> | ||
<IconButton disabled={moveUpDisabled} onClick={onMoveUp}> | ||
<UpIcon /> | ||
</IconButton> | ||
</div> | ||
</Tooltip> | ||
|
||
<Tooltip title={t('questionEditor:moveDown')}> | ||
<div> | ||
<IconButton disabled={moveDownDisabled} onClick={onMoveDown}> | ||
<DownIcon /> | ||
</IconButton> | ||
</div> | ||
</Tooltip> | ||
</Box> | ||
) | ||
} | ||
|
||
export default OrderButtons |
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