Home Reference Source

src/components/buttons/SaveSquareButton.js

import React from 'react';
import {StyleSheet} from 'react-native';

import BaseSquareButtonLeftIcon from './BaseSquareButtonLeftIcon';
import OkIconSvgr from '../../assets/iconsSvgr/OkIconSvgr';

import {UIColors} from '../../utils/ColorConstants';

/**
 * Component displaying a Square save button.
 * @param {Object} props - Properties
 * @param {function} props.onPress - Action to be executed when the button is pressed
 * @returns {Object} Square "save" button
 */
export default function SaveSquareButton(props) {
    // Retrieve prop
    const onPressAction = props.onPress;

    icon = <OkIconSvgr />;
    const label = ['LAGRE'];

    return (
        <BaseSquareButtonLeftIcon
            onPress={onPressAction}
            componentStyle={styles.container}
            icon={icon}
            label={label}
            labelStyle={styles.label}
        />
    );
}

/**
 * Local styles
 */
const styles = StyleSheet.create({
    container: {
        backgroundColor: UIColors.CONFIRMATION,
    },
    label: {
        color: UIColors.LIGHT,
    },
});