import React from 'react'; import Ripple, {RippleProps} from '../Core/Ripple'; import Surface, {SurfaceProps} from '../Core/Surface'; import {ViewStyle, StyleProp, View, StyleSheet} from 'react-native'; import Icon, {IconFontFamily} from '../Core/Icon'; import Color from 'color'; import {useTheme} from '../../Theming'; import Text, {TextProps} from '../Core/Typography'; export interface FABProps extends RippleProps { iconFontFamily?: IconFontFamily; role?: 'fab' | 'icon' | 'button'; paperProps?: SurfaceProps; color?: // | string string | ('primary' | 'secondary' | 'accent' | 'error' | 'warning' | 'text'); size?: number; onLayout?: any; // bu kısımı sonrada düzenle icon?: string; label?: string; theme?: object; dense?: boolean; labelProps?: TextProps; contentContainerStyle?: StyleProp; style?: StyleProp; rippleStyle?: StyleProp; } const FAB: React.FC = ({ children, paperProps = {padding: [4, 8], margin: 2}, color = 'primary', label, style, dense, size = 24, iconFontFamily, rippleStyle, labelProps, onLayout, theme, contentContainerStyle, icon, ...props }) => { const themeControl: any = useTheme(theme); let fabColor: string = color && color in themeControl.color ? themeControl.color[color] : color ? color : themeControl.color.primary, foreColor: string = Color(fabColor).isDark() ? 'white' : 'black'; return ( {icon !== undefined && ( )} {label !== undefined && ( {label} )} ); }; export default FAB;