Skip to content

Commit 5a323f9

Browse files
committed
Link fix for #193
1 parent efd9ec4 commit 5a323f9

File tree

2 files changed

+16
-20
lines changed

2 files changed

+16
-20
lines changed

saas/app/components/common/MenuWithLinks.tsx

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Menu from '@mui/material/Menu';
22
import MenuItem from '@mui/material/MenuItem';
33
import Link from 'next/link';
4-
import { NextRouter, withRouter } from 'next/router';
4+
import Router, { NextRouter, withRouter } from 'next/router';
55
import React from 'react';
66

77
type Props = {
@@ -66,17 +66,16 @@ class MenuWithLinks extends React.PureComponent<Props, State> {
6666
{option.text}
6767
</MenuItem>
6868
) : (
69-
<Link key={option.href} href={option.href} as={option.as} passHref>
70-
<MenuItem
71-
key={option.href}
72-
style={{
73-
fontWeight: router.asPath.includes(option.highlighterSlug) ? 600 : 300,
74-
fontSize: '14px',
75-
}}
76-
>
77-
{option.text}
78-
</MenuItem>
79-
</Link>
69+
<MenuItem
70+
key={option.href}
71+
style={{
72+
fontWeight: router.asPath.includes(option.highlighterSlug) ? 600 : 300,
73+
fontSize: '14px',
74+
}}
75+
onClick={() => Router.push(option.href, option.as)}
76+
>
77+
{option.text}
78+
</MenuItem>
8079
),
8180
)}
8281
</Menu>

saas/app/components/discussions/DiscussionListItem.tsx

+5-8
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,12 @@ class DiscussionListItem extends React.Component<Props> {
4747
scroll={false}
4848
href={`/discussion?teamSlug=${team.slug}&discussionSlug=${discussion.slug}`}
4949
as={`/teams/${team.slug}/discussions/${discussion.slug}`}
50+
style={{ fontWeight: 300, color: isThemeDark ? '#fff' : '#000' }}
51+
key={discussion._id}
5052
>
51-
<a
52-
style={{ fontWeight: 300, color: isThemeDark ? '#fff' : '#000' }}
53-
key={discussion._id}
54-
>
55-
{discussion.name.length > trimmingLength
56-
? `${discussion.name.substring(0, trimmingLength)}...`
57-
: discussion.name}
58-
</a>
53+
{discussion.name.length > trimmingLength
54+
? `${discussion.name.substring(0, trimmingLength)}...`
55+
: discussion.name}
5956
</Link>
6057
<div
6158
style={{

0 commit comments

Comments
 (0)