Guest User

Untitled

a guest
Dec 16th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. const s = StyleSheet.create({
  2. content: {
  3. flex: 1,
  4. },
  5. screen: {
  6. backgroundColor: theme.bgColor2,
  7. },
  8. })
  9.  
  10. @observer
  11. export class MainScreen extends React.Component<IProps> {
  12. @observable
  13. private toolBarHeight: number = 0
  14.  
  15. render() {
  16. return (
  17. <Screen style={s.screen}>
  18. <NavigationHeaderBase
  19. border
  20. centered
  21. leftElement={this.renderAvatar()}
  22. rightElement={<View />}
  23. title={this.props.headerTitle}
  24. />
  25. <View style={s.content}>{this.toolBarHeight > 0 ? this.props.children : null}</View>
  26. <ToolBar activeItem={this.props.tabActive} onLayout={this.onToolBarLayout} />
  27. </Screen>
  28. )
  29. }
  30.  
  31. private onToolBarLayout = (layout: LayoutRectangle) => {
  32. if (layout.height !== this.toolBarHeight) {
  33. this.toolBarHeight = layout.height
  34. }
  35. }
  36. }
Add Comment
Please, Sign In to add comment