This repository has been archived by the owner on Jan 24, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed55623
commit 8c8005d
Showing
33 changed files
with
233 additions
and
365 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,21 +1 @@ | ||
import * as React from 'react' | ||
import { useCallback } from 'react' | ||
import { Link as BaseLink, LinkProps, LinkGetProps } from '@reach/router' | ||
import { omit } from 'lodash/fp' | ||
|
||
export { LinkProps } | ||
export const Link = React.forwardRef<any, LinkProps<any>>( | ||
(defaultProps, ref) => { | ||
const props = omit(['activeClassName', 'partiallyActive'], defaultProps) | ||
const isActive = useCallback( | ||
({ isCurrent }: LinkGetProps) => { | ||
return isCurrent ? { className: `${props.className} active` } : {} | ||
}, | ||
[props.className] | ||
) | ||
|
||
return <BaseLink {...props} getProps={isActive} ref={ref} /> | ||
} | ||
) | ||
|
||
Link.displayName = 'Link' | ||
export { Link, GatsbyLinkProps as LinkProps } from 'gatsby' |
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { useContext } from 'react' | ||
import { get } from 'lodash/fp' | ||
|
||
import { doczState } from '../state' | ||
|
||
export const useCurrentDoc = () => { | ||
if (typeof window === 'undefined') return null | ||
const state = useContext(doczState.context) | ||
return get('currentEntry.value', state) | ||
} |
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
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
Oops, something went wrong.