1
Fork 0
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:
Steffo 2021-10-20 20:21:49 +02:00
parent 06301a6ad9
commit 0715f255fb
2 changed files with 6 additions and 6 deletions

View file

@ -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>
)
}

View file

@ -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>
)
}