Skip to content

Commit

Permalink
Update copy on delete page
Browse files Browse the repository at this point in the history
  • Loading branch information
JElgar committed Aug 24, 2024
1 parent 21adce6 commit 24b5dfa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lib/ui/views/delete_account/delete_account_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import 'package:nowu/ui/views/delete_account/delete_account_state.dart';
import '../../../services/auth.dart';
import '../../../services/user_service.dart';

const String deleteUserConfirmationText = "delete me";

class DeleteAccountBloc extends Cubit<DeleteAccountState> {
AuthenticationService _authenticationService;
StackRouter _appRouter;
Expand All @@ -24,7 +26,7 @@ class DeleteAccountBloc extends Cubit<DeleteAccountState> {
emit(
state.copyWith(
name: name,
isNameValid: name == _userService.currentUser?.name,
isNameValid: name == deleteUserConfirmationText,
),
);
}
Expand Down
24 changes: 20 additions & 4 deletions lib/ui/views/delete_account/delete_account_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,35 @@ class DeleteAccountView extends StatelessWidget {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: Theme.of(context).textTheme.titleMedium,
children: [
const TextSpan(
text: 'Are you sure you want to delete your account? ',
),
const TextSpan(
text: 'This action cannot be undone.',
style: TextStyle(fontWeight: FontWeight.w700),
),
],
),
),
const SizedBox(height: 8),
Text(
'Are you sure you want to delete your account? This action cannot be undone.',
'To confirm, please type "$deleteUserConfirmationText" below.',
style: Theme.of(context).textTheme.titleMedium,
textAlign: TextAlign.center,
),
const Padding(padding: EdgeInsets.all(8)),
const SizedBox(height: 8),
TextField(
onChanged: bloc.updateInputName,
decoration: const InputDecoration(
hintText: 'Type account name to confirm',
hintText: deleteUserConfirmationText,
),
),
const Padding(padding: EdgeInsets.all(8)),
const SizedBox(height: 8),
DeleteAccountButton(),
],
),
Expand Down

0 comments on commit 24b5dfa

Please sign in to comment.