src/views/assessment/components/buttons/UndoButton.js
import React from 'react';
import {StyleSheet} from 'react-native';
import BaseDrawingButton from './BaseDrawingButton';
import UndoIconSvgr from '../../../../assets/iconsSvgr/UndoIconSvgr';
import {ButtonPosition} from '../../../../utils/DimensionsConstants';
/**
* The button to undo a drawing action.
* @param {Object} props - Properties
* @param {Object} props.componentStyle - The style of the button
* @param {ButtonPosition} props.position - Positioning of the button
* @param {function} props.onPress - Action for the button
* @returns {Object} The button to undo a drawing action
*/
export default function UndoButton(props) {
// Retrieve props
const componentStyle = props.componentStyle;
const position = props.position;
const onPressAction = props.onPress;
return (
<BaseDrawingButton
componentStyle={componentStyle}
position={position}
onPress={onPressAction}>
<UndoIconSvgr style={styles.icon} />
</BaseDrawingButton>
);
}
/**
* Local styles
* @type {Object}
*/
const styles = StyleSheet.create({
icon: {
flex: 1,
width: '100%',
height: '100%',
},
});