Home Reference Source

src/components/buttons/CloseRoundButton.js

import React from 'react';

import BaseRoundButtonShadow from './BaseRoundButtonShadow';
import CloseIconSvgr from '../../assets/iconsSvgr/CloseIconSvgr';

import {RoundButtonSize} from '../../utils/DimensionsConstants';
import {globalStyles} from '../../styles/styles';

/**
 * Close button, round button with shadow
 * @param {Object} props - Properties
 * @param {RoundButtonSize} props.buttonSize - Size of the button
 * @param {Object} props.containerStyle - Styling of the container
 * @param {function} props.onPress - Action to be executed when the button is pressed
 * @returns {Object} Round "close" button
 */
export default function CloseRoundButton(props) {
    // Retrieve props
    const buttonSize = props.buttonSize;
    const componentStyle = props.containerStyle;
    const onPressAction = props.onPress;

    return (
        <BaseRoundButtonShadow
            buttonSize={buttonSize}
            componentStyle={componentStyle}
            onPress={onPressAction}>
            <CloseIconSvgr style={globalStyles.fillWidth} />
        </BaseRoundButtonShadow>
    );
}