Skip to content

Commit 96ea48b

Browse files
committed
Updated docs
1 parent 35b926b commit 96ea48b

File tree

2 files changed

+55
-25
lines changed

2 files changed

+55
-25
lines changed

demo/src/App.scss

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pre {
3838
padding: 25px !important;
3939
}
4040

41-
.examples {
41+
.main {
4242
.spaces-fixedsize-layout {
4343
margin: 0 25px;
4444
}
@@ -71,4 +71,26 @@ pre {
7171
right: -60px;
7272
z-index: 100000;
7373
}
74+
}
75+
76+
@media (max-width: 800px)
77+
{
78+
#forkongithub {
79+
display: none;
80+
}
81+
82+
.sidebar {
83+
display: none;
84+
}
85+
86+
.main {
87+
position: fixed;
88+
left: inherit !important;
89+
right: inherit !important;
90+
top: 80px !important;
91+
bottom: inherit !important;
92+
height: inherit !important;
93+
width: 100% !important;
94+
overflow: auto !important;
95+
}
7496
}

demo/src/App.tsx

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import * as Space from 'react-spaces';
3-
import { Tabs, Anchor, Divider, Button, Icon } from 'antd';
3+
import { Tabs, Anchor, Button, Icon } from 'antd';
44
import 'antd/dist/antd.css';
55
import SyntaxHighlighter from 'react-syntax-highlighter';
66
import './App.scss';
@@ -22,21 +22,18 @@ const App: React.FC = () => {
2222
<h1 style={{ color: 'white' }}>React Spaces</h1>
2323
</Space.CenteredVertically>
2424
</Space.Top>
25-
<Space.Fill>
26-
<Space.Left size={250} style={{ padding: 30, borderRight: '2px solid #ddd' }}>
25+
<Space.Fill className="all-content">
26+
<Space.Left className="sidebar" size={250} style={{ padding: 30, borderRight: '2px solid #ddd' }}>
2727

2828
<h3 className="sidebar-header">GitHub</h3>
2929
<div style={{ marginBottom: 15 }}>
3030
<Button type="primary" onClick={() => window.location.href = 'https://github.com/aeagle/react-spaces'}><Icon type="github" /> View on GitHub</Button>
3131
</div>
3232

33-
<h3 className="sidebar-header">NPM <img alt="NPM version" src="https://img.shields.io/npm/v/react-spaces.svg" /></h3>
34-
<div style={{ marginBottom: 15 }}>
35-
<Button type="primary" onClick={() => window.location.href = 'https://www.npmjs.com/package/react-spaces'}>View on NPM</Button>
36-
</div>
33+
<h3 className="sidebar-header">NPM <img style={{ position: 'relative', top: -2 }} alt="NPM version" src="https://img.shields.io/npm/v/react-spaces.svg" /></h3>
3734

3835
Maintained by
39-
<h2 className="sidebar-header"><a style={{ color: 'black', fontSize: 24 }} href="https://twitter.com/allaneagle">@allaneagle</a></h2>
36+
<h2 className="sidebar-header"><a style={{ color: 'black', fontSize: 20 }} href="https://twitter.com/allaneagle">@allaneagle</a></h2>
4037

4138
<Anchor offsetTop={30}>
4239
<Anchor.Link href="#getting-started" title="Getting started" />
@@ -51,7 +48,7 @@ const App: React.FC = () => {
5148
</Anchor>
5249

5350
</Space.Left>
54-
<Space.Fill scrollable={true} style={{ padding: 30, paddingTop: 0 }} className="examples">
51+
<Space.Fill className="main" scrollable={true} style={{ padding: 30, paddingTop: 0 }}>
5552

5653
<p id="intro" style={{ fontWeight: 400, paddingTop: 30, paddingBottom: 0, fontSize: 28, color: '#777' }}>
5754
React Spaces allow you to divide a page or container into spaces. These spaces know how
@@ -392,31 +389,31 @@ const App: React.FC = () => {
392389
{
393390
"const App = () => (\r\n" +
394391
" <Space.Fixed height={400}>\r\n" +
395-
" <Space.LeftResizable size={200} order={1} />\r\n" +
396-
" <Space.LeftResizable size={125} order={2} />\r\n" +
392+
" <Space.LeftResizable size={75} order={1} />\r\n" +
393+
" <Space.LeftResizable size={75} order={2} />\r\n" +
397394
" <Space.Fill />\r\n" +
398-
" <Space.RightResizable size={125} order={2} />\r\n" +
399-
" <Space.RightResizable size={200} order={1} />\r\n" +
395+
" <Space.RightResizable size={75} order={2} />\r\n" +
396+
" <Space.RightResizable size={75} order={1} />\r\n" +
400397
" </Space.Fixed>\r\n" +
401398
")"
402399
}
403400
</SyntaxHighlighter>
404401

405402
<Space.Fixed height={400}>
406-
<Space.LeftResizable trackSize={true} size={200} order={1} style={{ backgroundColor: '#e0eee0' }}>
407-
{Description("Left resizable 1")}
403+
<Space.LeftResizable trackSize={true} size={75} order={1} style={{ backgroundColor: '#e0eee0' }}>
404+
{Description("Left 1")}
408405
</Space.LeftResizable>
409-
<Space.LeftResizable trackSize={true} size={125} order={2} style={{ backgroundColor: '#e0eeee' }}>
410-
{Description("Left resizable 2")}
406+
<Space.LeftResizable trackSize={true} size={75} order={2} style={{ backgroundColor: '#e0eeee' }}>
407+
{Description("Left 2")}
411408
</Space.LeftResizable>
412409
<Space.Fill trackSize={true} style={{ backgroundColor: '#eee0e0' }}>
413410
{Description("Fill")}
414411
</Space.Fill>
415-
<Space.RightResizable trackSize={true} size={125} order={2} style={{ backgroundColor: '#e0eeee' }}>
416-
{Description("Right resizable 2")}
412+
<Space.RightResizable trackSize={true} size={75} order={2} style={{ backgroundColor: '#e0eeee' }}>
413+
{Description("Right 2")}
417414
</Space.RightResizable>
418-
<Space.RightResizable trackSize={true} size={200} order={1} style={{ backgroundColor: '#e0eee0' }}>
419-
{Description("Right resizable 1")}
415+
<Space.RightResizable trackSize={true} size={75} order={1} style={{ backgroundColor: '#e0eee0' }}>
416+
{Description("Right 1")}
420417
</Space.RightResizable>
421418
</Space.Fixed>
422419

@@ -454,9 +451,20 @@ const App: React.FC = () => {
454451

455452
<h2 id="changes">Version history</h2>
456453

457-
<ul>
458-
<li><strong>0.1.0 - 0.1.1</strong> Initial versions</li>
459-
</ul>
454+
<p>
455+
<strong>0.1.2</strong>
456+
<ul>
457+
<li>Removed ResizeSensor from spaces by default and now optionally allow live size updates with <strong>trackSize</strong> property</li>
458+
<li>Added <strong>VerticallyCentered</strong> component to vertically centre content within space</li>
459+
<li>Allow class names to be specified on top-level spaces <strong>ViewPort</strong> and <strong>Fixed</strong></li>
460+
</ul>
461+
</p>
462+
<p>
463+
<strong>0.1.0 - 0.1.1</strong>
464+
<ul>
465+
<li>Initial version</li>
466+
</ul>
467+
</p>
460468

461469
</Space.Fill>
462470

0 commit comments

Comments
 (0)