Skip to content

Commit

Permalink
Change naming of attribute to use hard navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Mar 5, 2024
1 parent 4d97e23 commit b9ec8f4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/components/referral/CustomLink.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Link, { LinkProps } from 'next/link'
import { ComponentProps } from 'react'
import urlJoin from 'src/utils/url-join'
import { useReferralId } from './ReferralUrlChanger'

Expand All @@ -7,7 +8,7 @@ function getCurrentUrlOrigin() {
return window.location.origin
}

export default function CustomLink(props: React.PropsWithChildren<LinkProps>) {
export default function CustomLink(props: ComponentProps<typeof Link>) {
const refId = useReferralId()
if (refId) {
props = {
Expand Down
4 changes: 2 additions & 2 deletions src/layout/SideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { buildAuthorizedMenu, isDivider, PageLink } from './SideMenuItems'
import styles from './Sider.module.sass'

const renderPageLink = (item: PageLink) => {
const { icon, openInNewTab, toExternalLink } = item
const { icon, openInNewTab, forceHardNavigation } = item

if (item.hidden) {
return null
Expand All @@ -24,7 +24,7 @@ const renderPageLink = (item: PageLink) => {

return (
<Menu.Item className='DfMenuItem' key={item.href}>
{toExternalLink ? (
{forceHardNavigation ? (
<a {...anchorProps} href={item.href}>
<span className='MenuItemIcon'>{icon}</span>
<span className='MenuItemName'>{item.name}</span>
Expand Down
6 changes: 3 additions & 3 deletions src/layout/SideMenuItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type PageLink = {
icon: React.ReactNode
hidden?: boolean
openInNewTab?: boolean
toExternalLink?: boolean
forceHardNavigation?: boolean

// Helpers
isNotifications?: boolean
Expand All @@ -40,7 +40,7 @@ export const buildAuthorizedMenu = (myAddress?: string): MenuItem[] => {
name: 'Chat',
icon: <SubIcon Icon={BiChat} />,
href: '/c/chats',
toExternalLink: true,
forceHardNavigation: true,
},
...(myAddress
? [
Expand All @@ -56,7 +56,7 @@ export const buildAuthorizedMenu = (myAddress?: string): MenuItem[] => {
name: 'Content Staking',
icon: <SubIcon Icon={TbCoins} />,
href: '/c/staking',
toExternalLink: true,
forceHardNavigation: true,
},
{
name: 'Leaderboard',
Expand Down

0 comments on commit b9ec8f4

Please sign in to comment.