Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change "docs/home" to "docs" #1257

Merged
merged 9 commits into from
May 7, 2020
Prev Previous commit
Next Next commit
remove unnecessary falsy checks
rogermparent committed May 7, 2020
commit 98dfc1734a361b0692d34ef2eb00e9cbcc08531d
4 changes: 2 additions & 2 deletions src/components/Link/index.tsx
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ export type ILinkProps = {

const PROTOCOL_REGEXP = /^https?:\/\//
const isRelative = (url: string): boolean => !PROTOCOL_REGEXP.test(url)
const isMailto = (url: string): boolean => url && url.startsWith('mailto:')
const isMailto = (url: string): boolean => url.startsWith('mailto:')

const ResultLinkComponent: React.FC<ILinkProps> = ({
href,
@@ -83,7 +83,7 @@ const Link: React.FC<ILinkProps> = ({ href, ...restProps }) => {

const location = new URL(href)
// Navigate from @reach/router handles hash links incorrectly. Fix it
if (href && href.startsWith('#')) {
if (href.startsWith('#')) {
href = currentLocation.pathname + href
}