From 6b3bb2b56eae2a0b79a405c77e255a105bb15532 Mon Sep 17 00:00:00 2001 From: Leendert de Borst Date: Thu, 22 Jan 2026 22:28:36 +0100 Subject: [PATCH] Tweak confirm dialog style (#1473) --- .../components/common/ConfirmDialog.tsx | 20 ++++++++++--------- .../components/common/ModalWrapper.tsx | 1 + 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/apps/mobile-app/components/common/ConfirmDialog.tsx b/apps/mobile-app/components/common/ConfirmDialog.tsx index 588c67fb1..7e01a1a69 100644 --- a/apps/mobile-app/components/common/ConfirmDialog.tsx +++ b/apps/mobile-app/components/common/ConfirmDialog.tsx @@ -7,6 +7,8 @@ import { TouchableOpacity, View, ActivityIndicator, + ViewStyle, + TextStyle, } from 'react-native'; import { useColors } from '@/hooks/useColorScheme'; @@ -129,19 +131,19 @@ export const ConfirmDialog: React.FC = ({ /** * Get button style based on button configuration. */ - const getButtonStyle = (button: IConfirmDialogButton, index: number): object[] => { - const baseStyle = [styles.button]; + const getButtonStyle = (button: IConfirmDialogButton, index: number): ViewStyle[] => { + const baseStyle: ViewStyle[] = [styles.button]; if (button.style === 'destructive') { - baseStyle.push({ backgroundColor: colors.destructive }); + baseStyle.push({ backgroundColor: colors.destructive } as ViewStyle); } else if (button.style === 'cancel') { baseStyle.push({ backgroundColor: colors.accentBackground, borderColor: colors.accentBorder, borderWidth: 1, - }); + } as ViewStyle); } else { - baseStyle.push({ backgroundColor: colors.primary }); + baseStyle.push({ backgroundColor: colors.primary } as ViewStyle); } if (isSubmitting && loadingButtonIndex === index) { @@ -154,13 +156,13 @@ export const ConfirmDialog: React.FC = ({ /** * Get button text style based on button configuration. */ - const getButtonTextStyle = (button: IConfirmDialogButton): object[] => { - const baseStyle = [styles.buttonText]; + const getButtonTextStyle = (button: IConfirmDialogButton): TextStyle[] => { + const baseStyle: TextStyle[] = [styles.buttonText]; if (button.style === 'cancel') { - baseStyle.push({ color: colors.text }); + baseStyle.push({ color: colors.text } as TextStyle); } else { - baseStyle.push({ color: colors.white }); + baseStyle.push({ color: colors.white } as TextStyle); } return baseStyle; diff --git a/apps/mobile-app/components/common/ModalWrapper.tsx b/apps/mobile-app/components/common/ModalWrapper.tsx index bf573ffb1..c7a256bdf 100644 --- a/apps/mobile-app/components/common/ModalWrapper.tsx +++ b/apps/mobile-app/components/common/ModalWrapper.tsx @@ -107,6 +107,7 @@ export const ModalWrapper: React.FC = ({ borderBottomColor: showHeaderBorder ? colors.accentBorder : 'transparent', borderBottomWidth: showHeaderBorder ? 1 : 0, padding: 20, + paddingBottom: 0, }, title: { color: colors.text,