import React from 'react';
import { FloatingButton as FloatingButtonController } from 'ordering-components/native';
import { FloatingButtonParams } from '../../types';
import { Container, Button } from './styles';
import { OText } from '../shared';
import { StyleSheet, Platform, View } from 'react-native';
import { useTheme } from 'styled-components/native';
const FloatingButtonUI = (props: FloatingButtonParams) => {
const {
btnLeftValue,
btnRightValue,
btnLeftValueShow,
btnRightValueShow,
btnText,
colorTxt1,
secondBtnText,
firstColorCustom,
secondColorCustom,
secondButtonClick,
firstButtonClick,
disabled,
color,
isSecondaryBtn,
secondButton,
widthButton,
isPadding,
isHideRejectButtons,
principalButtonColor
} = props;
const theme = useTheme();
const styles = StyleSheet.create({
primaryBtn: {
backgroundColor: principalButtonColor ?? theme.colors.primary,
},
secodaryBtn: {
backgroundColor: theme.colors.textSecondary,
},
btnTextStyle: {
fontFamily: 'Poppins',
fontStyle: 'normal',
fontWeight: 'normal',
fontSize: 18,
paddingHorizontal: 10,
paddingVertical: 10,
position: 'absolute',
width: '100%',
left: 0,
textAlign: 'center',
},
});
return (
{!isHideRejectButtons && (
)}
{secondButton && (
)}
);
};
export const FloatingButton = (props: FloatingButtonParams) => {
const floatingButtonProps = {
...props,
UIComponent: FloatingButtonUI,
};
return ;
};