mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-21 22:34:21 +00:00
🔧 Open notebooks in a new tab (fix #80)
This commit is contained in:
parent
06301a6ad9
commit
0715f255fb
2 changed files with 6 additions and 6 deletions
|
@ -1,9 +1,9 @@
|
|||
import {faFlask} from "@fortawesome/free-solid-svg-icons"
|
||||
import {Button} from "@steffo/bluelib-react"
|
||||
import * as React from "react"
|
||||
import {useAuthorizationContext} from "../../contexts/authorization"
|
||||
import {useNotebookContext} from "../../contexts/notebook"
|
||||
import {IconText} from "../elements/IconText"
|
||||
import {NavigateButton} from "../elements/NavigateButton"
|
||||
|
||||
|
||||
export function NotebookLabButton(): JSX.Element | null {
|
||||
|
@ -28,10 +28,10 @@ export function NotebookLabButton(): JSX.Element | null {
|
|||
}
|
||||
|
||||
return (
|
||||
<NavigateButton href={notebook.value.lab_url} disabled={!canOpen}>
|
||||
<Button onClick={() => window.open(notebook.value.lab_url!)} disabled={!canOpen}>
|
||||
<IconText icon={faFlask}>
|
||||
Open JupyterLab
|
||||
</IconText>
|
||||
</NavigateButton>
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import {faBook} from "@fortawesome/free-solid-svg-icons"
|
||||
import {Button} from "@steffo/bluelib-react"
|
||||
import * as React from "react"
|
||||
import {useAuthorizationContext} from "../../contexts/authorization"
|
||||
import {useNotebookContext} from "../../contexts/notebook"
|
||||
import {IconText} from "../elements/IconText"
|
||||
import {NavigateButton} from "../elements/NavigateButton"
|
||||
|
||||
|
||||
export function NotebookLegacyButton(): JSX.Element | null {
|
||||
|
@ -28,10 +28,10 @@ export function NotebookLegacyButton(): JSX.Element | null {
|
|||
}
|
||||
|
||||
return (
|
||||
<NavigateButton href={notebook.value.legacy_notebook_url} disabled={!canOpen}>
|
||||
<Button onClick={() => window.open(notebook.value.legacy_notebook_url!)} disabled={!canOpen}>
|
||||
<IconText icon={faBook}>
|
||||
Open legacy Jupyter Notebook
|
||||
</IconText>
|
||||
</NavigateButton>
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue