Skip to content

Commit

Permalink
feat: home screen ui updates (#1148)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinenerio authored Nov 28, 2023
1 parent b9f0818 commit 06b1a9f
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 18 deletions.
Binary file modified packages/espressocash_app/assets/images/investing-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TxUpdaterRepository {
final mostRecentTx = await _mostRecentTx();
final mostRecentSignature = mostRecentTx?.tx.id;

const fetchLimit = 100;
const fetchLimit = 50;

final details = await _client.rpcClient.getTransactionsList(
limit: fetchLimit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:provider/provider.dart';
import '../../../di.dart';
import '../../../l10n/l10n.dart';
import '../../../ui/button.dart';
import '../../../ui/loader.dart';
import '../../../ui/theme.dart';
import '../../investments/widgets/home_widget.dart';
import '../../wallet_flow/screens/wallet_flow_screen.dart';
Expand Down Expand Up @@ -47,6 +46,8 @@ class _RecentActivityWidgetState extends State<RecentActivityWidget> {
(value) => value.state.isProcessing,
);

if (isLoading && data.isEmpty) return const SizedBox.shrink();

return HomeTile(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Column(
Expand All @@ -62,9 +63,7 @@ class _RecentActivityWidgetState extends State<RecentActivityWidget> {
),
const SizedBox(height: 12),
if (data.isEmpty)
Center(
child: isLoading ? const _Loading() : const _NoActivity(),
)
const Center(child: _NoActivity())
else ...[
_Card(
child: Column(
Expand Down Expand Up @@ -133,18 +132,6 @@ class _NoActivity extends StatelessWidget {
);
}

class _Loading extends StatelessWidget {
const _Loading();

@override
Widget build(BuildContext context) => const _Card(
child: Padding(
padding: EdgeInsets.all(16),
child: LoadingIndicator(),
),
);
}

class _Card extends StatelessWidget {
const _Card({required this.child});
final Widget child;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

import '../../../gen/assets.gen.dart';
Expand Down Expand Up @@ -27,9 +28,34 @@ class InvestingWidget extends StatelessWidget {
const SizedBox(height: 12),
GestureDetector(
onTap: () => context.router.push(InvestmentsScreen.route()),
child: Center(child: Assets.images.investingBanner.image()),
child: const _InvestmentBanner(),
),
],
),
);
}

class _InvestmentBanner extends StatelessWidget {
const _InvestmentBanner();

@override
Widget build(BuildContext context) => Stack(
alignment: Alignment.bottomCenter,
children: [
Assets.images.investingBanner.image(),
Padding(
padding: const EdgeInsets.all(14.0),
child: Text(
context.l10n.investingBannerTitle,
textAlign: TextAlign.center,
style: const TextStyle(
color: Color(0xFF2D2B2C),
fontSize: 19,
fontWeight: FontWeight.w600,
letterSpacing: 0.41,
),
),
),
],
);
}
2 changes: 2 additions & 0 deletions packages/espressocash_app/lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@
"@invalidEscrowError": {},
"investingTitle": "Investing",
"@investingTitle": {},
"investingBannerTitle": "Crypto Investing Made Easy",
"@investingBannerTitle": {},
"investmentHeaderButtonsTitle": "I want to",
"@investmentHeaderButtonsTitle": {},
"isWaitingForYou": "is waiting for you.",
Expand Down

0 comments on commit 06b1a9f

Please sign in to comment.