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