From 70cccee4691cb2f72580ddea3263d0ba88f4d29e Mon Sep 17 00:00:00 2001 From: ingawei Date: Wed, 21 Sep 2022 20:05:36 -0700 Subject: [PATCH] beginning to change profile --- web/components/contract-search.tsx | 6 + web/components/contract/contracts-grid.tsx | 9 + web/components/user-page.tsx | 359 +++++++++++---------- 3 files changed, 198 insertions(+), 176 deletions(-) diff --git a/web/components/contract-search.tsx b/web/components/contract-search.tsx index 7ab28cbb..3eb411e7 100644 --- a/web/components/contract-search.tsx +++ b/web/components/contract-search.tsx @@ -102,6 +102,7 @@ export function ContractSearch(props: { loadMore: () => void ) => ReactNode autoFocus?: boolean + profile?: boolean | undefined }) { const { user, @@ -121,6 +122,7 @@ export function ContractSearch(props: { maxResults, renderContracts, autoFocus, + profile, } = props const [state, setState] = usePersistentState( @@ -228,6 +230,10 @@ export function ContractSearch(props: { /> {renderContracts ? ( renderContracts(renderedContracts, performQuery) + ) : renderedContracts && renderedContracts.length === 0 && profile ? ( +

+ This creator does not yet have any markets. +

) : ( + // This creator does not yet have any markets. + //

+ // ) + // } else { return (

No markets found. Why not{' '} @@ -63,6 +70,7 @@ export function ContractsGrid(props: {

) + // } } return ( @@ -118,6 +126,7 @@ export function CreatorContractsList(props: { creatorId: creator.id, }} persistPrefix={`user-${creator.id}`} + profile={true} /> ) } diff --git a/web/components/user-page.tsx b/web/components/user-page.tsx index 2b24fa60..c01ec612 100644 --- a/web/components/user-page.tsx +++ b/web/components/user-page.tsx @@ -94,22 +94,27 @@ export function UserPage(props: { user: User }) { )} {/* Banner image up top, with an circle avatar overlaid */} -
-
-
+ >
*/} + + -
- + + + {user.name} + + @{user.username} + + {/* Top right buttons (e.g. edit, follow) */}
{!isCurrentUser && } @@ -120,182 +125,184 @@ export function UserPage(props: { user: User }) { )}
- - {/* Profile details: name, username, bio, and link to twitter/discord */} - - - - - {user.name} - - @{user.username} - - - - - + + {/* + + {user.name} + + @{user.username} + */} + + + + = 0 ? 'text-green-600' : 'text-red-400' + )} + > + {formatMoney(profit)} + + profit + + = 0 ? 'text-green-600' : 'text-red-400' + 'cursor-pointer items-center text-gray-500', + isCurrentUser && !hasCompletedStreakToday(user) + ? 'grayscale' + : 'grayscale-0' )} + onClick={() => setShowBettingStreakModal(true)} > - {formatMoney(profit)} - - profit - - setShowBettingStreakModal(true)} - > - 🔥 {user.currentBettingStreak ?? 0} - streak - - setShowLoansModal(true)} - > - - 🏦 {formatMoney(user.nextLoanCached ?? 0)} - - next loan - - - - - - {user.bio && ( - <> -
- -
- - - )} - {(user.website || user.twitterHandle || user.discordHandle) && ( - - {user.website && ( - - - - {user.website} - - - )} - - {user.twitterHandle && ( - - - Twitter - - {user.twitterHandle} - - - - )} - - {user.discordHandle && ( - - - Discord - - {user.discordHandle} - - - - )} - - )} - {currentUser?.id === user.id && REFERRAL_AMOUNT > 0 && ( - - - - Earn {formatMoney(REFERRAL_AMOUNT)} when you refer a friend! - {' '} - You've gotten{' '} - - - - - )} - - ), - }, - { - title: 'Comments', - content: ( - - + 🔥 {user.currentBettingStreak ?? 0} + streak - ), - }, - { - title: capitalize(PAST_BETS), - content: ( - <> - - - ), - }, - { - title: 'Stats', - content: ( - - - - - - - + setShowLoansModal(true)} + > + + 🏦 {formatMoney(user.nextLoanCached ?? 0)} + + next loan + + + + + + {user.bio && ( + <> +
+ +
+ + + )} + {(user.website || user.twitterHandle || user.discordHandle) && ( + + {user.website && ( + + + + + {user.website} + - - - ), - }, - ]} - /> + + )} + + {user.twitterHandle && ( + + + Twitter + + {user.twitterHandle} + + + + )} + + {user.discordHandle && ( + + + Discord + + {user.discordHandle} + + + + )} + + )} + {currentUser?.id === user.id && REFERRAL_AMOUNT > 0 && ( + + + + Earn {formatMoney(REFERRAL_AMOUNT)} when you refer a friend! + {' '} + You've gotten{' '} + + + + + )} + + ), + }, + { + title: 'Comments', + content: ( + + + + ), + }, + { + title: capitalize(PAST_BETS), + content: ( + <> + + + ), + }, + { + title: 'Stats', + content: ( + + + + + + + + + + + ), + }, + ]} + /> + )