Skip to content

Commit

Permalink
fix: avoid warning about nested a tags
Browse files Browse the repository at this point in the history
Link is rendering an a tag, and MenuItem does the same.
Use a redirect on click instead (already done in the print submenu)
  • Loading branch information
edoardo committed May 27, 2024
1 parent 4116c86 commit 7c89527
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/pages/view/TitleBar/ActionsBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import PropTypes from 'prop-types'
import React, { useState } from 'react'
import { connect } from 'react-redux'
import { Link, Redirect } from 'react-router-dom'
import { Redirect } from 'react-router-dom'
import { acSetDashboardStarred } from '../../../actions/dashboards.js'
import { acClearItemFilters } from '../../../actions/itemFilters.js'
import { acSetShowDescription } from '../../../actions/showDescription.js'
Expand Down Expand Up @@ -202,13 +202,12 @@ const ViewActions = ({
dataTest="print-oipp-menu-item"
/>
</MenuItem>
<Link to={ROUTE_START_PATH} className={classes.link}>
<MenuItem
dense
disabledWhenOffline={false}
label={i18n.t('Close dashboard')}
/>
</Link>
<MenuItem
dense
disabledWhenOffline={false}
label={i18n.t('Close dashboard')}
onClick={() => setRedirectUrl(ROUTE_START_PATH)}
/>
</FlyoutMenu>
)

Expand Down

0 comments on commit 7c89527

Please sign in to comment.