File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed
react-spaces/src/components Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,10 @@ export enum AnchorType {
33 Right = " anchor-right" ,
44 Top = " anchor-top" ,
55 Bottom = " anchor-bottom"
6+ }
7+
8+ export enum CenterType {
9+ None ,
10+ Vertical ,
11+ HorizontalVertical
612}
Original file line number Diff line number Diff line change 44 z-index : 1 ;
55
66 .spaces-space-inner {
7- z-index : 2 ;
7+ z-index : 1 ;
88 position : absolute ;
99 left : 0 ;
1010 top : 0 ;
Original file line number Diff line number Diff line change 11import * as React from 'react' ;
22import './Space.scss' ;
3- import { AnchorType } from './Globals' ;
3+ import { AnchorType , CenterType } from './Globals' ;
44import { ResizeSensor , ResizeSensorCallback } from 'css-element-queries' ;
55import { SpaceContext , ISpaceContext , ISpaceTaker } from './SpaceContext' ;
66import { Guid } from "guid-typescript" ;
77import { Resizable , ResizeType } from './Resizable' ;
8+ import { CenteredVertically , Centered } from './Centered' ;
89
910interface IPublicProps {
1011 id ?: string ,
1112 className ?: string ,
1213 style ?: React . CSSProperties ,
1314 scrollable ?: boolean ,
1415 trackSize ?: boolean ,
16+ centerContent ?: CenterType ,
1517 as ?: string
1618}
1719
@@ -258,6 +260,11 @@ class Space extends React.Component<AllProps, IState> {
258260 parentContext . updateSpaceTakerAdjustedSize ( this . state . id , adjustedSize ) ;
259261 } ) ;
260262 } } /> ;
263+
264+ if ( this . props . centerContent === CenterType . Vertical ) {
265+ children = < CenteredVertically > { children } </ CenteredVertically > ;
266+ } else if ( this . props . centerContent === CenterType . HorizontalVertical ) {
267+ children = < Centered > { children } </ Centered > ;
261268 }
262269
263270 const adjustedStyle =
You can’t perform that action at this time.
0 commit comments