Skip to content

Commit a74ca95

Browse files
committed
Fix cell and tab display
1 parent fccac5b commit a74ca95

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/frontend/components/Cell/index.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,14 @@ const NoteBookCell = ({ cell }: { cell: NbCell }) => {
8282
}
8383

8484
return (
85-
<section>
86-
<section className="grid grid-rows-1 text-right">
85+
<section className="p-2">
86+
<section className="col-span-12 text-right">
8787
<CellOptionsBar cell={cell} />
8888
</section>
89-
<section className="grid grid-cols-12">
90-
<div className="col-span-1 text-right">
89+
<section>
90+
<div className="flex"
91+
onKeyPress={handleKeyPress}
92+
>
9193
{
9294
cellIsRunning ? (
9395
<LoadingButton loading ></LoadingButton>
@@ -102,13 +104,9 @@ const NoteBookCell = ({ cell }: { cell: NbCell }) => {
102104
</IconButton>
103105
)
104106
}
105-
106-
</div>
107-
108-
<div className="col-span-11"
109-
onKeyPress={handleKeyPress}
110-
>
111107
<CellEditor cell={cell} />
108+
</div>
109+
<div className="flex ml-8">
112110
<CellOutputRenderer cell={cell} />
113111
</div>
114112

src/frontend/components/NotebookTabPanel/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ export default function NotebookTabPanel() {
1010
const dispatch = useDispatch();
1111
const { notebooks } = useSelector((state: { app: AppState }) => state.app)
1212
const tabNames = Object.keys(notebooks)
13-
const [value, setValue] = useState(0);
13+
const [tabValue, setTabValue] = useState(0);
1414

1515
const handleChange = (event: any, newValue: number) => {
1616
const currentNotebookTab = notebooks[event.target.innerText]
1717
dispatch(updateActiveNotebookName(currentNotebookTab.name));
18-
setValue(newValue);
18+
setTabValue(newValue);
1919
};
2020

2121
return (
2222
<div className='col-span-12 border-l-2 ml-52'>
2323
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
24-
<Tabs value={value} onChange={handleChange} aria-label="basic tabs example">
24+
<Tabs value={tabValue} onChange={handleChange} aria-label="basic tabs example">
2525
{
2626
tabNames.map((name, i) => {
2727
return <Tab style={{ textTransform: "none" }} key={i} label={name} />

src/frontend/pages/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ const Home: NextPage = () => {
3232
<MenuBar />
3333
</section>
3434

35-
<section style={{ height: "650px" }} className='grid grid-cols-12 p-2 overflow-y-scroll'>
35+
<section style={{ height: "650px" }} className='grid overflow-y-scroll'>
3636
<div className='fixed'>
3737
<SideBar />
3838
</div>
39-
<NotebookTabPanel />
40-
<Notebook />
39+
<div>
40+
<NotebookTabPanel />
41+
<Notebook />
42+
</div>
4143
</section>
4244
</div>
4345
</div>

0 commit comments

Comments
 (0)