diff --git a/src/view/com/util/fab/FABInner.tsx b/src/view/com/util/fab/FABInner.tsx index 5b1d5d8883..2384f824db 100644 --- a/src/view/com/util/fab/FABInner.tsx +++ b/src/view/com/util/fab/FABInner.tsx @@ -1,6 +1,6 @@ import React, {ComponentProps} from 'react' import {observer} from 'mobx-react-lite' -import {StyleSheet, TouchableWithoutFeedback} from 'react-native' +import {TouchableWithoutFeedback} from 'react-native' import LinearGradient from 'react-native-linear-gradient' import {gradients} from 'lib/styles' import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' @@ -8,6 +8,7 @@ import {useSafeAreaInsets} from 'react-native-safe-area-context' import {clamp} from 'lib/numbers' import {useMinimalShellMode} from 'lib/hooks/useMinimalShellMode' import Animated from 'react-native-reanimated' +import {useStyles} from 'view/nova' export interface FABProps extends ComponentProps { @@ -21,59 +22,51 @@ export const FABInner = observer(function FABInnerImpl({ ...props }: FABProps) { const insets = useSafeAreaInsets() - const {isMobile, isTablet} = useWebMediaQueries() + const {isMobile} = useWebMediaQueries() const {fabMinimalShellTransform} = useMinimalShellMode() - - const size = React.useMemo(() => { - return isTablet ? styles.sizeLarge : styles.sizeRegular - }, [isTablet]) - const tabletSpacing = React.useMemo(() => { - return isTablet - ? {right: 50, bottom: 50} - : { - right: 24, - bottom: clamp(insets.bottom, 15, 60) + 15, - } - }, [insets.bottom, isTablet]) + const styles = useStyles({ + outer: { + position: 'absolute', + z: 1, + right: 24, + bottom: clamp(insets.bottom, 15, 60) + 15, + gtMobile: { + right: 50, + bottom: 50, + }, + }, + sizing: { + w: 60, + h: 60, + radius: 30, + gtMobile: { + w: 70, + h: 70, + radius: 35, + }, + }, + inner: { + justifyContent: 'center', + alignItems: 'center', + }, + }) return ( + style={[styles.inner, styles.sizing]}> {icon} ) }) - -const styles = StyleSheet.create({ - sizeRegular: { - width: 60, - height: 60, - borderRadius: 30, - }, - sizeLarge: { - width: 70, - height: 70, - borderRadius: 35, - }, - outer: { - position: 'absolute', - zIndex: 1, - }, - inner: { - justifyContent: 'center', - alignItems: 'center', - }, -})