Design update for editor page

This commit is contained in:
inaseem 2021-10-03 22:46:37 +05:30
parent c5e00165dd
commit 21e5b8c353
1 changed files with 80 additions and 86 deletions

View File

@ -12,7 +12,6 @@ import {
Box, Box,
Button, Button,
Chip, Chip,
Divider,
Stack, Stack,
ToggleButton, ToggleButton,
ToggleButtonGroup, ToggleButtonGroup,
@ -416,18 +415,20 @@ const CodeRunner = (props) => {
> >
<Stack <Stack
direction="row" direction="row"
alignItems="stretch" alignItems="center"
justifyContent="space-between"
sx={{ sx={{
boxShadow: `0 2px 4px rgb(0 0 0 / 10%)`, boxShadow: `0 2px 4px rgb(0 0 0 / 10%)`,
zIndex: (t) => t.zIndex.appBar, zIndex: (t) => t.zIndex.appBar,
height: "48px",
p: "0 24px",
}} }}
> >
<Stack direction="row" sx={{ flexGrow: 1 }} alignItems="stretch"> <Stack direction="row" alignItems="center" gap={2}>
<Button <Button
variant="contained" variant="contained"
sx={{ borderRadius: 0, minWidth: 0 }}
disableElevation disableElevation
size="small" size="medium"
color="primary" color="primary"
onClick={() => { onClick={() => {
router.push("/"); router.push("/");
@ -435,10 +436,7 @@ const CodeRunner = (props) => {
> >
<Home fontSize={"small"} /> <Home fontSize={"small"} />
</Button> </Button>
<Typography <Typography sx={{ fontSize: 14, fontWeight: 600 }}>
sx={{ fontSize: 14, px: 2, fontWeight: 600, alignSelf: "center" }}
textAlign="center"
>
{config.name} {config.name}
</Typography> </Typography>
<Chip <Chip
@ -447,23 +445,24 @@ const CodeRunner = (props) => {
color={status != "idle" ? "info" : "default"} color={status != "idle" ? "info" : "default"}
sx={{ sx={{
fontSize: "0.7rem", fontSize: "0.7rem",
alignSelf: "center",
height: "16px", height: "16px",
}} }}
label={status} label={status}
/> />
</Stack> </Stack>
<Stack direction="row" gap={1} alignItems="center">
<LoadingButton <LoadingButton
onClick={handleLspClick} onClick={handleLspClick}
size="small" size="medium"
variant="text" variant="text"
loading={isLspRequested} loading={isLspRequested}
sx={{ sx={{
borderRadius: 0,
visibility: config.lsp ? "visible" : "hidden", visibility: config.lsp ? "visible" : "hidden",
mr: 1, mr: 1,
color: (t) => color: (t) =>
isLspStarted ? t.palette.success.main : t.palette.text.disabled, isLspStarted
? t.palette.success.main
: t.palette.text.disabled,
}} }}
disableElevation disableElevation
endIcon={ endIcon={
@ -485,59 +484,54 @@ const CodeRunner = (props) => {
exclusive exclusive
onChange={handleLayout} onChange={handleLayout}
aria-label="split type" aria-label="split type"
sx={{ mr: 1 }}
> >
<ToggleButton <ToggleButton
value="vertical" value="vertical"
aria-label="vertical split" aria-label="vertical split"
sx={{ borderRadius: 0 }} sx={{ border: "none" }}
> >
<VerticalSplit fontSize="small" /> <VerticalSplit fontSize="small" />
</ToggleButton> </ToggleButton>
<ToggleButton <ToggleButton
value="horizontal" value="horizontal"
aria-label="horizontal split" aria-label="horizontal split"
sx={{ borderRadius: 0 }} sx={{ border: "none" }}
> >
<HorizontalSplit fontSize="small" /> <HorizontalSplit fontSize="small" />
</ToggleButton> </ToggleButton>
</ToggleButtonGroup> </ToggleButtonGroup>
{config.format && (
<LoadingButton <LoadingButton
onClick={sendFormat} onClick={sendFormat}
loading={isFormatting} loading={isFormatting}
size="small" size="medium"
color="primary" color="primary"
variant="contained" variant="contained"
sx={{
borderRadius: 0,
visibility: config.format ? "visible" : "hidden",
}}
disableElevation disableElevation
endIcon={<Format fontSize="small" />} endIcon={<Format fontSize="small" />}
> >
<Typography sx={{ fontSize: 12 }}>Prettify</Typography> <Typography sx={{ fontSize: 12 }}>Prettify</Typography>
</LoadingButton> </LoadingButton>
<Divider orientation="vertical" /> )}
<LoadingButton <LoadingButton
onClick={showValue} onClick={showValue}
loading={isRunning} loading={isRunning}
size="small" size="medium"
color="success" color="success"
variant="contained" variant="contained"
sx={{ borderRadius: 0 }}
disableElevation disableElevation
endIcon={<PlayArrow fontSize="small" htmlColor="#fff" />} endIcon={<PlayArrow fontSize="small" htmlColor="#fff" />}
> >
<Typography sx={{ fontSize: 12, color: "#fff" }}>Run</Typography> <Typography sx={{ fontSize: 12, color: "#fff" }}>Run</Typography>
</LoadingButton> </LoadingButton>
</Stack> </Stack>
</Stack>
<Layouts splitType={splitType}> <Layouts splitType={splitType}>
<Box className="panel editor"> <Box className="panel editor">
<MonacoEditor <MonacoEditor
wrapperClassName={"rijuEditor"} wrapperClassName={"rijuEditor"}
onChange={handleChange} onChange={handleChange}
// height="100vh"
defaultLanguage="javascript" defaultLanguage="javascript"
defaultValue="// some comment" defaultValue="// some comment"
options={{ options={{