Skip to content

Commit cd6ed9d

Browse files
committed
Testing
1 parent 75065ea commit cd6ed9d

File tree

3 files changed

+56
-3
lines changed

3 files changed

+56
-3
lines changed

demo/src/App.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
import React, { Suspense } from 'react';
1+
import React from 'react';
22
import './App.scss';
33
import ReactGA from 'react-ga';
4-
import { UI } from './ui-demo/UI';
4+
import { Test } from './Test';
5+
//import { UI } from './ui-demo/UI';
56

67
ReactGA.initialize("UA-144490437-1");
78
ReactGA.pageview(window.location.pathname + window.location.search);
89

910
const App: React.FC = () => {
10-
return <UI />
11+
return <Test />
1112
}
1213

1314
export default App;

demo/src/Test.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.test {
2+
.spaces-space {
3+
// transition: width 0.5s ease;
4+
}
5+
}

demo/src/Test.tsx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import React from "react";
2+
import * as Space from "react-spaces";
3+
import './Test.scss';
4+
5+
const COLLAPSED_SIZE = 20;
6+
const MINIMUM_SIZE = 200;
7+
8+
export const Test : React.FC = () => {
9+
const [ size, setSize ] = React.useState(300);
10+
11+
const onResizeStart = () => {
12+
};
13+
14+
const onResizeEnd = (width: number) => {
15+
setSize(width);
16+
}
17+
18+
return (
19+
<Space.ViewPort className="test">
20+
21+
<Space.LeftResizable
22+
style={{ backgroundColor: 'yellow', padding: 10 }}
23+
size={size}
24+
handleSize={60}
25+
maximumSize={600}
26+
minimumSize={100}
27+
onResizeStart={onResizeStart}
28+
onResizeEnd={onResizeEnd}
29+
order={1}>
30+
Hello
31+
</Space.LeftResizable>
32+
33+
<Space.Left
34+
style={{ backgroundColor: 'navy', color: 'white', padding: 10 }}
35+
size={200}
36+
order={2}>
37+
Something
38+
</Space.Left>
39+
40+
<Space.Fill
41+
style={{ backgroundColor: 'red', padding: 10 }}>
42+
World
43+
</Space.Fill>
44+
45+
</Space.ViewPort>
46+
)
47+
}

0 commit comments

Comments
 (0)