fixed log overflow, resize sizing

This commit is contained in:
Joni Juup
2022-02-02 12:12:07 +02:00
parent 9a09da88ec
commit c544a03be4
6 changed files with 31 additions and 10 deletions

View File

@@ -45,9 +45,15 @@ const LogBox: React.FC<ILogBox> = ({
background: "$mauve1", background: "$mauve1",
position: "relative", position: "relative",
flex: 1, flex: 1,
height: "100%",
}} }}
> >
<Container css={{ px: 0, flexShrink: 1 }}> <Container
css={{
px: 0,
height: "100%",
}}
>
<Flex <Flex
css={{ css={{
py: "$3", py: "$3",
@@ -81,6 +87,7 @@ const LogBox: React.FC<ILogBox> = ({
)} )}
</Flex> </Flex>
</Flex> </Flex>
<Box <Box
as="pre" as="pre"
ref={logRef} ref={logRef}
@@ -90,13 +97,14 @@ const LogBox: React.FC<ILogBox> = ({
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
width: "100%", width: "100%",
height: "100%",
overflowY: "auto",
fontSize: "13px", fontSize: "13px",
fontWeight: "$body", fontWeight: "$body",
fontFamily: "$monospace", fontFamily: "$monospace",
px: "$3", px: "$3",
pb: "$2", pb: "$2",
whiteSpace: "normal", whiteSpace: "normal",
overflowY: "auto",
}} }}
> >
{logs?.map((log, index) => ( {logs?.map((log, index) => (

View File

@@ -4,7 +4,7 @@ const Text = styled("span", {
fontFamily: "$monospace", fontFamily: "$monospace",
lineHeight: "$body", lineHeight: "$body",
color: "$text", color: "$text",
wordWrap: 'break-word', wordWrap: "break-word",
variants: { variants: {
variant: { variant: {
log: { log: {

View File

@@ -21,6 +21,7 @@ const Deploy = () => {
return ( return (
<Split <Split
direction="vertical" direction="vertical"
gutterSize={4}
sizes={[40, 60]} sizes={[40, 60]}
style={{ height: "calc(100vh - 60px)" }} style={{ height: "calc(100vh - 60px)" }}
> >
@@ -31,6 +32,7 @@ const Deploy = () => {
direction="horizontal" direction="horizontal"
sizes={[50, 50]} sizes={[50, 50]}
minSize={[320, 160]} minSize={[320, 160]}
gutterSize={4}
style={{ style={{
display: "flex", display: "flex",
flexDirection: "row", flexDirection: "row",

View File

@@ -26,6 +26,7 @@ const Home: NextPage = () => {
direction="vertical" direction="vertical"
sizes={[70, 30]} sizes={[70, 30]}
minSize={[100, 100]} minSize={[100, 100]}
gutterSize={4}
style={{ height: "calc(100vh - 60px)" }} style={{ height: "calc(100vh - 60px)" }}
> >
<main style={{ display: "flex", flex: 1, position: "relative" }}> <main style={{ display: "flex", flex: 1, position: "relative" }}>

View File

@@ -356,6 +356,7 @@ const Test = () => {
<Split <Split
direction="vertical" direction="vertical"
sizes={[50, 50]} sizes={[50, 50]}
gutterSize={4}
style={{ height: "calc(100vh - 60px)" }} style={{ height: "calc(100vh - 60px)" }}
> >
<Flex <Flex
@@ -363,7 +364,6 @@ const Test = () => {
fluid fluid
css={{ css={{
justifyContent: "center", justifyContent: "center",
mb: "$2",
p: "$3 $2", p: "$3 $2",
}} }}
> >
@@ -371,6 +371,7 @@ const Test = () => {
direction="horizontal" direction="horizontal"
sizes={[50, 50]} sizes={[50, 50]}
minSize={[180, 320]} minSize={[180, 320]}
gutterSize={4}
gutterAlign="center" gutterAlign="center"
style={{ style={{
display: "flex", display: "flex",
@@ -409,6 +410,7 @@ const Test = () => {
direction="horizontal" direction="horizontal"
sizes={[50, 50]} sizes={[50, 50]}
minSize={[320, 160]} minSize={[320, 160]}
gutterSize={4}
style={{ style={{
display: "flex", display: "flex",
flexDirection: "row", flexDirection: "row",
@@ -416,14 +418,19 @@ const Test = () => {
height: "100%", height: "100%",
}} }}
> >
<Box css={{ width: "50%", borderRight: "1px solid $mauve8" }}> <Box
css={{
borderRight: "1px solid $mauve8",
height: "100%",
}}
>
<LogBox <LogBox
title="Development Log" title="Development Log"
logs={snap.transactionLogs} logs={snap.transactionLogs}
clearLog={() => (state.transactionLogs = [])} clearLog={() => (state.transactionLogs = [])}
/> />
</Box> </Box>
<Box css={{ width: "50%" }}> <Box css={{ height: "100%" }}>
<DebugStream /> <DebugStream />
</Box> </Box>
</Split> </Split>

View File

@@ -6,6 +6,7 @@ body,
min-height: 100vh; min-height: 100vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y: hidden;
} }
* { * {
@@ -14,16 +15,18 @@ body,
.gutter { .gutter {
position: relative; position: relative;
background: transparent; background-color: rgba(255, 255, 255, 0);
transition: border-color 0.3s; transition: border-color 0.3s, background-color 0.3s;
} }
.gutter-vertical { .gutter-vertical {
margin-top: -10px;
border-bottom: 1px solid transparent; border-bottom: 1px solid transparent;
margin-top: -5px;
padding-top: 4px;
} }
.gutter-horizontal { .gutter-horizontal {
margin-left: -10px;
border-right: 1px solid transparent; border-right: 1px solid transparent;
margin-left: -5px;
padding-left: 4px;
} }
.gutter-vertical:hover { .gutter-vertical:hover {
cursor: row-resize; cursor: row-resize;