fix: Remove a tag childs from NextJS link components

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-11-06 16:15:57 +01:00 committed by David Mehren
parent cb74cb21ed
commit 7f7f020d91
7 changed files with 39 additions and 54 deletions

View file

@ -32,10 +32,7 @@ export const Redirect: React.FC<RedirectProps> = ({ to }) => {
return (
<span {...testId('redirect')}>
Redirecting to{' '}
<Link href={to}>
<a>{to}</a>
</Link>
Redirecting to <Link href={to}>{to}</Link>
</span>
)
}

View file

@ -23,14 +23,12 @@ export const NavbarBranding: React.FC = () => {
return (
<Navbar.Brand>
<Link href='/intro'>
<a className='text-secondary text-decoration-none d-flex align-items-center'>
<HedgeDocLogoWithText
logoType={darkModeActivated ? HedgeDocLogoType.WB_HORIZONTAL : HedgeDocLogoType.BW_HORIZONTAL}
size={HedgeDocLogoSize.SMALL}
/>
<Branding inline={true} />
</a>
<Link href='/intro' className='text-secondary text-decoration-none d-flex align-items-center'>
<HedgeDocLogoWithText
logoType={darkModeActivated ? HedgeDocLogoType.WB_HORIZONTAL : HedgeDocLogoType.BW_HORIZONTAL}
size={HedgeDocLogoSize.SMALL}
/>
<Branding inline={true} />
</Link>
</Navbar.Brand>
)

View file

@ -19,16 +19,14 @@ export const ReadOnlyModeButton: React.FC = () => {
const noteIdentifier = useApplicationState((state) => state.noteDetails.primaryAddress)
return (
<Link href={`/s/${noteIdentifier}`}>
<a target='_blank'>
<Button
title={t('editor.documentBar.readOnlyMode')}
className='ms-2 text-secondary'
size='sm'
variant='outline-light'>
<ForkAwesomeIcon icon='file-text-o' />
</Button>
</a>
<Link href={`/s/${noteIdentifier}`} target='_blank'>
<Button
title={t('editor.documentBar.readOnlyMode')}
className='ms-2 text-secondary'
size='sm'
variant='outline-light'>
<ForkAwesomeIcon icon='file-text-o' />
</Button>
</Link>
)
}

View file

@ -19,16 +19,14 @@ export const SlideModeButton: React.FC = () => {
const noteIdentifier = useApplicationState((state) => state.noteDetails.primaryAddress)
return (
<Link href={`/p/${noteIdentifier}`}>
<a target='_blank'>
<Button
title={t('editor.documentBar.slideMode')}
className='ms-2 text-secondary'
size='sm'
variant='outline-light'>
<ForkAwesomeIcon icon='television' />
</Button>
</a>
<Link href={`/p/${noteIdentifier}`} target='_blank'>
<Button
title={t('editor.documentBar.slideMode')}
className='ms-2 text-secondary'
size='sm'
variant='outline-light'>
<ForkAwesomeIcon icon='television' />
</Button>
</Link>
)
}

View file

@ -64,22 +64,20 @@ export const HistoryCard: React.FC<HistoryEntryProps & HistoryEventHandlers> = (
<div className={'d-flex flex-column'}>
<PinButton isDark={false} isPinned={entry.pinStatus} onPinClick={onPinEntry} />
</div>
<Link href={`/n/${entry.identifier}`}>
<a className='text-decoration-none flex-fill text-dark'>
<div className={'d-flex flex-column justify-content-between'}>
<Card.Title className='m-0 mt-1dot5' {...cypressId('history-entry-title')}>
{entryTitle}
</Card.Title>
<div>
<div className='text-black-50 mt-2'>
<ForkAwesomeIcon icon='clock-o' /> {DateTime.fromISO(entry.lastVisitedAt).toRelative()}
<br />
{lastVisited}
</div>
<div className={`${styles['card-footer-min-height']} p-0`}>{tags}</div>
<Link href={`/n/${entry.identifier}`} className='text-decoration-none flex-fill text-dark'>
<div className={'d-flex flex-column justify-content-between'}>
<Card.Title className='m-0 mt-1dot5' {...cypressId('history-entry-title')}>
{entryTitle}
</Card.Title>
<div>
<div className='text-black-50 mt-2'>
<ForkAwesomeIcon icon='clock-o' /> {DateTime.fromISO(entry.lastVisitedAt).toRelative()}
<br />
{lastVisited}
</div>
<div className={`${styles['card-footer-min-height']} p-0`}>{tags}</div>
</div>
</a>
</div>
</Link>
<div className={'d-flex flex-column'}>
<EntryMenu

View file

@ -45,10 +45,8 @@ export const HistoryTableRow: React.FC<HistoryEntryProps & HistoryEventHandlers>
return (
<tr>
<td>
<Link href={`/n/${entry.identifier}`}>
<a className='text-light' {...cypressId('history-entry-title')}>
{entryTitle}
</a>
<Link href={`/n/${entry.identifier}`} className='text-light' {...cypressId('history-entry-title')}>
{entryTitle}
</Link>
</td>
<td>{formatHistoryDate(entry.lastVisitedAt)}</td>

View file

@ -33,10 +33,8 @@ export const HeaderNavLink: React.FC<PropsWithChildren<HeaderNavLinkProps>> = ({
return (
<Nav.Item>
<Link href={to} passHref={true}>
<a className={`nav-link text-light ${activeClass} ${styles['nav-link']}`} href={to} {...cypressId(props)}>
{children}
</a>
<Link href={to} className={`nav-link text-light ${activeClass} ${styles['nav-link']}`} {...cypressId(props)}>
{children}
</Link>
</Nav.Item>
)