diff --git a/src/account-info/AccountDetails.js b/src/account-info/AccountDetails.js index e97f37cbf3b..34bf22e9638 100644 --- a/src/account-info/AccountDetails.js +++ b/src/account-info/AccountDetails.js @@ -44,7 +44,6 @@ class AccountDetails extends PureComponent { diff --git a/src/common/GroupAvatar.js b/src/common/GroupAvatar.js index c7800054fe7..0764a544936 100644 --- a/src/common/GroupAvatar.js +++ b/src/common/GroupAvatar.js @@ -20,7 +20,7 @@ const styles = StyleSheet.create({ type Props = { names: string, size: number, - shape: string, + shape: 'rounded' | 'square', children?: React$Node, onPress?: () => void, }; @@ -32,7 +32,7 @@ type Props = { * * @prop names - The name of one or more users, used to extract their initials. * @prop size - Sets width and height in pixels. - * @prop shape - One of 'square', 'rounded', 'circle'. + * @prop [shape] * @prop children - If provided, will render inside the component body. * @prop onPress - Event fired on pressing the component. */ @@ -47,8 +47,7 @@ export default class GroupAvatar extends PureComponent { const frameSize = { height: size, width: size, - borderRadius: - shape === 'rounded' ? size / 8 : shape === 'circle' ? size / 2 : shape === 'square' ? 0 : 0, + borderRadius: shape === 'rounded' ? size / 8 : 0, backgroundColor: colorHashFromString(names), }; const textSize = { diff --git a/src/common/OwnAvatar.js b/src/common/OwnAvatar.js index 1c8f5472038..187079a4f5d 100644 --- a/src/common/OwnAvatar.js +++ b/src/common/OwnAvatar.js @@ -22,7 +22,7 @@ class OwnAvatar extends PureComponent { render() { const { user, size, realm } = this.props; const fullAvatarUrl = getAvatarFromUser(user, realm); - return ; + return ; } } diff --git a/src/common/UserAvatar.js b/src/common/UserAvatar.js index b500bfc3913..702e12b95db 100644 --- a/src/common/UserAvatar.js +++ b/src/common/UserAvatar.js @@ -8,7 +8,7 @@ import Touchable from './Touchable'; type Props = { avatarUrl: string, size: number, - shape: string, + shape: 'rounded' | 'square', children?: React$Node, onPress?: () => void, }; @@ -18,7 +18,7 @@ type Props = { * * @prop avatarUrl - Absolute or relative url to an avatar image. * @prop size - Sets width and height in pixels. - * @prop shape - One of 'square', 'rounded', 'circle'. + * @prop [shape] - 'rounded' (default) means a square with rounded corners. * @prop [children] - If provided, will render inside the component body. * @prop [onPress] - Event fired on pressing the component. */ @@ -29,8 +29,7 @@ export default class UserAvatar extends PureComponent { render() { const { avatarUrl, children, size, shape, onPress } = this.props; - const borderRadius = - shape === 'rounded' ? size / 8 : shape === 'circle' ? size / 2 : shape === 'square' ? 0 : 0; + const borderRadius = shape === 'rounded' ? size / 8 : 0; const style = { height: size, width: size, diff --git a/src/common/UserAvatarWithPresence.js b/src/common/UserAvatarWithPresence.js index 88523313302..128848d00b5 100644 --- a/src/common/UserAvatarWithPresence.js +++ b/src/common/UserAvatarWithPresence.js @@ -23,7 +23,7 @@ type Props = {| email: string, size: number, realm: string, - shape: 'square' | 'rounded' | 'circle', + shape: 'rounded' | 'square', onPress?: () => void, |}; @@ -34,7 +34,7 @@ type Props = {| * @prop [email] - User's' email address, to calculate Gravatar URL if not given `avatarUrl`. * @prop [size] - Sets width and height in pixels. * @prop [realm] - Current realm url, used if avatarUrl is relative. - * @prop [shape] - One of 'square', 'rounded', 'circle'. + * @prop [shape] - 'rounded' (default) means a square with rounded corners. * @prop [onPress] - Event fired on pressing the component. */ class UserAvatarWithPresence extends PureComponent {