Tweak confirm dialog style (#1473)

This commit is contained in:
Leendert de Borst
2026-01-22 22:28:36 +01:00
parent 198b389345
commit 6b3bb2b56e
2 changed files with 12 additions and 9 deletions

View File

@@ -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<IConfirmDialogProps> = ({
/**
* 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<IConfirmDialogProps> = ({
/**
* 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;

View File

@@ -107,6 +107,7 @@ export const ModalWrapper: React.FC<IModalWrapperProps> = ({
borderBottomColor: showHeaderBorder ? colors.accentBorder : 'transparent',
borderBottomWidth: showHeaderBorder ? 1 : 0,
padding: 20,
paddingBottom: 0,
},
title: {
color: colors.text,