Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cat-voices): discovery page mve3 #1281

Merged
merged 18 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .config/dictionaries/project.dic
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ unawaited
unchunk
Unlogged
unmanaged
Unmarks
Unstaked
upskilling
UTXO
Expand Down
5 changes: 4 additions & 1 deletion catalyst_voices/apps/voices/lib/app/view/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ class _AppState extends State<App> {
create: (_) => Dependencies.instance.get<LoginBloc>(),
),
BlocProvider<SessionCubit>(
create: (_) => Dependencies.instance.get(),
create: (_) => Dependencies.instance.get<SessionCubit>(),
),
BlocProvider<ProposalsCubit>(
create: (_) => Dependencies.instance.get<ProposalsCubit>(),
),
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ abstract class DateFormatter {
/// - Yesterday
/// - 2 days ago
/// - Other cases: yMMMMd date format.
static String formatRecentDate(VoicesLocalizations l10n, DateTime dateTime) {
final now = DateTimeExt.now();
static String formatRecentDate(
VoicesLocalizations l10n,
DateTime dateTime, {
DateTime? from,
}) {
from ??= DateTimeExt.now();

final today = DateTime(now.year, now.month, now.day, 12);
final today = DateTime(from.year, from.month, from.day, 12);
if (dateTime.isSameDateAs(today)) return l10n.today;

final tomorrow = today.plusDays(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ final class Dependencies extends DependencyProvider {
registrationService: get<RegistrationService>(),
progressNotifier: get<RegistrationProgressNotifier>(),
);
});
})
..registerLazySingleton<ProposalsCubit>(
() => ProposalsCubit(proposalRepository: get<ProposalRepository>()),
);
}

void _registerRepositories() {
Expand All @@ -62,6 +65,9 @@ final class Dependencies extends DependencyProvider {
)
..registerLazySingleton<TransactionConfigRepository>(
TransactionConfigRepository.new,
)
..registerLazySingleton<ProposalRepository>(
ProposalRepository.new,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class _UnlockPassword extends StatelessWidget {
Widget build(BuildContext context) {
return VoicesPasswordTextField(
controller: controller,
autofocus: true,
decoration: VoicesTextFieldDecoration(
labelText: context.l10n.unlockDialogHint,
errorText: error?.message(context),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@ import 'package:flutter_bloc/flutter_bloc.dart';

// Note. This widget will be removed so its not localized
class CurrentUserStatusText extends StatelessWidget {
const CurrentUserStatusText({
super.key,
});
const CurrentUserStatusText({super.key});

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final sessionBloc = context.watch<SessionCubit>();

final stateDesc = switch (sessionBloc.state) {
VisitorSessionState() => 'visitor',
GuestSessionState() => 'guest',
ActiveAccountSessionState() => 'user',
VisitorSessionState() => 'Visitor / no key',
GuestSessionState() => 'Guest / locked',
ActiveAccountSessionState() => 'Actor / unlocked',
};

return Text(
Expand Down
Loading
Loading