import createStyles from '@material-ui/core/styles/createStyles' ; import makeStyles from '@material-ui/core/styles/makeStyles' ; import { IThemeWeb } from '../../Themes' ; type FabStyles = { backgroundColor ? : string ; boxShadow ? : string ; color ? : string ; } ; param { IThemeWeb } theme return { FabStyles } const getStylesForPrimary = ( theme ) => { const primary = { } ; if ( theme . palette && theme . palette . primary ) { primary . backgroundColor = theme . palette . primary . main ; primary . color = theme . palette . primary . contrastText ; } return primary ; } ; param { IThemeWeb } theme return { FabStyles } const getStylesForRoot = ( theme ) => { const root = { } ; if ( theme . palette && theme . palette . background ) { root . backgroundColor = theme . palette . background . default ; root . color = theme . palette . background . defaultContrastText ; } return root ; } ; param { IThemeWeb } theme return { FabStyles } const getStylesForSecondary = ( theme ) => { const secondary = { } ; if ( theme . palette && theme . palette . secondary ) { secondary . backgroundColor = theme . palette . secondary . main ; secondary . color = theme . palette . secondary . contrastText ; } return secondary ; } ; export const styles = ( theme ) => { const root = getStylesForRoot ( theme ) ; if ( theme . shadows ) { todo root . boxShadow = theme . shadows [ 4 ] ; } return { root , primary : getStylesForPrimary ( theme ) , secondary : getStylesForSecondary ( theme ) } ; } ; export const useStyles = makeStyles ( createStyles ( styles ) , { name : 'NatDSFab' } ) ;