Skip to content

Commit

Permalink
feat: Move notification menu to differnt place #2869
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Sep 6, 2024
1 parent f6fc87e commit c231135
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:altme/app/app.dart';
import 'package:altme/dashboard/dashboard.dart';
import 'package:altme/l10n/l10n.dart';
import 'package:altme/matrix_notification/matrix_notification.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

Expand Down Expand Up @@ -86,14 +85,6 @@ class HelpCenterView extends StatelessWidget {
},
),
],
if (helpCenterOptions.displayNotification && isEnterprise) ...[
DrawerItem(
title: l10n.notificationRoom,
onTap: () {
Navigator.of(context).push<void>(NotificationPage.route());
},
),
],
if (helpCenterOptions.displayEmailSupport) ...[
DrawerItem(
title: l10n.sendAnEmail,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import 'package:altme/dashboard/dashboard.dart';
import 'package:altme/dashboard/drawer/wallet_settings/view/language_settings.dart';
import 'package:altme/dashboard/drawer/wallet_settings/view/theme_settings.dart';
import 'package:altme/l10n/l10n.dart';
import 'package:altme/matrix_notification/matrix_notification.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

class WalletSettingsMenu extends StatelessWidget {
const WalletSettingsMenu({super.key});
Expand All @@ -28,6 +30,12 @@ class WalletSettingsMenuView extends StatelessWidget {
Widget build(BuildContext context) {
final l10n = context.l10n;

final profileModel = context.read<ProfileCubit>().state.model;

final helpCenterOptions = profileModel.profileSetting.helpCenterOptions;

final isEnterprise = profileModel.walletType == WalletType.enterprise;

return BasePage(
backgroundColor: Theme.of(context).colorScheme.surface,
useSafeArea: true,
Expand Down Expand Up @@ -55,6 +63,14 @@ class WalletSettingsMenuView extends StatelessWidget {
await Navigator.of(context).push<void>(ThemeSettings.route());
},
),
if (helpCenterOptions.displayNotification && isEnterprise) ...[
DrawerItem(
title: l10n.notificationRoom,
onTap: () {
Navigator.of(context).push<void>(NotificationPage.route());
},
),
],
],
),
);
Expand Down

0 comments on commit c231135

Please sign in to comment.