Skip to content

Commit 1aee2f4

Browse files
committed
feat(content_management): navigate to respective archived pages
- Update archived items button to navigate to different archived pages based on the active tab in ContentManagementBloc - Replace single navigation route with conditional navigation to archivedHeadlines, archivedTopics, or archivedSources based on the active tab
1 parent ac2bd91 commit 1aee2f4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/content_management/view/content_management_page.dart

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,16 @@ class _ContentManagementPageState extends State<ContentManagementPage>
9696
icon: const Icon(Icons.inventory_2_outlined),
9797
tooltip: 'Archived Items', // TODO(you): Will be fixed in l10n phase.
9898
onPressed: () {
99-
context.goNamed(Routes.archivedContentName);
99+
final currentTab =
100+
context.read<ContentManagementBloc>().state.activeTab;
101+
switch (currentTab) {
102+
case ContentManagementTab.headlines:
103+
context.goNamed(Routes.archivedHeadlinesName);
104+
case ContentManagementTab.topics:
105+
context.goNamed(Routes.archivedTopicsName);
106+
case ContentManagementTab.sources:
107+
context.goNamed(Routes.archivedSourcesName);
108+
}
100109
},
101110
),
102111
IconButton(

0 commit comments

Comments
 (0)