Skip to content

Commit

Permalink
💄 TopAppBar - apply different button margin if it's tablet or not
Browse files Browse the repository at this point in the history
  • Loading branch information
clementdejoie committed Dec 6, 2023
1 parent a8f888b commit 322be0f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/topAppBar/TopAppBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 322be0f

Please sign in to comment.