Skip to content

Commit

Permalink
Sidebar updates, make clean for aave gov + snapshot gov combined
Browse files Browse the repository at this point in the history
  • Loading branch information
zakhap committed Jul 15, 2021
1 parent a150732 commit f4f219c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion client/scripts/views/components/sidebar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ export const OnchainNavigationModule: m.Component<{}, {}> = {
const showAaveOptions = app.user.activeAccount && app.chain?.network === ChainNetwork.Aave;

const onSnapshotProposal = (p) => p.startsWith(`/${app.activeId()}/snapshot-proposals`);
const onSnapshotProposalCreation = (p) => p.startsWith(`/${app.activeId()}/new/snapshot-proposal/`);

const onProposalPage = (p) => (
p.startsWith(`/${app.activeChainId()}/proposals`)
|| p.startsWith(`/${app.activeChainId()}/proposal/democracyproposal`));
Expand Down Expand Up @@ -346,7 +348,7 @@ export const OnchainNavigationModule: m.Component<{}, {}> = {
e.preventDefault();
m.route.set(`/${app.activeChainId()}/new/proposal/:type`, { type: ProposalType.AaveProposal });
},
label: 'Submit Proposal',
label: 'Submit On-Chain P...',
active: m.route.get() === `/${app.activeChainId()}/new/proposal/${ProposalType.AaveProposal}`,
}),
showMolochMemberOptions && m(Button, {
Expand Down Expand Up @@ -393,6 +395,7 @@ export const OnchainNavigationModule: m.Component<{}, {}> = {
},
label: 'Approve tokens',
}),
m('.sidebar-spacer'),
app.chain?.meta.chain.snapshot !== null
&& m(Button, {
rounded: true,
Expand All @@ -404,6 +407,17 @@ export const OnchainNavigationModule: m.Component<{}, {}> = {
m.route.set(`/${app.activeChainId()}/snapshot-proposals/${app.chain.meta.chain.snapshot}`);
},
}),
app.chain?.meta.chain.snapshot !== null && app.user.activeAccount
&& m(Button, {
rounded: true,
fluid: true,
active: onSnapshotProposalCreation(m.route.get()),
label: 'New Snapshot Pr...',
onclick: (e) => {
e.preventDefault();
m.route.set(`/${app.activeChainId()}/new/snapshot-proposal/${app.chain.meta.chain.snapshot}`);
},
}),
showCommonwealthMenuOptions && m(Button, {
fluid: true,
rounded: true,
Expand Down

0 comments on commit f4f219c

Please sign in to comment.