diff --git a/web/components/avatar.tsx b/web/components/avatar.tsx index 5f9aa074..68a8061f 100644 --- a/web/components/avatar.tsx +++ b/web/components/avatar.tsx @@ -6,11 +6,11 @@ export function Avatar(props: { username?: string avatarUrl?: string noLink?: boolean - size?: number + size?: number | 'xs' | 'sm' className?: string }) { const { username, avatarUrl, noLink, size, className } = props - const s = size || 10 + const s = size == 'xs' ? 6 : size === 'sm' ? 8 : size || 10 const onClick = noLink && username diff --git a/web/components/feed/activity-items.ts b/web/components/feed/activity-items.ts index ce9a517e..a62204e7 100644 --- a/web/components/feed/activity-items.ts +++ b/web/components/feed/activity-items.ts @@ -37,6 +37,7 @@ export type BetItem = BaseActivityItem & { type: 'bet' bet: Bet hideOutcome: boolean + smallAvatar: boolean } export type CommentItem = BaseActivityItem & { @@ -45,6 +46,7 @@ export type CommentItem = BaseActivityItem & { bet: Bet hideOutcome: boolean truncate: boolean + smallAvatar: boolean } export type CreateAnswerItem = BaseActivityItem & { @@ -88,9 +90,10 @@ function groupBets( options: { hideOutcome: boolean abbreviated: boolean + smallAvatar: boolean } ) { - const { hideOutcome, abbreviated } = options + const { hideOutcome, abbreviated, smallAvatar } = options const commentsMap = mapCommentsByBetId(comments) const items: ActivityItem[] = [] @@ -123,6 +126,7 @@ function groupBets( contract, hideOutcome, truncate: abbreviated, + smallAvatar, } : { type: 'bet' as const, @@ -130,6 +134,7 @@ function groupBets( bet, contract, hideOutcome, + smallAvatar, } } @@ -213,7 +218,7 @@ function getAnswerGroups( DAY_IN_MS, contract, user?.id, - { hideOutcome: true, abbreviated } + { hideOutcome: true, abbreviated, smallAvatar: true } ) if (abbreviated) items = items.slice(-2) @@ -272,6 +277,7 @@ export function getAllContractActivityItems( : groupBets(bets, comments, DAY_IN_MS, contract, user?.id, { hideOutcome: !!filterToOutcome, abbreviated, + smallAvatar: !!filterToOutcome, })) ) @@ -310,6 +316,7 @@ export function getRecentContractActivityItems( : groupBets(bets, comments, DAY_IN_MS, contract, user?.id, { hideOutcome: false, abbreviated: true, + smallAvatar: false, }) return [questionItem, ...items] diff --git a/web/components/feed/feed-items.tsx b/web/components/feed/feed-items.tsx index 2c86779a..dd9cc742 100644 --- a/web/components/feed/feed-items.tsx +++ b/web/components/feed/feed-items.tsx @@ -111,8 +111,9 @@ function FeedComment(props: { bet: Bet hideOutcome: boolean truncate: boolean + smallAvatar: boolean }) { - const { contract, comment, bet, hideOutcome, truncate } = props + const { contract, comment, bet, hideOutcome, truncate, smallAvatar } = props const { amount, outcome } = bet const { text, userUsername, userName, userAvatarUrl, createdTime } = comment @@ -121,7 +122,12 @@ function FeedComment(props: { return ( <> - +

@@ -165,8 +171,9 @@ function FeedBet(props: { contract: Contract bet: Bet hideOutcome: boolean + smallAvatar: boolean }) { - const { contract, bet, hideOutcome } = props + const { contract, bet, hideOutcome, smallAvatar } = props const { id, amount, outcome, createdTime, userId } = bet const user = useUser() const isSelf = user?.id === userId @@ -194,9 +201,16 @@ function FeedBet(props: { <>

{isSelf ? ( - + ) : isCreator ? ( @@ -504,11 +518,16 @@ function FeedDescription(props: { contract: Contract }) { } function FeedCreateAnswer(props: { contract: Contract; answer: Answer }) { - const { contract, answer } = props + const { answer } = props return ( <> - +