Skip to content

Commit f9f2acb

Browse files
Merge branch 'master' into fix-missing-button-paddings
2 parents 17e7908 + 2afc658 commit f9f2acb

File tree

10 files changed

+587
-727
lines changed

10 files changed

+587
-727
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2424
### Deprecated
2525

2626
### Removed
27+
- Removed relay pull-to-refresh
2728

2829
### Fixed
2930
- Fixed get user logic, to show metadata when searching a new npub
@@ -34,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3435
- Fixes scroll to bototm inside of chats
3536
- Fixed profile image not showing up chatlist after login
3637
- Fixes auto-scroll to bottom when keyboard opens
38+
- Fixed time shown in messages to be in local time instead of UTC
3739

3840
### Security
3941

lib/config/providers/chat_provider.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class ChatNotifier extends Notifier<ChatState> {
167167
id: sentMessage.id,
168168
pubkey: sentMessage.pubkey,
169169
content: sentMessage.content ?? '',
170-
createdAt: sentMessage.createdAt,
170+
createdAt: sentMessage.createdAt.toLocal(),
171171
tags: const [],
172172
isReply: false,
173173
replyToId: null,
@@ -611,7 +611,7 @@ class ChatNotifier extends Notifier<ChatState> {
611611
id: sentMessage.id,
612612
pubkey: sentMessage.pubkey,
613613
content: sentMessage.content ?? '',
614-
createdAt: sentMessage.createdAt,
614+
createdAt: sentMessage.createdAt.toLocal(),
615615
tags: const [],
616616
isReply: true,
617617
replyToId: replyToMessageId,

lib/ui/chat/services/chat_dialog_service.dart

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import 'package:whitenoise/ui/chat/widgets/reaction/reaction_hero_dialog_route.d
1111
import 'package:whitenoise/ui/chat/widgets/reaction/reactions_dialog_widget.dart';
1212
import 'package:whitenoise/ui/core/themes/src/extensions.dart';
1313
import 'package:whitenoise/ui/core/ui/wn_bottom_sheet.dart';
14+
import 'package:whitenoise/utils/clipboard_utils.dart';
1415

1516
class ChatDialogService {
1617
static void showEmojiBottomSheet({
@@ -124,12 +125,10 @@ class ChatDialogService {
124125
if (menuItem.label == 'Reply') {
125126
chatNotifier.handleReply(message);
126127
} else if (menuItem.label == 'Copy') {
127-
Clipboard.setData(ClipboardData(text: message.content ?? ''));
128-
ScaffoldMessenger.of(context).showSnackBar(
129-
const SnackBar(
130-
content: Text('Message copied to clipboard'),
131-
duration: Duration(seconds: 2),
132-
),
128+
ClipboardUtils.copyWithToast(
129+
ref: ref,
130+
textToCopy: message.content ?? '',
131+
successMessage: 'Message copied to clipboard',
133132
);
134133
} else if (menuItem.label == 'Delete') {
135134
chatNotifier.deleteMessage(

lib/ui/contact_list/widgets/profile_ready_card.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ class ProfileReadyCard extends ConsumerWidget {
8888
),
8989
),
9090
Gap(24.h),
91-
// Share Your Profile button
9291
WnFilledButton(
9392
label: 'Share Your Profile',
9493
onPressed: () => context.push('${Routes.settings}/share_profile'),
@@ -100,8 +99,7 @@ class ProfileReadyCard extends ConsumerWidget {
10099
color: context.colors.primary,
101100
),
102101
),
103-
Gap(12.h),
104-
// Search For Friends button
102+
Gap(8.h),
105103
WnFilledButton(
106104
label: 'Search For Friends',
107105
onPressed: () {

lib/ui/settings/app_settings/app_settings_screen.dart

Lines changed: 72 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
55
import 'package:gap/gap.dart';
66
import 'package:go_router/go_router.dart';
77
import 'package:logging/logging.dart';
8+
import 'package:whitenoise/config/extensions/toast_extension.dart';
89
import 'package:whitenoise/config/providers/active_account_provider.dart';
910
import 'package:whitenoise/config/providers/active_pubkey_provider.dart';
1011
import 'package:whitenoise/config/providers/auth_provider.dart';
@@ -17,6 +18,7 @@ import 'package:whitenoise/routing/routes.dart';
1718
import 'package:whitenoise/src/rust/api.dart' as wn_api;
1819
import 'package:whitenoise/ui/core/themes/assets.dart';
1920
import 'package:whitenoise/ui/core/themes/src/extensions.dart';
21+
import 'package:whitenoise/ui/core/ui/wn_app_bar.dart';
2022
import 'package:whitenoise/ui/core/ui/wn_button.dart';
2123
import 'package:whitenoise/ui/core/ui/wn_dialog.dart';
2224
import 'package:whitenoise/ui/core/ui/wn_image.dart';
@@ -161,12 +163,7 @@ class AppSettingsScreen extends ConsumerWidget {
161163
if (!context.mounted) return;
162164

163165
Navigator.of(context).pop(); // Close loading dialog
164-
ScaffoldMessenger.of(context).showSnackBar(
165-
SnackBar(
166-
content: Text('Failed to delete data: $e'),
167-
duration: const Duration(seconds: 5),
168-
),
169-
);
166+
ref.showErrorToast('Failed to delete data: $e', durationMs: 5000);
170167
}
171168
}
172169

@@ -181,81 +178,85 @@ class AppSettingsScreen extends ConsumerWidget {
181178
statusBarBrightness: Brightness.dark,
182179
),
183180
child: Scaffold(
184-
backgroundColor: context.colors.appBarBackground,
181+
backgroundColor: context.colors.neutral,
182+
appBar: WnAppBar(
183+
automaticallyImplyLeading: false,
184+
leading: RepaintBoundary(
185+
child: IconButton(
186+
onPressed: () => context.pop(),
187+
icon: WnImage(
188+
AssetsPaths.icChevronLeft,
189+
width: 24.w,
190+
height: 24.w,
191+
color: context.colors.solidPrimary,
192+
),
193+
),
194+
),
195+
title: RepaintBoundary(
196+
child: Text(
197+
'App Settings',
198+
style: TextStyle(
199+
fontSize: 18.sp,
200+
fontWeight: FontWeight.w600,
201+
color: context.colors.solidPrimary,
202+
),
203+
),
204+
),
205+
),
185206
body: SafeArea(
186207
bottom: false,
187208
child: ColoredBox(
188209
color: context.colors.neutral,
189210
child: Column(
190211
children: [
191-
Gap(24.h),
192-
Row(
193-
children: [
194-
IconButton(
195-
onPressed: () => context.pop(),
196-
icon: WnImage(
197-
AssetsPaths.icChevronLeft,
198-
width: 24.w,
199-
height: 24.w,
200-
color: context.colors.primary,
201-
),
202-
),
203-
Text(
204-
'App Settings',
205-
style: TextStyle(
206-
fontSize: 18.sp,
207-
fontWeight: FontWeight.w600,
208-
color: context.colors.mutedForeground,
209-
),
210-
),
211-
],
212-
),
213-
Gap(29.h),
214212
Expanded(
215-
child: SingleChildScrollView(
216-
child: Padding(
217-
padding: EdgeInsets.only(
218-
left: 16.w,
219-
right: 16.w,
220-
bottom: 24.w,
221-
),
222-
child: Column(
223-
crossAxisAlignment: CrossAxisAlignment.start,
224-
children: [
225-
Text(
226-
'Theme',
227-
style: TextStyle(
228-
fontSize: 14.sp,
229-
fontWeight: FontWeight.w600,
230-
color: context.colors.primary,
213+
child: Padding(
214+
padding: EdgeInsets.symmetric(vertical: 24.h),
215+
child: SingleChildScrollView(
216+
child: Padding(
217+
padding: EdgeInsets.only(
218+
left: 16.w,
219+
right: 16.w,
220+
bottom: 24.w,
221+
),
222+
child: Column(
223+
crossAxisAlignment: CrossAxisAlignment.start,
224+
children: [
225+
Text(
226+
'Theme',
227+
style: TextStyle(
228+
fontSize: 14.sp,
229+
fontWeight: FontWeight.w600,
230+
color: context.colors.primary,
231+
),
232+
),
233+
Gap(10.h),
234+
_ThemeDropdown(
235+
currentTheme: themeMode,
236+
onThemeChanged: (newMode) {
237+
ref.read(themeProvider.notifier).setThemeMode(newMode);
238+
},
231239
),
232-
),
233-
Gap(10.h),
234-
_ThemeDropdown(
235-
currentTheme: themeMode,
236-
onThemeChanged: (newMode) {
237-
ref.read(themeProvider.notifier).setThemeMode(newMode);
238-
},
239-
),
240-
Gap(16.h),
241-
Text(
242-
'Danger Zone',
243-
style: TextStyle(
244-
fontSize: 14.sp,
245-
fontWeight: FontWeight.w600,
246-
color: context.colors.primary,
240+
Gap(16.h),
241+
Text(
242+
'Danger Zone',
243+
style: TextStyle(
244+
fontSize: 14.sp,
245+
fontWeight: FontWeight.w600,
246+
color: context.colors.primary,
247+
),
247248
),
248-
),
249-
Gap(10.h),
250-
WnFilledButton(
251-
label: 'Delete All Data',
252-
labelTextStyle: WnButtonSize.large.textStyle().copyWith(
253-
color: context.colors.solidNeutralWhite,
249+
Gap(10.h),
250+
WnFilledButton(
251+
label: 'Delete All Data',
252+
labelTextStyle: WnButtonSize.large.textStyle().copyWith(
253+
color: context.colors.solidNeutralWhite,
254+
),
255+
visualState: WnButtonVisualState.destructive,
256+
onPressed: () => _deleteAllData(context, ref),
254257
),
255-
visualState: WnButtonVisualState.destructive,
256-
onPressed: () => _deleteAllData(context, ref),
257-
),
258-
],
258+
],
259+
),
259260
),
260261
),
261262
),

0 commit comments

Comments
 (0)