Skip to content

Commit

Permalink
initial updates for new shared size avatars
Browse files Browse the repository at this point in the history
  • Loading branch information
dangrous committed Jan 12, 2023
1 parent 9a7b027 commit 0167179
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/RoomHeaderAvatars.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ const RoomHeaderAvatars = (props) => {
}

const iconsToDisplay = props.icons.slice(0, CONST.REPORT.MAX_PREVIEW_AVATARS);
console.log('this is large bordered', StyleUtils.getAvatarStyle(CONST.AVATAR_SIZE.LARGE_BORDERED));

const iconStyle = [
styles.roomHeaderAvatar,
StyleUtils.getAvatarStyle(CONST.AVATAR_SIZE.MEDIUM),
StyleUtils.getAvatarStyle(CONST.AVATAR_SIZE.LARGE_BORDERED),
];
return (
<View pointerEvents="none">
Expand Down
9 changes: 9 additions & 0 deletions src/styles/StyleUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ function getAvatarSize(size) {
[CONST.AVATAR_SIZE.SMALLER]: variables.avatarSizeSmaller,
[CONST.AVATAR_SIZE.LARGE]: variables.avatarSizeLarge,
[CONST.AVATAR_SIZE.MEDIUM]: variables.avatarSizeMedium,
[CONST.AVATAR_SIZE.LARGE_BORDERED]: variables.avatarSizeLargeBordered,
};

if (!size) {
console.log('nothing was sent to size either', size, AVATAR_SIZES[size]);
}
return AVATAR_SIZES[size];
}

Expand All @@ -33,6 +38,10 @@ function getAvatarSize(size) {
* @returns {Object}
*/
function getAvatarStyle(size) {
if (!size) {
console.log('yourenot sending anything to style');
}

const avatarSize = getAvatarSize(size);
return {
height: avatarSize,
Expand Down
1 change: 1 addition & 0 deletions src/styles/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default {
componentBorderRadiusRounded: 20,
buttonBorderRadius: 100,
avatarSizeLarge: 80,
avatarSizeLargeBordered: 88,
avatarSizeMedium: 52,
avatarSizeNormal: 40,
avatarSizeSmall: 28,
Expand Down

0 comments on commit 0167179

Please sign in to comment.