Skip to content

Commit

Permalink
fix: enable voting tab for all networks [LW-11910]
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Guzei <[email protected]>
  • Loading branch information
DominikGuzei committed Nov 28, 2024
1 parent 97240f1 commit 6966cdb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion source/renderer/app/config/sidebarConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const CATEGORIES_BY_NAME = {
VOTING: {
name: 'VOTING',
icon: votingIcon,
route: ROUTES.VOTING.REGISTRATION,
route: ROUTES.VOTING.GOVERNANCE,
tooltipTextId: 'voting',
},
};
Expand Down
32 changes: 18 additions & 14 deletions source/renderer/app/containers/voting/Voting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,33 @@ class Voting extends Component<Props> {
const { app } = this.props.stores;
const { intl } = this.props;
const navItems: Array<NavButtonProps> = [
{
id: ROUTES.VOTING.REGISTRATION,
label: intl.formatMessage(messages.votingTabCatalyst),
},
{
id: ROUTES.VOTING.GOVERNANCE,
label: intl.formatMessage(messages.votingTabGovernance),
},
{
id: ROUTES.VOTING.REGISTRATION,
label: intl.formatMessage(messages.votingTabCatalyst),
},
];
const activeItem = navItems.find((item) => app.currentRoute === item.id);
return (
<MainLayout>
<div style={{ height: '50px' }}>
<Navigation
items={navItems}
activeItem={activeItem.label}
isActiveNavItem={(navItemId: string) => navItemId === activeItem.id}
onNavItemClick={(navItemId: string) => {
this.props.actions.router.goToRoute.trigger({
route: navItemId,
});
}}
/>
{environment.isMainnet || environment.isDev ? (
<Navigation
items={navItems}
activeItem={activeItem.label}
isActiveNavItem={(navItemId: string) =>
navItemId === activeItem.id
}
onNavItemClick={(navItemId: string) => {
this.props.actions.router.goToRoute.trigger({
route: navItemId,
});
}}
/>
) : null}
</div>
{this.props.children}
</MainLayout>
Expand Down
3 changes: 1 addition & 2 deletions source/renderer/app/stores/SidebarStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ export default class SidebarStore extends Store {
[categories.STAKING_DELEGATION_COUNTDOWN.name]: false,
[categories.STAKING.name]: true,
[categories.SETTINGS.name]: true,
[categories.VOTING.name]:
isMainnet || isDev || environment.votingVisibleOverride,
[categories.VOTING.name]: true,
[categories.NETWORK_INFO.name]: isFlight,
};
const categoriesFilteredList: Array<SidebarCategoryInfo> = list.filter(
Expand Down

0 comments on commit 6966cdb

Please sign in to comment.