Skip to content

Commit 1e72a3a

Browse files
author
Sankhadeep
committed
title fix
1 parent 4919e96 commit 1e72a3a

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

Components/Widgets/Title.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,36 @@
22
'use strict';
33

44
import React from 'react';
5-
import { View, Platform } from 'react-native';
5+
import { Platform } from 'react-native';
66
import NativeBaseComponent from '../Base/NativeBaseComponent';
77
import Text from "./Text";
8+
import View from "./View";
9+
import computeProps from '../../Utils/computeProps';
810

911

1012
export default class Title extends NativeBaseComponent {
1113

14+
prepareRootProps() {
15+
16+
var type = {
17+
color: this.getTheme().toolbarTextColor,
18+
fontSize: this.getTheme().titleFontSize,
19+
fontFamily: this.getTheme().btnFontFamily,
20+
fontWeight: (Platform.OS === 'ios') ? '500' : undefined,
21+
alignSelf: (Platform.OS === 'ios' ) ? 'center' : 'flex-start'
22+
}
23+
24+
var defaultProps = {
25+
style: type
26+
}
27+
28+
return computeProps(this.props, defaultProps);
29+
30+
}
31+
1232
render() {
1333
return(
14-
<View><Text style={{color: this.getTheme().toolbarTextColor , fontSize: this.getTheme().titleFontSize, fontFamily: this.getTheme().btnFontFamily, fontWeight: (Platform.OS === 'ios') ? '500' : undefined, alignSelf: (Platform.OS === 'ios' ) ? 'center' : 'flex-start'}}>{this.props.children}</Text></View>
34+
<View style={{justifyContent: 'center'}}><Text {...this.prepareRootProps()}>{this.props.children}</Text></View>
1535
);
1636
}
1737
}

0 commit comments

Comments
 (0)