mirror of
https://github.com/immich-app/immich.git
synced 2025-12-17 01:11:13 +03:00
fix(mobile): person birthday viewing/editing (#20731)
* fix: edit birthday dialog * chore: convert age to "x years old" format * fix: lint --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -63,7 +63,6 @@ class _DriftPersonNameEditFormState extends ConsumerState<DriftPersonBirthdayEdi
|
||||
height: 300,
|
||||
child: ClipRRect(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(16.0)),
|
||||
|
||||
child: ScrollDatePicker(
|
||||
options: DatePickerOptions(
|
||||
backgroundColor: context.colorScheme.surfaceContainerHigh,
|
||||
@@ -72,14 +71,17 @@ class _DriftPersonNameEditFormState extends ConsumerState<DriftPersonBirthdayEdi
|
||||
),
|
||||
scrollViewOptions: DatePickerScrollViewOptions(
|
||||
day: ScrollViewDetailOptions(
|
||||
isLoop: false,
|
||||
margin: const EdgeInsets.all(12),
|
||||
selectedTextStyle: TextStyle(color: context.primaryColor, fontWeight: FontWeight.bold, fontSize: 16),
|
||||
),
|
||||
month: ScrollViewDetailOptions(
|
||||
isLoop: false,
|
||||
margin: const EdgeInsets.all(12),
|
||||
selectedTextStyle: TextStyle(color: context.primaryColor, fontWeight: FontWeight.bold, fontSize: 16),
|
||||
),
|
||||
year: ScrollViewDetailOptions(
|
||||
isLoop: false,
|
||||
margin: const EdgeInsets.all(12),
|
||||
selectedTextStyle: TextStyle(color: context.primaryColor, fontWeight: FontWeight.bold, fontSize: 16),
|
||||
),
|
||||
|
||||
@@ -3,10 +3,11 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/extensions/translate_extensions.dart';
|
||||
|
||||
class PersonOptionSheet extends ConsumerWidget {
|
||||
const PersonOptionSheet({super.key, this.onEditName, this.onEditBirthday});
|
||||
const PersonOptionSheet({super.key, this.onEditName, this.onEditBirthday, this.birthdayExists = false});
|
||||
|
||||
final VoidCallback? onEditName;
|
||||
final VoidCallback? onEditBirthday;
|
||||
final bool birthdayExists;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
@@ -25,7 +26,7 @@ class PersonOptionSheet extends ConsumerWidget {
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.cake),
|
||||
title: Text('edit_birthday'.t(context: context), style: textStyle),
|
||||
title: Text((birthdayExists ? 'edit_birthday' : "add_birthday").t(context: context), style: textStyle),
|
||||
onTap: onEditBirthday,
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user