mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-22 00:13:45 -05:00
fix: align action buttons in modal for confirming transaction edit (#4604)
align the "Cancel" and "Confirm" buttons in the modal for confirming a transaction edit to the right-hand side for consistency
This commit is contained in:
@@ -4,7 +4,9 @@ import { useTranslation, Trans } from 'react-i18next';
|
||||
|
||||
import { Block } from '@actual-app/components/block';
|
||||
import { Button } from '@actual-app/components/button';
|
||||
import { useResponsive } from '@actual-app/components/hooks/useResponsive';
|
||||
import { InitialFocus } from '@actual-app/components/initial-focus';
|
||||
import { styles } from '@actual-app/components/styles';
|
||||
import { View } from '@actual-app/components/view';
|
||||
|
||||
import { type Modal as ModalType } from 'loot-core/client/modals/modalsSlice';
|
||||
@@ -23,6 +25,13 @@ export function ConfirmTransactionEditModal({
|
||||
}: ConfirmTransactionEditModalProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { isNarrowWidth } = useResponsive();
|
||||
const narrowButtonStyle = isNarrowWidth
|
||||
? {
|
||||
height: styles.mobileMinHeight,
|
||||
}
|
||||
: {};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
name="confirm-transaction-edit"
|
||||
@@ -83,44 +92,42 @@ export function ConfirmTransactionEditModal({
|
||||
<Trans>Are you sure you want to edit this transaction?</Trans>
|
||||
</Block>
|
||||
)}
|
||||
|
||||
<View
|
||||
style={{
|
||||
marginTop: 20,
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'flex-start',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'flex-end',
|
||||
}}
|
||||
>
|
||||
<View
|
||||
<Button
|
||||
aria-label={t('Cancel')}
|
||||
style={{
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'flex-end',
|
||||
marginRight: 10,
|
||||
...narrowButtonStyle,
|
||||
}}
|
||||
onPress={() => {
|
||||
close();
|
||||
onCancel();
|
||||
}}
|
||||
>
|
||||
<Trans>Cancel</Trans>
|
||||
</Button>
|
||||
<InitialFocus>
|
||||
<Button
|
||||
aria-label={t('Cancel')}
|
||||
style={{ marginRight: 10 }}
|
||||
aria-label={t('Confirm')}
|
||||
variant="primary"
|
||||
style={{
|
||||
marginRight: 10,
|
||||
...narrowButtonStyle,
|
||||
}}
|
||||
onPress={() => {
|
||||
close();
|
||||
onCancel();
|
||||
onConfirm();
|
||||
}}
|
||||
>
|
||||
<Trans>Cancel</Trans>
|
||||
<Trans>Confirm</Trans>
|
||||
</Button>
|
||||
<InitialFocus>
|
||||
<Button
|
||||
aria-label={t('Confirm')}
|
||||
variant="primary"
|
||||
onPress={() => {
|
||||
close();
|
||||
onConfirm();
|
||||
}}
|
||||
>
|
||||
<Trans>Confirm</Trans>
|
||||
</Button>
|
||||
</InitialFocus>
|
||||
</View>
|
||||
</InitialFocus>
|
||||
</View>
|
||||
</View>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user