This repository has been archived by the owner on Jul 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
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
c109e89
commit 0f64139
Showing
13 changed files
with
282 additions
and
321 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
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,25 +1,32 @@ | ||
// @flow | ||
import React from 'react'; | ||
import React, {forwardRef} from 'react'; | ||
import {Link, Tooltip} from '@material-ui/core'; | ||
import {testnetDefaultChannel} from '@solana/web3.js/package.json'; | ||
|
||
import useStyles from './styles'; | ||
|
||
const BOOK_VERSION = testnetDefaultChannel === 'edge' ? 'book-edge' : 'book'; | ||
|
||
const HelpLink = ({text, term}: {text: string, term: string}) => { | ||
const classes = useStyles(); | ||
return ( | ||
<Tooltip classes={{tooltip: classes.tooltip}} placement="top" title={text}> | ||
<Link | ||
className={classes.link} | ||
href={`https://solana-labs.github.io/${BOOK_VERSION}/terminology.html#${term}`} | ||
target="_new" | ||
const HelpLink = forwardRef( | ||
({text = '', term = ''}: {text: string, term: string}, ref) => { | ||
const classes = useStyles(); | ||
return ( | ||
<Tooltip | ||
classes={{tooltip: classes.tooltip}} | ||
placement="top" | ||
title={text} | ||
ref={ref} | ||
> | ||
? | ||
</Link> | ||
</Tooltip> | ||
); | ||
}; | ||
<Link | ||
className={classes.link} | ||
href={`https://solana-labs.github.io/${BOOK_VERSION}/terminology.html#${term}`} | ||
target="_new" | ||
> | ||
? | ||
</Link> | ||
</Tooltip> | ||
); | ||
}, | ||
); | ||
|
||
export default HelpLink; |
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.