From ab36c89937e02d35756a0552a44bd32a91831ab2 Mon Sep 17 00:00:00 2001 From: Alexandre Magno Date: Tue, 19 Nov 2024 13:19:10 +0100 Subject: [PATCH] Update topbar-menu.tsx (#1153) fixes #1042 --- .../src/components/topbar/topbar-menu.tsx | 108 ++++-------------- 1 file changed, 23 insertions(+), 85 deletions(-) diff --git a/frontend/src/components/topbar/topbar-menu.tsx b/frontend/src/components/topbar/topbar-menu.tsx index d128edc27..172491fb3 100644 --- a/frontend/src/components/topbar/topbar-menu.tsx +++ b/frontend/src/components/topbar/topbar-menu.tsx @@ -1,4 +1,3 @@ - import React from 'react'; import { FormattedMessage } from 'react-intl'; import { @@ -11,94 +10,33 @@ export const TopbarMenu = ({ history }) => { - const handleHowItWorks = () => { - window.location.assign('/#/welcome') - } - - const handlePricing = () => { - window.location.assign('/#/pricing') - } - - const handleTeamLink = () => { - window.location.assign('/#/team') - } - - const handleDocsLink = () => { - window.open('https://docs.gitpay.me/en') - } - - const handleViewTasks = () => { - window.location.assign('/#/tasks/open') - } + const menuItems = [ + { onClick: () => window.location.assign('/#/welcome'), id: 'topbar.link.about', defaultMessage: 'About us' }, + { onClick: () => window.location.assign('/#/pricing'), id: 'topbar.link.prices', defaultMessage: 'Prices' }, + { onClick: () => window.location.assign('/#/team'), id: 'task.actions.team', defaultMessage: 'Team' }, + { onClick: () => window.open('https://docs.gitpay.me/en'), id: 'task.actions.docs', defaultMessage: 'Documentation' }, + { onClick: () => window.location.assign('/#/tasks/open'), id: 'topbar.link.explore', defaultMessage: 'Explore' } + ]; return ( <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + {menuItems.map((item, index) => ( + + + + + + ))} ) } -export default TopbarMenu \ No newline at end of file +export default TopbarMenu