From 8a99f3772aafc035ee48e0126dfc21dea3908704 Mon Sep 17 00:00:00 2001 From: Marshall Polaris Date: Mon, 9 May 2022 14:32:59 -0700 Subject: [PATCH] Cleanup avatar again (#161) * Reinstate avatar component cleanup This was reverted due to a bug, fixed in the subsequent commit. * Kill additional wrapper divs around avatars This also fixes a bug where the `w-8` answer row wrapper div was constraining the width of the `w-10` avatar, leading it to be `w-8` and `h-10` and appear as an oval. --- web/components/avatar.tsx | 48 ++++++++++++--------------- web/components/feed/feed-items.tsx | 53 +++++++++++++----------------- web/components/nav/nav-bar.tsx | 2 +- 3 files changed, 44 insertions(+), 59 deletions(-) diff --git a/web/components/avatar.tsx b/web/components/avatar.tsx index 318c5498..706b61f3 100644 --- a/web/components/avatar.tsx +++ b/web/components/avatar.tsx @@ -8,10 +8,8 @@ export function Avatar(props: { noLink?: boolean size?: number | 'xs' | 'sm' className?: string - containerClassName?: string }) { - const { username, avatarUrl, noLink, size, className, containerClassName } = - props + const { username, avatarUrl, noLink, size, className } = props const s = size == 'xs' ? 6 : size === 'sm' ? 8 : size || 10 const onClick = @@ -21,32 +19,28 @@ export function Avatar(props: { e.stopPropagation() Router.push(`/${username}`) } - return ( -
- {avatarUrl ? ( - {username} - ) : ( - // TODO: After 2022-03-01, can just assume that all contracts have an avatarUrl -