Skip to content

Commit 17bf044

Browse files
committed
Merge remote-tracking branch 'origin/fix/desktop-auth-send-token-ticker' into vacay
2 parents 05f4181 + 6fca0f1 commit 17bf044

2 files changed

Lines changed: 53 additions & 83 deletions

File tree

lib/pages/send_view/confirm_transaction_view.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,10 @@ class _ConfirmTransactionViewState
15141514
right: 32,
15151515
bottom: 32,
15161516
),
1517-
child: DesktopAuthSend(coin: coin),
1517+
child: DesktopAuthSend(
1518+
coin: coin,
1519+
tokenTicker: widget.isTokenTx ? unit : null,
1520+
),
15181521
),
15191522
],
15201523
),

lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_auth_send.dart

Lines changed: 49 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ import '../../../../widgets/loading_indicator.dart';
2626
import '../../../../widgets/stack_text_field.dart';
2727

2828
class DesktopAuthSend extends ConsumerStatefulWidget {
29-
const DesktopAuthSend({
30-
super.key,
31-
required this.coin,
32-
});
29+
const DesktopAuthSend({super.key, required this.coin, this.tokenTicker});
3330

3431
final CryptoCurrency coin;
32+
final String? tokenTicker;
3533

3634
@override
3735
ConsumerState<DesktopAuthSend> createState() => _DesktopAuthSendState();
@@ -59,12 +57,7 @@ class _DesktopAuthSendState extends ConsumerState<DesktopAuthSend> {
5957
builder: (context) => const Column(
6058
mainAxisAlignment: MainAxisAlignment.center,
6159
crossAxisAlignment: CrossAxisAlignment.center,
62-
children: [
63-
LoadingIndicator(
64-
width: 200,
65-
height: 200,
66-
),
67-
],
60+
children: [LoadingIndicator(width: 200, height: 200)],
6861
),
6962
),
7063
);
@@ -77,15 +70,8 @@ class _DesktopAuthSendState extends ConsumerState<DesktopAuthSend> {
7770

7871
if (mounted) {
7972
Navigator.of(context).pop();
80-
Navigator.of(
81-
context,
82-
rootNavigator: true,
83-
).pop(passwordIsValid);
84-
await Future<void>.delayed(
85-
const Duration(
86-
milliseconds: 100,
87-
),
88-
);
73+
Navigator.of(context, rootNavigator: true).pop(passwordIsValid);
74+
await Future<void>.delayed(const Duration(milliseconds: 100));
8975
}
9076
} finally {
9177
_lock = false;
@@ -113,29 +99,17 @@ class _DesktopAuthSendState extends ConsumerState<DesktopAuthSend> {
11399
return Column(
114100
mainAxisSize: MainAxisSize.min,
115101
children: [
116-
SvgPicture.asset(
117-
Assets.svg.keys,
118-
width: 100,
119-
),
120-
const SizedBox(
121-
height: 56,
122-
),
102+
SvgPicture.asset(Assets.svg.keys, width: 100),
103+
const SizedBox(height: 56),
104+
Text("Confirm transaction", style: STextStyles.desktopH3(context)),
105+
const SizedBox(height: 16),
123106
Text(
124-
"Confirm transaction",
125-
style: STextStyles.desktopH3(context),
126-
),
127-
const SizedBox(
128-
height: 16,
129-
),
130-
Text(
131-
"Enter your wallet password to send ${widget.coin.ticker.toUpperCase()}",
107+
"Enter your wallet password to send ${widget.tokenTicker?.toUpperCase() ?? widget.coin.ticker.toUpperCase()}",
132108
style: STextStyles.desktopTextMedium(context).copyWith(
133109
color: Theme.of(context).extension<StackColors>()!.textDark3,
134110
),
135111
),
136-
const SizedBox(
137-
height: 24,
138-
),
112+
const SizedBox(height: 24),
139113
ClipRRect(
140114
borderRadius: BorderRadius.circular(
141115
Constants.size.circularBorderRadius,
@@ -144,9 +118,7 @@ class _DesktopAuthSendState extends ConsumerState<DesktopAuthSend> {
144118
key: const Key("desktopLoginPasswordFieldKey"),
145119
focusNode: passwordFocusNode,
146120
controller: passwordController,
147-
style: STextStyles.desktopTextMedium(context).copyWith(
148-
height: 2,
149-
),
121+
style: STextStyles.desktopTextMedium(context).copyWith(height: 2),
150122
obscureText: hidePassword,
151123
enableSuggestions: false,
152124
autocorrect: false,
@@ -156,55 +128,52 @@ class _DesktopAuthSendState extends ConsumerState<DesktopAuthSend> {
156128
_confirmPressed();
157129
}
158130
},
159-
decoration: standardInputDecoration(
160-
"Enter password",
161-
passwordFocusNode,
162-
context,
163-
).copyWith(
164-
suffixIcon: UnconstrainedBox(
165-
child: SizedBox(
166-
height: 70,
167-
child: Row(
168-
children: [
169-
const SizedBox(
170-
width: 24,
171-
),
172-
GestureDetector(
173-
key: const Key(
174-
"restoreFromFilePasswordFieldShowPasswordButtonKey",
175-
),
176-
onTap: () async {
177-
setState(() {
178-
hidePassword = !hidePassword;
179-
});
180-
},
181-
child: SvgPicture.asset(
182-
hidePassword ? Assets.svg.eye : Assets.svg.eyeSlash,
183-
color: Theme.of(context)
184-
.extension<StackColors>()!
185-
.textDark3,
186-
width: 24,
187-
height: 24,
188-
),
131+
decoration:
132+
standardInputDecoration(
133+
"Enter password",
134+
passwordFocusNode,
135+
context,
136+
).copyWith(
137+
suffixIcon: UnconstrainedBox(
138+
child: SizedBox(
139+
height: 70,
140+
child: Row(
141+
children: [
142+
const SizedBox(width: 24),
143+
GestureDetector(
144+
key: const Key(
145+
"restoreFromFilePasswordFieldShowPasswordButtonKey",
146+
),
147+
onTap: () async {
148+
setState(() {
149+
hidePassword = !hidePassword;
150+
});
151+
},
152+
child: SvgPicture.asset(
153+
hidePassword
154+
? Assets.svg.eye
155+
: Assets.svg.eyeSlash,
156+
color: Theme.of(
157+
context,
158+
).extension<StackColors>()!.textDark3,
159+
width: 24,
160+
height: 24,
161+
),
162+
),
163+
const SizedBox(width: 12),
164+
],
189165
),
190-
const SizedBox(
191-
width: 12,
192-
),
193-
],
166+
),
194167
),
195168
),
196-
),
197-
),
198169
onChanged: (newValue) {
199170
setState(() {
200171
_confirmEnabled = passwordController.text.isNotEmpty;
201172
});
202173
},
203174
),
204175
),
205-
const SizedBox(
206-
height: 48,
207-
),
176+
const SizedBox(height: 48),
208177
Row(
209178
children: [
210179
Expanded(
@@ -214,9 +183,7 @@ class _DesktopAuthSendState extends ConsumerState<DesktopAuthSend> {
214183
onPressed: Navigator.of(context).pop,
215184
),
216185
),
217-
const SizedBox(
218-
width: 16,
219-
),
186+
const SizedBox(width: 16),
220187
Expanded(
221188
child: PrimaryButton(
222189
enabled: _confirmEnabled,

0 commit comments

Comments
 (0)