diff --git a/lib/ui/app/menu_drawer.dart b/lib/ui/app/menu_drawer.dart index 6fe9739aa..17b28ec51 100644 --- a/lib/ui/app/menu_drawer.dart +++ b/lib/ui/app/menu_drawer.dart @@ -232,7 +232,7 @@ class MenuDrawer extends StatelessWidget { color: Theme.of(context).cardColor, child: ScrollableListView( children: [ - if (kReleaseMode && state.account.debugEnabled) + if (state.account.debugEnabled && kReleaseMode) if (state.isMenuCollapsed) Tooltip( message: localization.debugModeIsEnabled, @@ -261,6 +261,43 @@ class MenuDrawer extends StatelessWidget { ), onTap: () => launch(kDebugModeUrl), ), + if (state.company.isDisabled) + if (state.isMenuCollapsed) + Tooltip( + message: localization.companyDisabledWarning, + child: ListTile( + contentPadding: + const EdgeInsets.only(left: 20), + onTap: () { + store.dispatch(ViewSettings( + navigator: Navigator.of(context), + section: kSettingsAccountManagement)); + }, + leading: + Icon(Icons.warning, color: Colors.orange), + ), + ) + else + ListTile( + tileColor: Colors.orange.shade800, + title: Padding( + padding: const EdgeInsets.only(bottom: 6), + child: IconText( + icon: Icons.warning, + text: localization.warning, + style: TextStyle(color: Colors.white), + ), + ), + subtitle: Text( + localization.companyDisabledWarning, + style: TextStyle(color: Colors.white), + ), + onTap: () { + store.dispatch(ViewSettings( + navigator: Navigator.of(context), + section: kSettingsAccountManagement)); + }, + ), DrawerTile( company: company, icon: getEntityIcon(EntityType.dashboard), @@ -604,28 +641,6 @@ class SidebarFooter extends StatelessWidget { ), ]), ) - else if (state.company.isDisabled) - IconButton( - tooltip: localization.warning, - icon: Icon( - Icons.warning, - color: Colors.orange, - ), - onPressed: () => showMessageDialog( - context: context, - message: localization.companyDisabledWarning, - secondaryActions: [ - TextButton( - child: Text(localization.viewSettings.toUpperCase()), - onPressed: () { - store.dispatch(ViewSettings( - navigator: Navigator.of(context), - section: kSettingsAccountManagement)); - Navigator.of(context).pop(); - }, - ), - ]), - ) else if (state.credentials.token.isEmpty) IconButton( tooltip: localization.error, diff --git a/lib/utils/i18n.dart b/lib/utils/i18n.dart index 67b819a9e..12e4ae871 100644 --- a/lib/utils/i18n.dart +++ b/lib/utils/i18n.dart @@ -157,8 +157,7 @@ mixin LocalizationsProvider on LocaleCodeAware { 'project_name': 'Project Name', 'warning': 'Warning', 'view_settings': 'View Settings', - 'company_disabled_warning': - 'Warning: this company has not yet been activated', + 'company_disabled_warning': 'Company is not activated', 'late_invoice': 'Late Invoice', 'expired_quote': 'Expired Quote', 'remind_invoice': 'Remind Invoice',