Skip to content

Commit

Permalink
Make all avatars square with rounded corners
Browse files Browse the repository at this point in the history
Fixes #205
  • Loading branch information
borisyankov committed Jan 15, 2017
1 parent 12fa5ff commit 9dc8f09
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/common/ImageAvatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import {

import { Touchable } from './';

export default({ avatarUrl, size, onPress }) => {
export default({ avatarUrl, size, isCircular, onPress }) => {
const style = {
height: size,
width: size,
borderRadius: size / 2,
borderRadius: isCircular ? size / 2 : size / 8,
};

return (
Expand Down
4 changes: 2 additions & 2 deletions src/common/TextAvatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ export const colorHashFromName = (name: string) => {
export const initialsFromName = (name: string) =>
name.match(/\S+\s*/g).map(x => x[0].toUpperCase()).join('');

export default ({ name, size, onPress }) => {
export default ({ name, size, isCircular, onPress }) => {
const frameStyle = {
justifyContent: 'center',
alignItems: 'center',
height: size,
width: size,
borderRadius: size / 2,
borderRadius: isCircular ? size / 2 : size / 8,
backgroundColor: colorHashFromName(name),
};
const textStyle = {
Expand Down
2 changes: 1 addition & 1 deletion src/message/MessageLoading.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const styles = StyleSheet.create({
},
avatar: {
backgroundColor: '#ddd',
borderRadius: 16,
borderRadius: 32 / 8,
width: 32,
height: 32,
},
Expand Down
2 changes: 1 addition & 1 deletion src/message/Subheader.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Timestamp from './Timestamp';
const styles = StyleSheet.create({
subheader: {
flex: 1,
flexBasis: 25,
flexBasis: 20,
flexDirection: 'row',
justifyContent: 'space-between',
},
Expand Down

0 comments on commit 9dc8f09

Please sign in to comment.