diff --git a/packages/react/src/components/terminal/Terminal.tsx b/packages/react/src/components/terminal/Terminal.tsx index 26a09f38..64b12a16 100644 --- a/packages/react/src/components/terminal/Terminal.tsx +++ b/packages/react/src/components/terminal/Terminal.tsx @@ -1,12 +1,14 @@ import { useState, useEffect } from 'react'; import { useDispatch } from "react-redux"; +import { Box } from '@primer/react'; import { ITerminal } from '@jupyterlab/terminal'; import TerminalAdapter from './TerminalAdapter'; import { terminalActions, terminalReducer } from './TerminalState'; import { useJupyter } from './../../jupyter/JupyterContext'; -import Lumino from '../../jupyter/lumino/Lumino'; +import LuminoBox from '../../jupyter/lumino/LuminoBox'; -export const Terminal = (options: Terminal.ITerminalOptions) => { +export const Terminal = (props: Terminal.ITerminalOptions) => { + const { height } = props; const { injectableStore, serverSettings } = useJupyter(); const dispatch = useDispatch(); const [adapter, setAdapter] = useState(); @@ -14,28 +16,38 @@ export const Terminal = (options: Terminal.ITerminalOptions) => { injectableStore.inject('terminal', terminalReducer); const adapter = new TerminalAdapter({ serverSettings, - ...options, + ...props, }); dispatch(terminalActions.update({ adapter })); setAdapter(adapter); }, []); return adapter ? - - {adapter.panel} - + + + {adapter.panel} + + : - <>Loading Jupyter Terminal... + <> } export namespace Terminal { export interface ITerminalOptions { + height?: string; theme?: ITerminal.Theme; } } Terminal.defaultProps = { + height: "100%", theme: "dark", } as Partial; diff --git a/packages/react/src/components/terminal/TerminalAdapter.css b/packages/react/src/components/terminal/TerminalAdapter.css index b3c8d506..e69de29b 100644 --- a/packages/react/src/components/terminal/TerminalAdapter.css +++ b/packages/react/src/components/terminal/TerminalAdapter.css @@ -1,4 +0,0 @@ -.dla-JupyterLab-terminal { - height: 300px; - width: 100%; -} diff --git a/packages/react/src/components/terminal/TerminalAdapter.ts b/packages/react/src/components/terminal/TerminalAdapter.ts index a4e0081a..6b66cccb 100755 --- a/packages/react/src/components/terminal/TerminalAdapter.ts +++ b/packages/react/src/components/terminal/TerminalAdapter.ts @@ -12,8 +12,8 @@ export class TerminalAdapter { constructor(options: TerminalAdapter.ITerminalAdapterOptions) { const { serverSettings, theme } = options; this.terminalPanel = new BoxPanel(); - this.terminalPanel.addClass('dla-JupyterLab-terminal'); this.terminalPanel.spacing = 0; + this.terminalPanel.addClass("dla-JupyterLab-Terminal-id"); const terminalManager = new TerminalManager({ serverSettings, }); diff --git a/packages/react/src/examples/Terminal.tsx b/packages/react/src/examples/Terminal.tsx index c6716768..fb0e24de 100644 --- a/packages/react/src/examples/Terminal.tsx +++ b/packages/react/src/examples/Terminal.tsx @@ -8,6 +8,6 @@ const root = createRoot(div) root.render( - + );