diff --git a/frontend/pshared/lib/models/recipient/filter.dart b/frontend/pshared/lib/models/recipient/filter.dart deleted file mode 100644 index 52d3b0fd..00000000 --- a/frontend/pshared/lib/models/recipient/filter.dart +++ /dev/null @@ -1 +0,0 @@ -enum RecipientFilter { all, ready, registered, notRegistered } \ No newline at end of file diff --git a/frontend/pweb/lib/app/router/payout_shell.dart b/frontend/pweb/lib/app/router/payout_shell.dart index 6d95d8df..959d7cb8 100644 --- a/frontend/pweb/lib/app/router/payout_shell.dart +++ b/frontend/pweb/lib/app/router/payout_shell.dart @@ -104,6 +104,11 @@ RouteBase payoutShellRoute() => ShellRoute( wallet, returnTo: PayoutDestination.dashboard, ), + onWalletTap: (wallet) => _openWalletEdit( + context, + wallet, + returnTo: PayoutDestination.dashboard, + ), ), ), ), @@ -120,10 +125,8 @@ RouteBase payoutShellRoute() => ShellRoute( returnTo: PayoutDestination.recipients, ), onAddRecipient: () => _openAddRecipient(context), - onEditRecipient: (recipient) => _openAddRecipient( - context, - recipient: recipient, - ), + onEditRecipient: (recipient) => + _openAddRecipient(context, recipient: recipient), onDeleteRecipient: (recipient) async { final confirmed = await showConfirmationDialog( context: context, @@ -192,22 +195,13 @@ RouteBase payoutShellRoute() => ShellRoute( GoRoute( name: PayoutRoutes.reports, path: PayoutRoutes.reportsPath, - pageBuilder: (_, _) => const NoTransitionPage( - child: OperationHistoryPage(), - ), + pageBuilder: (_, _) => + const NoTransitionPage(child: OperationHistoryPage()), ), GoRoute( name: PayoutRoutes.methods, path: PayoutRoutes.methodsPath, - pageBuilder: (context, _) => NoTransitionPage( - child: PaymentConfigPage( - onWalletTap: (wallet) => _openWalletEdit( - context, - wallet, - returnTo: PayoutDestination.methods, - ), - ), - ), + redirect: (_, state) => PayoutRoutes.dashboardPath, ), GoRoute( name: PayoutRoutes.editWallet, diff --git a/frontend/pweb/lib/l10n/en.arb b/frontend/pweb/lib/l10n/en.arb index 786e9853..b99854e4 100644 --- a/frontend/pweb/lib/l10n/en.arb +++ b/frontend/pweb/lib/l10n/en.arb @@ -422,7 +422,7 @@ "selectPaymentType": "Please select a payment method type", "paymentTypeCard": "Russian bank card", - "paymentTypeBankAccount": "Russian Bank Account", + "paymentTypeBankAccount": "Russian bank account", "paymentTypeIban": "IBAN", "paymentTypeWallet": "Wallet", "paymentTypeCryptoWallet": "Crypto Wallet", diff --git a/frontend/pweb/lib/pages/dashboard/buttons/balance/balance.dart b/frontend/pweb/lib/pages/dashboard/buttons/balance/balance.dart index eb88511d..da14d823 100644 --- a/frontend/pweb/lib/pages/dashboard/buttons/balance/balance.dart +++ b/frontend/pweb/lib/pages/dashboard/buttons/balance/balance.dart @@ -15,10 +15,12 @@ import 'package:pweb/generated/i18n/app_localizations.dart'; class BalanceWidget extends StatelessWidget { final ValueChanged onTopUp; + final ValueChanged onWalletTap; const BalanceWidget({ super.key, required this.onTopUp, + required this.onWalletTap, }); @override @@ -74,6 +76,7 @@ class BalanceWidget extends StatelessWidget { } }, onTopUp: onTopUp, + onWalletTap: onWalletTap, ); if (wallets.isEmpty && accounts.isEmpty) { diff --git a/frontend/pweb/lib/pages/dashboard/buttons/balance/card.dart b/frontend/pweb/lib/pages/dashboard/buttons/balance/card.dart index b8cb4a25..af77978f 100644 --- a/frontend/pweb/lib/pages/dashboard/buttons/balance/card.dart +++ b/frontend/pweb/lib/pages/dashboard/buttons/balance/card.dart @@ -19,11 +19,13 @@ import 'package:pweb/generated/i18n/app_localizations.dart'; class WalletCard extends StatelessWidget { final Wallet wallet; final VoidCallback onTopUp; + final VoidCallback onTap; const WalletCard({ super.key, required this.wallet, required this.onTopUp, + required this.onTap, }); @override @@ -40,6 +42,9 @@ class WalletCard extends StatelessWidget { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(WalletCardConfig.borderRadius), ), + child: InkWell( + borderRadius: BorderRadius.circular(WalletCardConfig.borderRadius), + onTap: onTap, child: SizedBox.expand( child: Padding( padding: WalletCardConfig.contentPadding, @@ -70,7 +75,7 @@ class WalletCard extends StatelessWidget { ), ), ), - + ), ); } } diff --git a/frontend/pweb/lib/pages/dashboard/buttons/balance/carousel.dart b/frontend/pweb/lib/pages/dashboard/buttons/balance/carousel.dart index 4861d928..da3f2dc6 100644 --- a/frontend/pweb/lib/pages/dashboard/buttons/balance/carousel.dart +++ b/frontend/pweb/lib/pages/dashboard/buttons/balance/carousel.dart @@ -16,6 +16,7 @@ class BalanceCarousel extends StatefulWidget { final int currentIndex; final ValueChanged onIndexChanged; final ValueChanged onTopUp; + final ValueChanged onWalletTap; const BalanceCarousel({ super.key, @@ -23,6 +24,7 @@ class BalanceCarousel extends StatefulWidget { required this.currentIndex, required this.onIndexChanged, required this.onTopUp, + required this.onWalletTap, }); @override @@ -101,6 +103,7 @@ class _BalanceCarouselState extends State { BalanceItemType.wallet => WalletCard( wallet: item.wallet!, onTopUp: () => widget.onTopUp(item.wallet!), + onTap: () => widget.onWalletTap(item.wallet!), ), BalanceItemType.ledger => LedgerAccountCard(account: item.account!), BalanceItemType.addAction => const AddBalanceCard(), diff --git a/frontend/pweb/lib/pages/dashboard/buttons/balance/config.dart b/frontend/pweb/lib/pages/dashboard/buttons/balance/config.dart index 135895d0..a70b9234 100644 --- a/frontend/pweb/lib/pages/dashboard/buttons/balance/config.dart +++ b/frontend/pweb/lib/pages/dashboard/buttons/balance/config.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; abstract class WalletCardConfig { - static const double cardHeight = 130.0; + static const double cardHeight = 145.0; static const double elevation = 4.0; static const double borderRadius = 16.0; static const double viewportFraction = 0.9; diff --git a/frontend/pweb/lib/pages/dashboard/dashboard.dart b/frontend/pweb/lib/pages/dashboard/dashboard.dart index b7e044c5..18038981 100644 --- a/frontend/pweb/lib/pages/dashboard/dashboard.dart +++ b/frontend/pweb/lib/pages/dashboard/dashboard.dart @@ -27,12 +27,14 @@ class DashboardPage extends StatefulWidget { final ValueChanged onRecipientSelected; final void Function(PaymentType type) onGoToPaymentWithoutRecipient; final ValueChanged onTopUp; + final ValueChanged onWalletTap; const DashboardPage({ super.key, required this.onRecipientSelected, required this.onGoToPaymentWithoutRecipient, required this.onTopUp, + required this.onWalletTap, }); @override @@ -88,6 +90,7 @@ class _DashboardPageState extends State { create: (_) => CarouselIndexController(), child: BalanceWidget( onTopUp: widget.onTopUp, + onWalletTap: widget.onWalletTap, ), ), const SizedBox(height: AppSpacing.small), diff --git a/frontend/pweb/lib/utils/recipient/filtering.dart b/frontend/pweb/lib/utils/recipient/filtering.dart index 4b690946..29075657 100644 --- a/frontend/pweb/lib/utils/recipient/filtering.dart +++ b/frontend/pweb/lib/utils/recipient/filtering.dart @@ -1,25 +1,11 @@ -import 'package:pshared/models/recipient/filter.dart'; import 'package:pshared/models/recipient/recipient.dart'; -import 'package:pshared/models/recipient/status.dart'; List filterRecipients({ required List recipients, - RecipientFilter filter = RecipientFilter.all, String query = '', }) { - var filtered = recipients.where((r) { - switch (filter) { - case RecipientFilter.ready: - return r.status == RecipientStatus.ready; - case RecipientFilter.registered: - return r.status == RecipientStatus.registered; - case RecipientFilter.notRegistered: - return r.status == RecipientStatus.notRegistered; - case RecipientFilter.all: - return true; - } - }).toList(); + final filtered = recipients; final normalizedQuery = query.trim().toLowerCase(); if (normalizedQuery.isEmpty) return filtered; diff --git a/frontend/pweb/lib/widgets/sidebar/sidebar.dart b/frontend/pweb/lib/widgets/sidebar/sidebar.dart index 1cef014c..19af0f71 100644 --- a/frontend/pweb/lib/widgets/sidebar/sidebar.dart +++ b/frontend/pweb/lib/widgets/sidebar/sidebar.dart @@ -28,7 +28,6 @@ class PayoutSidebar extends StatelessWidget { final String? avatarUrl; final List? items; - @override Widget build(BuildContext context) { final accountName = context.select( @@ -40,13 +39,15 @@ class PayoutSidebar extends StatelessWidget { final resolvedUserName = userName ?? accountName; final resolvedAvatarUrl = avatarUrl ?? accountAvatar; - final menuItems = items ?? + final menuItems = + items ?? [ PayoutDestination.dashboard, PayoutDestination.recipients, PayoutDestination.invitations, - PayoutDestination.methods, - //PayoutDestination.reports, + // PayoutDestination.methods, + // PayoutDestination.reports, + // PayoutDestination.organizationSettings, //TODO Add when ready ]; @@ -56,11 +57,11 @@ class PayoutSidebar extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ UserProfileCard( - theme: theme, - avatarUrl: resolvedAvatarUrl, - userName: resolvedUserName, - selected: selected, - onSelected: onSelected + theme: theme, + avatarUrl: resolvedAvatarUrl, + userName: resolvedUserName, + selected: selected, + onSelected: onSelected, ), const SizedBox(height: 8), SideMenuColumn(