-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
4 changed files
with
89 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.ApiLink { | ||
color: blue; | ||
text-decoration: underline; | ||
background-color: transparent; | ||
border: none; | ||
padding: 0; | ||
cursor: pointer; | ||
} |
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,26 @@ | ||
import './ApiLink.css'; | ||
|
||
/** | ||
* Links to a section of the student API documentation, opening the help window or just jumping to | ||
* the appropriate section if the window is already open. The single text node child of this | ||
* component is used as the link text. | ||
* @param props.dest - the section of the docs to jump to. TODO: figure out format | ||
* @param props.code - whether to display the link text in a monospaced font. | ||
*/ | ||
export default function ApiLink({ | ||
dest, | ||
code = false, | ||
children, | ||
}: { | ||
dest: string; | ||
code: boolean; | ||
children: string; | ||
}) { | ||
const text = `(${children})[${dest}]`; | ||
// Placeholder | ||
return ( | ||
<button type="button" className="ApiLink"> | ||
{code ? <code>{text}</code> : text} | ||
</button> | ||
); | ||
} |
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