Skip to content

Commit 5438dd4

Browse files
committed
Merge branch 'master' of https://github.com/aeagle/react-spaces
2 parents 4bfbc2f + 4e98546 commit 5438dd4

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@
44

55
React Spaces allow you to divide a page or container HTML element into spaces. These spaces know how to behave in relation to each other and can also be divided into further nested spaces.
66

7+
<img src="http://www.allaneagle.com/react-spaces/react-spaces-demo.gif" width="100%" />
8+
79
### Top level spaces
810

911
Used at the top level of all other spaces.
1012

11-
**<ViewPort />**
13+
**\<ViewPort \/>**
1214

1315
This space will take over the full viewport of the browser window. Resizing the browser window will automatically adjust the size of this space and all the nested spaces.
1416

1517
**\<Fixed /\>**
1618

1719
This space can be given a height and optionally a width (by default it will size to 100% of it's container). All nested spaces will be contained within this fixed size space.
1820

19-
### Inner spaces
21+
### Anchored spaces
2022

2123
These can be used within the top-level spaces **\<ViewPort /\>** and **\<Fixed /\>** or nested within other spaces.
2224

@@ -28,6 +30,8 @@ A space anchored to the left or right of the parent container/space. A size can
2830

2931
A space anchored to the top or bottom of the parent container/space. A size can be specified in pixels or as a percentage to determine its height.
3032

33+
### Other
34+
3135
**\<Fill /\>**
3236

3337
A space which consumes any available area left in the parent container/space taking into account any anchored spaces on every side.

react-spaces/src/components/Space.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,32 +168,24 @@ class Space extends React.Component<AllProps, IState> {
168168
{
169169
if (t.anchorType === AnchorType.Top) {
170170
adjustedTop.push(`${getSizeString(t.size)} + ${t.adjustedSize}px`);
171-
//style.top! += t.size + t.adjustedSize;
172171
} else if (t.anchorType === AnchorType.Left) {
173172
adjustedLeft.push(`${getSizeString(t.size)} + ${t.adjustedSize}px`);
174-
//style.left! += t.size + t.adjustedSize;
175173
} else if (t.anchorType === AnchorType.Bottom) {
176174
adjustedBottom.push(`${getSizeString(t.size)} + ${t.adjustedSize}px`);
177-
//style.bottom! += t.size + t.adjustedSize;
178175
} else if (t.anchorType === AnchorType.Right) {
179176
adjustedRight.push(`${getSizeString(t.size)} + ${t.adjustedSize}px`);
180-
//style.right! += t.size + t.adjustedSize;
181177
}
182178
}
183179
else
184180
{
185181
if (t.anchorType === AnchorType.Top && style.top !== undefined) {
186182
adjustedTop.push(`${getSizeString(t.size)} + ${t.adjustedSize}px`);
187-
//style.top += t.size + t.adjustedSize;
188183
} else if (t.anchorType === AnchorType.Left && style.left !== undefined) {
189184
adjustedLeft.push(`${getSizeString(t.size)} + ${t.adjustedSize}px`);
190-
//style.left += t.size + t.adjustedSize;
191185
} else if (t.anchorType === AnchorType.Bottom && style.bottom !== undefined) {
192186
adjustedBottom.push(`${getSizeString(t.size)} + ${t.adjustedSize}px`);
193-
//style.bottom += t.size + t.adjustedSize;
194187
} else if (t.anchorType === AnchorType.Right && style.right !== undefined) {
195188
adjustedRight.push(`${getSizeString(t.size)} + ${t.adjustedSize}px`);
196-
//style.right += t.size + t.adjustedSize;
197189
}
198190
}
199191
} else {
@@ -348,4 +340,4 @@ export const Info : React.FC<{ children: (info: ISpaceInfo) => React.ReactNode }
348340
info => props.children(info!)
349341
}
350342
</SpaceInfoContext.Consumer>
351-
)
343+
)

0 commit comments

Comments
 (0)