Skip to content

Commit

Permalink
(tokenomics) feat: migrate donate to govern
Browse files Browse the repository at this point in the history
  • Loading branch information
Atatakai authored and Atatakai committed Aug 27, 2024
1 parent 3d02ea9 commit a3e7656
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
35 changes: 22 additions & 13 deletions apps/tokenomics/components/Layout/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,21 @@ import PropTypes from 'prop-types';
import { useEffect, useState } from 'react';
import styled from 'styled-components';



import { COLOR } from 'libs/ui-theme/src';



import { useHelpers } from 'common-util/hooks/useHelpers';



import Login from '../Login';
import Footer from './Footer';
import { CustomLayout, DocsLink, Logo } from './styles';


const wallets = [new PhantomWalletAdapter()];
const LogoSvg = dynamic(() => import('common-util/SVGs/logo'));

Expand Down Expand Up @@ -45,21 +52,23 @@ const Layout = ({ children }) => {
useEffect(() => {
if (router.pathname) {
const name = router.pathname.split('/')[1];
setSelectedMenu(name || 'veolas');
setSelectedMenu(name || 'dev-incentives');
}
}, [router.pathname]);

const handleMenuItemClick = ({ key }) => {
if (key === 'docs') {
window.open('https://docs.autonolas.network/protocol/tokenomics/', '_blank');
} else if (key === 'bonding-products') {
window.open('https://bond.olas.network/bonding-products', '_blank');
} else if (key === 'my-bonds') {
window.open('https://bond.olas.network/my-bonds', '_blank');
} else {
router.push(`/${key}`);
setSelectedMenu(key);
}
if (key === 'donate') {
window.open('https://govern.olas.network/donate', '_blank');
} else if (key === 'docs') {
window.open('https://docs.autonolas.network/protocol/tokenomics/', '_blank');
} else if (key === 'bonding-products') {
window.open('https://bond.olas.network/bonding-products', '_blank');
} else if (key === 'my-bonds') {
window.open('https://bond.olas.network/my-bonds', '_blank');
} else {
router.push(`/${key}`);
setSelectedMenu(key);
}
};

return (
Expand All @@ -80,8 +89,8 @@ const Layout = ({ children }) => {
selectedKeys={[selectedMenu]}
onClick={handleMenuItemClick}
items={[
{ key: 'donate', label: 'Donate' },
{ key: 'dev-incentives', label: 'Dev Rewards' },
{ key: 'donate', label: <ExternalLink name="Donate" /> },
{ key: 'bonding-products', label: <ExternalLink name="Bonding Products" /> },
{ key: 'my-bonds', label: <ExternalLink name="My Bonds" /> },
{
Expand Down Expand Up @@ -120,4 +129,4 @@ const LayoutWithWalletProvider = (props) => (

LayoutWithWalletProvider.propTypes = { children: PropTypes.element };
LayoutWithWalletProvider.defaultProps = { children: null };
export default LayoutWithWalletProvider;
export default LayoutWithWalletProvider;
7 changes: 6 additions & 1 deletion apps/tokenomics/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ const nextConfig = {
return [
{
source: '/',
destination: '/donate',
destination: '/dev-incentives',
permanent: false,
},
{
source: '/donate',
destination: 'https://govern.olas.network/donate',
permanent: true,
},
{
source: '/bonding-products',
Expand Down

0 comments on commit a3e7656

Please sign in to comment.