-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1426 from turnerran/main
Removed some redundant code
- Loading branch information
Showing
5 changed files
with
24 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import React from 'react'; | ||
import React from 'react' | ||
|
||
function CustomSidebarItem({ item }) { | ||
const handleClick = () => { | ||
if (customProps && customProps.trackingEvent) { | ||
fathom.trackGoal(customProps.trackingEvent, 0); | ||
if (customProps?.trackingEvent) { | ||
fathom.trackGoal(customProps.trackingEvent, 0) | ||
} | ||
}; | ||
} | ||
|
||
return ( | ||
<a className="menu__link" href={item.href} onClick={handleClick}> | ||
{item.label} | ||
</a> | ||
); | ||
) | ||
} | ||
|
||
export default CustomSidebarItem; | ||
export default CustomSidebarItem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
import React from 'react'; | ||
import DocSidebarItem from '@theme-original/DocSidebarItem'; | ||
import React from 'react' | ||
import DocSidebarItem from '@theme-original/DocSidebarItem' | ||
|
||
export default function DocSidebarItemWrapper(props) { | ||
const handleClick = (customProps) => { | ||
if (customProps && customProps.trackingEvent) { | ||
fathom.trackGoal(customProps.trackingEvent, 0); | ||
if (customProps?.trackingEvent) { | ||
fathom.trackGoal(customProps.trackingEvent, 0) | ||
} | ||
}; | ||
} | ||
|
||
return ( | ||
<div onClick={() => handleClick(props.item.customProps)}> | ||
<DocSidebarItem {...props} /> | ||
</div> | ||
); | ||
) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import React from 'react'; | ||
import NavbarNavLink from '@theme-original/NavbarItem/NavbarNavLink'; | ||
import React from 'react' | ||
import NavbarNavLink from '@theme-original/NavbarItem/NavbarNavLink' | ||
|
||
export default function NavbarNavLinkWrapper(props) { | ||
const handleClick = (customProps) => { | ||
if (customProps && customProps.trackingEvent) { | ||
fathom.trackGoal(customProps.trackingEvent, 0); | ||
if (customProps?.trackingEvent) { | ||
fathom.trackGoal(customProps.trackingEvent, 0) | ||
} | ||
}; | ||
} | ||
|
||
return ( | ||
<div onClick={() => handleClick(props.customProps)}> | ||
<NavbarNavLink {...props} /> | ||
</div> | ||
); | ||
) | ||
} |