Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: voting tab not available on test networks [LW-11910] #3246

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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