[RN] Fix showing user avatar in sidebar

This commit is contained in:
Zoltan Bettenbuk 2018-03-29 11:47:32 +02:00 committed by Saúl Ibarra Corretgé
parent 1e0a3ceb74
commit a3c00021de
2 changed files with 8 additions and 7 deletions

View File

@ -18,7 +18,7 @@ import { setSettingsViewVisible } from '../../settings';
import { setSideBarVisible } from '../actions'; import { setSideBarVisible } from '../actions';
import SideBarItem from './SideBarItem'; import SideBarItem from './SideBarItem';
import styles from './styles'; import styles, { SIDEBAR_AVATAR_SIZE } from './styles';
/** /**
* The URL at which the privacy policy is available to the user. * The URL at which the privacy policy is available to the user.
@ -88,6 +88,7 @@ class WelcomePageSideBar extends Component<Props> {
show = { this.props._visible }> show = { this.props._visible }>
<Header style = { styles.sideBarHeader }> <Header style = { styles.sideBarHeader }>
<Avatar <Avatar
size = { SIDEBAR_AVATAR_SIZE }
style = { styles.avatar } style = { styles.avatar }
uri = { this.props._avatar } /> uri = { this.props._avatar } />
<Text style = { styles.displayName }> <Text style = { styles.displayName }>

View File

@ -7,6 +7,7 @@ import {
const SIDEBAR_HEADER_HEIGHT = 150; const SIDEBAR_HEADER_HEIGHT = 150;
export const PLACEHOLDER_TEXT_COLOR = 'rgba(255, 255, 255, 0.3)'; export const PLACEHOLDER_TEXT_COLOR = 'rgba(255, 255, 255, 0.3)';
export const SIDEBAR_AVATAR_SIZE = 100;
export const SWITCH_THUMB_COLOR = ColorPalette.blueHighlight; export const SWITCH_THUMB_COLOR = ColorPalette.blueHighlight;
export const SWITCH_UNDER_COLOR = 'rgba(0, 0, 0, 0.4)'; export const SWITCH_UNDER_COLOR = 'rgba(0, 0, 0, 0.4)';
@ -40,10 +41,7 @@ export default createStyleSheet({
*/ */
avatar: { avatar: {
alignSelf: 'center', alignSelf: 'center',
borderRadius: 50, flex: 0
flex: 0,
height: 100,
width: 100
}, },
/** /**
@ -82,7 +80,7 @@ export default createStyleSheet({
displayName: { displayName: {
color: ColorPalette.white, color: ColorPalette.white,
fontSize: 16, fontSize: 16,
margin: BoxModel.margin, marginTop: BoxModel.margin,
textAlign: 'center' textAlign: 'center'
}, },
@ -223,9 +221,11 @@ export default createStyleSheet({
* The style of the side bar header. * The style of the side bar header.
*/ */
sideBarHeader: { sideBarHeader: {
alignItems: 'center',
flexDirection: 'column', flexDirection: 'column',
height: SIDEBAR_HEADER_HEIGHT, height: SIDEBAR_HEADER_HEIGHT,
justifyContent: 'center' justifyContent: 'center',
padding: BoxModel.padding
}, },
/** /**