From ad41c230ac93d863086c18bd414a831a41d3d21b Mon Sep 17 00:00:00 2001 From: Clement DEJOIE Date: Wed, 6 Dec 2023 15:56:17 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20TopAppBar=20-=20apply=20differen?= =?UTF-8?q?t=20button=20margin=20if=20it's=20tablet=20or=20not?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/topAppBar/TopAppBar.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/topAppBar/TopAppBar.tsx b/src/components/topAppBar/TopAppBar.tsx index c7dd028b..bc721019 100644 --- a/src/components/topAppBar/TopAppBar.tsx +++ b/src/components/topAppBar/TopAppBar.tsx @@ -3,6 +3,7 @@ import { Appbar } from 'react-native-paper'; import { useTheme } from '../../styles/themes'; import { StyleSheet, type ViewStyle } from 'react-native'; import { Headline } from '../typography/Headline'; +import DeviceInfo from "react-native-device-info"; import type { IconSource } from 'react-native-paper/lib/typescript/components/Icon'; import type { WithTestID } from 'src/shared/type'; @@ -33,11 +34,13 @@ export const TopAppBar = ({ testID, }: Props) => { const theme = useTheme(); + const isTablet = DeviceInfo.isTablet(); + const styles = StyleSheet.create({ button: { backgroundColor: 'rgba(145, 158, 171, 0.24)', borderRadius: 18, - marginLeft: 12, + marginLeft: isTablet ? 12 : theme.sw.spacing.xs, }, title: { paddingTop: size === 'medium' ? 9 : 0,