Skip to content

Commit 5f37728

Browse files
authored
Move instance modlog action to popup menu (#1180)
1 parent 204ba55 commit 5f37728

File tree

1 file changed

+31
-26
lines changed

1 file changed

+31
-26
lines changed

lib/feed/widgets/feed_page_app_bar.dart

+31-26
Original file line numberDiff line numberDiff line change
@@ -333,33 +333,38 @@ class FeedAppBarGeneralActions extends StatelessWidget {
333333
);
334334
},
335335
),
336-
IconButton(
337-
icon: Icon(Icons.shield_rounded, semanticLabel: l10n.modlog),
338-
onPressed: () async {
339-
HapticFeedback.mediumImpact();
336+
PopupMenuButton(
337+
itemBuilder: (context) => [
338+
ThunderPopupMenuItem(
339+
onTap: () async {
340+
HapticFeedback.mediumImpact();
340341

341-
AuthBloc authBloc = context.read<AuthBloc>();
342-
ThunderBloc thunderBloc = context.read<ThunderBloc>();
343-
344-
await Navigator.of(context).push(
345-
SwipeablePageRoute(
346-
transitionDuration: thunderBloc.state.reduceAnimations ? const Duration(milliseconds: 100) : null,
347-
backGestureDetectionStartOffset: !kIsWeb && Platform.isAndroid ? 45 : 0,
348-
backGestureDetectionWidth: 45,
349-
canOnlySwipeFromEdge:
350-
disableFullPageSwipe(isUserLoggedIn: authBloc.state.isLoggedIn, state: thunderBloc.state, isPostPage: false) || !thunderBloc.state.enableFullScreenSwipeNavigationGesture,
351-
builder: (otherContext) {
352-
return MultiBlocProvider(
353-
providers: [
354-
BlocProvider.value(value: feedBloc),
355-
BlocProvider.value(value: thunderBloc),
356-
],
357-
child: const ModlogFeedPage(),
358-
);
359-
},
360-
),
361-
);
362-
},
342+
AuthBloc authBloc = context.read<AuthBloc>();
343+
ThunderBloc thunderBloc = context.read<ThunderBloc>();
344+
345+
await Navigator.of(context).push(
346+
SwipeablePageRoute(
347+
transitionDuration: thunderBloc.state.reduceAnimations ? const Duration(milliseconds: 100) : null,
348+
backGestureDetectionStartOffset: !kIsWeb && Platform.isAndroid ? 45 : 0,
349+
backGestureDetectionWidth: 45,
350+
canOnlySwipeFromEdge:
351+
disableFullPageSwipe(isUserLoggedIn: authBloc.state.isLoggedIn, state: thunderBloc.state, isPostPage: false) || !thunderBloc.state.enableFullScreenSwipeNavigationGesture,
352+
builder: (otherContext) {
353+
return MultiBlocProvider(
354+
providers: [
355+
BlocProvider.value(value: feedBloc),
356+
BlocProvider.value(value: thunderBloc),
357+
],
358+
child: const ModlogFeedPage(),
359+
);
360+
},
361+
),
362+
);
363+
},
364+
icon: Icons.shield_rounded,
365+
title: l10n.modlog,
366+
),
367+
],
363368
),
364369
],
365370
);

0 commit comments

Comments
 (0)