Skip to content

Commit f756cf1

Browse files
author
Agney
committed
- increase divider space
- keep result side interactive
1 parent b3c8c55 commit f756cf1

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

example/src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ import htm from 'htm';
1313
1414
const html = htm.bind(h);
1515
16-
const app = html\`<div>Hello World from Playground!</div>\`
16+
const app = html\`
17+
<div>
18+
<p>Hello World from Playground!</p>
19+
<input type="text" />
20+
</div>\`
1721
1822
render(app, document.getElementById('app'));
1923
`,

playground/src/Draggable/index.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@ const Container = styled("div", forwardRef)`
99
align-items: stretch;
1010
`;
1111

12+
const DividerContainer = styled("div", forwardRef)`
13+
width: ${(props) => props.theme.divider.containerWidth}px;
14+
background-color: ${(props) => props.theme.divider.dividerBackground};
15+
`;
16+
1217
const Divider = styled("div", forwardRef)`
1318
width: ${(props) => props.theme.divider.width}px;
1419
cursor: col-resize;
1520
background-color: ${(props) => props.theme.divider.background};
21+
margin: 0 auto;
22+
height: 100%;
1623
`;
1724

1825
interface IProps {
@@ -35,7 +42,9 @@ const Draggable: FC<IProps> = ({ className = "", leftChild, rightChild }) => {
3542
return (
3643
<Container className={className} ref={containerRef}>
3744
{leftChild(leftWidth)}
38-
<Divider ref={dividerRef} />
45+
<DividerContainer>
46+
<Divider ref={dividerRef} />
47+
</DividerContainer>
3948
{rightChild(rightWidth)}
4049
</Container>
4150
);

playground/src/Result/Frame.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
11
import React, { FC, useMemo, useState, memo, useEffect } from "react";
2-
import {styled} from "goober";
2+
import { styled } from "goober";
33

44
import { ISnippet } from "../types";
55
import constructSnippet from "../utils/constructSnippet";
66
import ErrorDisplay from "./ErrorDisplay";
77

8-
const Container = styled('div')`
8+
const Container = styled("div")`
99
position: relative;
1010
height: 100%;
11-
12-
&::after {
13-
content: "";
14-
display: inline-block;
15-
position: absolute;
16-
width: 100%;
17-
height: 100%;
18-
z-index: 1;
19-
top: 0;
20-
left: 0;
21-
}
2211
`;
2312

2413
interface IProps {

playground/src/utils/theme.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const lightModeColors = {
1313
},
1414
divider: {
1515
background: "#202020",
16+
dividerBackground: "#202020",
1617
},
1718
editor: {
1819
backgroundColor: `#000000`,
@@ -40,6 +41,7 @@ const darkModeColors = {
4041
},
4142
divider: {
4243
background: "rgba(255, 255, 255, 0.5)",
44+
dividerBackground: "rgba(255, 255, 255, 0.1)",
4345
},
4446
editor: {
4547
backgroundColor: `#000000`,
@@ -72,8 +74,9 @@ export const theme = {
7274
background: "rgba(0, 0, 0, 1)",
7375
},
7476
divider: {
75-
width: 2,
77+
width: 4,
7678
background: "",
79+
containerWidth: 8,
7780
},
7881
editor: {
7982
fontFamily: `Consolas, Menlo, Monaco, source-code-pro, Courier New, monospace`,

0 commit comments

Comments
 (0)