From a17fb910eda7979d41f35df72a008a7eac4b7867 Mon Sep 17 00:00:00 2001 From: ameer2468 <33054370+ameer2468@users.noreply.github.com> Date: Thu, 22 Feb 2024 15:20:31 +0300 Subject: [PATCH] [MOB-62] Spacing & padding tweaks (#2117) Spacing & padding tweaks --- apps/mobile/src/components/browse/BrowseLocations.tsx | 6 +++--- apps/mobile/src/components/browse/BrowseTags.tsx | 8 +++----- apps/mobile/src/components/browse/Categories.tsx | 6 +++--- apps/mobile/src/components/browse/Jobs.tsx | 6 +++--- apps/mobile/src/components/header/Header.tsx | 3 +-- apps/mobile/src/components/layout/ScreenContainer.tsx | 4 ++-- apps/mobile/src/components/overview/Categories.tsx | 4 ++-- apps/mobile/src/components/overview/Devices.tsx | 4 +--- apps/mobile/src/components/overview/OverviewSection.tsx | 7 ++++--- apps/mobile/src/components/overview/OverviewStats.tsx | 4 ++-- apps/mobile/src/screens/settings/Settings.tsx | 4 ++-- 11 files changed, 26 insertions(+), 30 deletions(-) diff --git a/apps/mobile/src/components/browse/BrowseLocations.tsx b/apps/mobile/src/components/browse/BrowseLocations.tsx index eff26a579..804e91f3c 100644 --- a/apps/mobile/src/components/browse/BrowseLocations.tsx +++ b/apps/mobile/src/components/browse/BrowseLocations.tsx @@ -97,8 +97,8 @@ const BrowseLocations = () => { const locations = useCache(result.data?.items); return ( - - + + Locations { data={locations} ListEmptyComponent={() => ( diff --git a/apps/mobile/src/components/browse/BrowseTags.tsx b/apps/mobile/src/components/browse/BrowseTags.tsx index 5ecc31cc1..125be6cac 100644 --- a/apps/mobile/src/components/browse/BrowseTags.tsx +++ b/apps/mobile/src/components/browse/BrowseTags.tsx @@ -22,13 +22,11 @@ type TagItemProps = { onPress: () => void; tagStyle?: ClassInput; viewStyle?: 'grid' | 'list'; - rightActions?: () => void; }; export const TagItem = ({ tag, onPress, - rightActions, tagStyle, viewStyle = 'grid' }: TagItemProps) => { @@ -146,8 +144,8 @@ const BrowseTags = () => { const modalRef = useRef(null); return ( - - + + Tags navigation.navigate('Tags')}> @@ -192,7 +190,7 @@ const BrowseTags = () => { keyExtractor={(item) => item.id.toString()} horizontal showsHorizontalScrollIndicator={false} - contentContainerStyle={tw`px-7`} + contentContainerStyle={tw`px-6`} ItemSeparatorComponent={() => } /> diff --git a/apps/mobile/src/components/browse/Categories.tsx b/apps/mobile/src/components/browse/Categories.tsx index 073e3170e..086f4f46c 100644 --- a/apps/mobile/src/components/browse/Categories.tsx +++ b/apps/mobile/src/components/browse/Categories.tsx @@ -28,11 +28,11 @@ const CATEGORIES_LIST = [ ]; const Categories = () => { return ( - - Library + + Library - + {CATEGORIES_LIST.map((c, i) => { return ; })} diff --git a/apps/mobile/src/components/browse/Jobs.tsx b/apps/mobile/src/components/browse/Jobs.tsx index 151b1b6f5..afe3de4f6 100644 --- a/apps/mobile/src/components/browse/Jobs.tsx +++ b/apps/mobile/src/components/browse/Jobs.tsx @@ -9,13 +9,13 @@ import Fade from '../layout/Fade'; const Jobs = () => { return ( - - + + Jobs - + - + {navBack && ( diff --git a/apps/mobile/src/components/layout/ScreenContainer.tsx b/apps/mobile/src/components/layout/ScreenContainer.tsx index be5eaec79..452e63edf 100644 --- a/apps/mobile/src/components/layout/ScreenContainer.tsx +++ b/apps/mobile/src/components/layout/ScreenContainer.tsx @@ -15,14 +15,14 @@ const ScreenContainer = ({ children, style, scrollview = true, tabHeight = true const height = useBottomTabBarHeight(); return scrollview ? ( {children} ) : ( diff --git a/apps/mobile/src/components/overview/Categories.tsx b/apps/mobile/src/components/overview/Categories.tsx index 502e7cc7e..2e479cc13 100644 --- a/apps/mobile/src/components/overview/Categories.tsx +++ b/apps/mobile/src/components/overview/Categories.tsx @@ -16,7 +16,7 @@ interface Props { const Categories = ({ kinds }: Props) => { return ( - Categories + Categories @@ -24,7 +24,7 @@ const Categories = ({ kinds }: Props) => { data={kinds.data?.statistics ?.sort((a, b) => b.count - a.count) .filter((i) => i.kind !== 0)} - contentContainerStyle={tw`pl-7`} + contentContainerStyle={tw`pl-5`} numColumns={Math.ceil(Number(kinds.data?.statistics.length ?? 0) / 2)} key={kinds.data?.statistics ? 'kinds' : '_'} //needed to update numColumns when data is available keyExtractor={(item) => item.name} diff --git a/apps/mobile/src/components/overview/Devices.tsx b/apps/mobile/src/components/overview/Devices.tsx index 4466c189f..8037c7b3c 100644 --- a/apps/mobile/src/components/overview/Devices.tsx +++ b/apps/mobile/src/components/overview/Devices.tsx @@ -30,14 +30,13 @@ function hardwareModelToIcon(hardwareModel: HardwareModel) { const Devices = ({ node, stats }: Props) => { return ( - {node && ( { - ); }; diff --git a/apps/mobile/src/components/overview/OverviewSection.tsx b/apps/mobile/src/components/overview/OverviewSection.tsx index 9f3eb536c..126e5d7e0 100644 --- a/apps/mobile/src/components/overview/OverviewSection.tsx +++ b/apps/mobile/src/components/overview/OverviewSection.tsx @@ -9,8 +9,9 @@ interface Props extends PropsWithChildren { const OverviewSection = ({ title, count, children }: Props) => { return ( - <> - + + {/* The view wrapper is needed to prevent gap spacing from screen container */} + {title} { {children} - + ); }; diff --git a/apps/mobile/src/components/overview/OverviewStats.tsx b/apps/mobile/src/components/overview/OverviewStats.tsx index 642a14bf2..9df6aeb26 100644 --- a/apps/mobile/src/components/overview/OverviewStats.tsx +++ b/apps/mobile/src/components/overview/OverviewStats.tsx @@ -98,8 +98,8 @@ const OverviewStats = ({ stats }: Props) => { }; return ( - - Statistics + + Statistics {renderStatItems()} diff --git a/apps/mobile/src/screens/settings/Settings.tsx b/apps/mobile/src/screens/settings/Settings.tsx index 1fadbf874..1c100eab3 100644 --- a/apps/mobile/src/screens/settings/Settings.tsx +++ b/apps/mobile/src/screens/settings/Settings.tsx @@ -128,7 +128,7 @@ function renderSectionHeader({ section }: { section: { title: string } }) { return ( @@ -141,7 +141,7 @@ export default function SettingsScreen({ navigation }: SettingsStackScreenProps< const debugState = useDebugState(); return ( - +