Skip to content

Commit

Permalink
multi: swap out Text() with SailText()
Browse files Browse the repository at this point in the history
a big step towards dark-mode and light-mode
  • Loading branch information
octobocto authored and torkelrogstad committed Oct 30, 2023
1 parent eb58d21 commit 1bba387
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 29 deletions.
7 changes: 4 additions & 3 deletions lib/console.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_highlighter/flutter_highlighter.dart';
import 'package:flutter_highlighter/themes/github.dart';
import 'package:get_it/get_it.dart';
import 'package:sail_ui/widgets/core/sail_text.dart';
import 'package:sidesail/logger.dart';
import 'package:sidesail/rpc/rpc.dart';

Expand Down Expand Up @@ -71,7 +72,7 @@ class RpcWidgetState extends State<RpcWidget> {
children: [
Row(
children: [
const Text(
SailText.primary14(
'RPC:',
),
Expanded(
Expand All @@ -81,12 +82,12 @@ class RpcWidgetState extends State<RpcWidget> {
),
ElevatedButton(
onPressed: _handleSubmit,
child: const Text('Submit'),
child: SailText.primary14('Submit'),
),
],
),
if (_result != null) _JsonViewer(_result),
if (_error != null) Text('Error: $_command: $_error'),
if (_error != null) SailText.primary14('Error: $_command: $_error'),
],
),
);
Expand Down
12 changes: 5 additions & 7 deletions lib/deposit_address.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:sail_ui/widgets/core/sail_text.dart';

class DepositAddress extends StatelessWidget {
const DepositAddress(this.address, {super.key});
Expand All @@ -14,22 +15,19 @@ class DepositAddress extends StatelessWidget {
children: [
Row(
children: [
const Text(
SailText.primary14(
'Deposit to this address from the mainchain: ',
),
ElevatedButton(
onPressed: () {
Clipboard.setData(ClipboardData(text: address));
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Copied address'),
SnackBar(
content: SailText.primary14('Copied address'),
),
);
},
child: Text(
address,
style: const TextStyle(color: Colors.white),
),
child: SailText.primary14(address),
),
],
),
Expand Down
2 changes: 2 additions & 0 deletions lib/pages/tabs/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class HomePage extends StatelessWidget {
return Scaffold(
body: child,
bottomNavigationBar: BottomNavigationBar(
backgroundColor: theme.colors.backgroundSecondary,
unselectedItemColor: theme.colors.text,
selectedItemColor: theme.colors.orange,
currentIndex: tabsRouter.activeIndex,
onTap: tabsRouter.setActiveIndex,
Expand Down
31 changes: 20 additions & 11 deletions lib/pages/tabs/withdrawal_tab_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get_it/get_it.dart';
import 'package:sail_ui/sail_ui.dart';
import 'package:sail_ui/widgets/core/sail_text.dart';
import 'package:sidesail/logger.dart';
import 'package:sidesail/rpc/rpc.dart';
import 'package:sidesail/withdrawals.dart';
Expand All @@ -30,7 +31,7 @@ class WithdrawalTabPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
SailText.primary14(
'Your sidechain balance: ${viewModel.sidechainBalance} SCO',
),
const SizedBox(height: 20),
Expand Down Expand Up @@ -88,9 +89,9 @@ class WithdrawalTabPage extends StatelessWidget {
const SizedBox(height: 20),
Row(
children: [
const Text('Total cost:'),
SailText.primary14('Total cost:'),
const SizedBox(width: 10),
Text(
SailText.primary14(
'${(viewModel.withdrawalAmount + viewModel.mainchainFee + viewModel.transactionFee)} SCO',
),
],
Expand All @@ -100,7 +101,9 @@ class WithdrawalTabPage extends StatelessWidget {
onPressed: () {
viewModel.onWithdraw(context);
},
child: const Text('Withdraw'),
child: SailText.primary14(
'Withdraw',
),
),
// TODO: this just caps the table...
const SingleChildScrollView(
Expand Down Expand Up @@ -191,14 +194,16 @@ class WithdrawalTabPageViewModel extends MultipleFutureViewModel {
await showDialog(
context: context,
builder: (context) => AlertDialog(
title: const Text('Confirm withdrawal'),
content: Text(
title: SailText.primary14(
'Confirm withdrawal',
),
content: SailText.primary14(
'Confirm withdrawal: $withdrawalAmount BTC to $address for $transactionFee SC fee and $mainchainFee MC fee',
),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: const Text('Cancel'),
child: SailText.primary14('Cancel'),
),
TextButton(
onPressed: () {
Expand All @@ -214,7 +219,9 @@ class WithdrawalTabPageViewModel extends MultipleFutureViewModel {
transactionFee,
);
},
child: const Text('OK'),
child: SailText.primary14(
'OK',
),
),
],
),
Expand Down Expand Up @@ -251,14 +258,16 @@ class WithdrawalTabPageViewModel extends MultipleFutureViewModel {
await showDialog(
context: context,
builder: (context) => AlertDialog(
title: const Text('Success'),
content: Text(
title: SailText.primary14(
'Success',
),
content: SailText.primary14(
'Submitted withdrawal successfully! TXID: $withdrawalTxid',
),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: const Text('OK'),
child: SailText.primary14('OK'),
),
],
),
Expand Down
17 changes: 9 additions & 8 deletions lib/withdrawals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:async';
import 'package:dart_coin_rpc/dart_coin_rpc.dart';
import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
import 'package:sail_ui/widgets/core/sail_text.dart';
import 'package:sidesail/logger.dart';
import 'package:sidesail/rpc/rpc.dart';

Expand Down Expand Up @@ -133,14 +134,14 @@ class WithdrawalTableView extends StatelessWidget {
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: DataTable(
columns: const [
DataColumn(label: Text('ID')),
DataColumn(label: Text('Destination')),
DataColumn(label: Text('Refund Destination')),
DataColumn(label: Text('Amount')),
DataColumn(label: Text('Main Chain Fee')),
DataColumn(label: Text('Status')),
DataColumn(label: Text('Hash Blind Tx')),
columns: [
DataColumn(label: SailText.primary12('ID')),
DataColumn(label: SailText.primary12('Destination')),
DataColumn(label: SailText.primary12('Refund Destination')),
DataColumn(label: SailText.primary12('Amount')),
DataColumn(label: SailText.primary12('Main Chain Fee')),
DataColumn(label: SailText.primary12('Status')),
DataColumn(label: SailText.primary12('Hash Blind Tx')),
],
rows: withdrawals.map((transaction) {
return DataRow(
Expand Down

0 comments on commit 1bba387

Please sign in to comment.