diff --git a/common/challenge.ts b/common/challenge.ts index be59a1dc..b49bd836 100644 --- a/common/challenge.ts +++ b/common/challenge.ts @@ -45,6 +45,7 @@ export type Acceptance = { userId: string userUsername: string userName: string + userAvatarUrl: string // The ID of the successful bet that tracks the money moved betId: string diff --git a/functions/src/accept-challenge.ts b/functions/src/accept-challenge.ts index b9b83e1c..eb6c0350 100644 --- a/functions/src/accept-challenge.ts +++ b/functions/src/accept-challenge.ts @@ -155,6 +155,7 @@ export const acceptchallenge = newEndpoint({}, async (req, auth) => { createdTime: Date.now(), userUsername: user.username, userName: user.name, + userAvatarUrl: user.avatarUrl, } as Acceptance, ], }) diff --git a/web/components/nav/sidebar.tsx b/web/components/nav/sidebar.tsx index 77af99e0..facd898c 100644 --- a/web/components/nav/sidebar.tsx +++ b/web/components/nav/sidebar.tsx @@ -54,6 +54,7 @@ function getMoreNavigation(user?: User | null) { if (!user) { return [ { name: 'Leaderboards', href: '/leaderboards' }, + { name: 'Challenges', href: '/challenges' }, { name: 'Charity', href: '/charity' }, { name: 'Blog', href: 'https://news.manifold.markets' }, { name: 'Discord', href: 'https://discord.gg/eHQBNBqXuh' }, @@ -64,6 +65,7 @@ function getMoreNavigation(user?: User | null) { return [ { name: 'Send M$', href: '/links' }, { name: 'Leaderboards', href: '/leaderboards' }, + { name: 'Challenges', href: '/challenges' }, { name: 'Charity', href: '/charity' }, { name: 'Discord', href: 'https://discord.gg/eHQBNBqXuh' }, { name: 'About', href: 'https://docs.manifold.markets/$how-to' }, @@ -114,6 +116,7 @@ function getMoreMobileNav() { ? [] : [ { name: 'Send M$', href: '/links' }, + { name: 'Challenges', href: '/challenges' }, { name: 'Charity', href: '/charity' }, { name: 'Discord', href: 'https://discord.gg/eHQBNBqXuh' }, ]), diff --git a/web/pages/challenges/index.tsx b/web/pages/challenges/index.tsx index d5473e16..6b8f20e2 100644 --- a/web/pages/challenges/index.tsx +++ b/web/pages/challenges/index.tsx @@ -24,6 +24,7 @@ import { ToastClipboard } from 'web/components/toast-clipboard' import { Tabs } from 'web/components/layout/tabs' import { SiteLink } from 'web/components/site-link' import { UserLink } from 'web/components/user-page' +import { Avatar } from 'web/components/avatar' dayjs.extend(customParseFormat) export function getManalinkUrl(slug: string) { @@ -271,7 +272,7 @@ function AllLinksTable(props: { Amount - Link + Challenge Link Accepted By @@ -305,7 +306,7 @@ function PublicLinkSummaryRow(props: { link: Challenge; highlight: boolean }) { {formatMoney(link.amount)} - + {getChallengeUrl(link) .replace('https://manifold.markets', '...') @@ -313,11 +314,18 @@ function PublicLinkSummaryRow(props: { link: Challenge; highlight: boolean }) { - - + + + + + )