things
This commit is contained in:
parent
e7a552b8ca
commit
6140cb7a6a
|
@ -35,16 +35,13 @@ import {
|
||||||
hasCompletedStreakToday,
|
hasCompletedStreakToday,
|
||||||
} from 'web/components/profile/betting-streak-modal'
|
} from 'web/components/profile/betting-streak-modal'
|
||||||
import { LoansModal } from './profile/loans-modal'
|
import { LoansModal } from './profile/loans-modal'
|
||||||
import { useIsMobile } from 'web/hooks/use-is-mobile'
|
|
||||||
|
|
||||||
export function UserPage(props: { user: User }) {
|
export function UserPage(props: { user: User }) {
|
||||||
const { user } = props
|
const { user } = props
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const currentUser = useUser()
|
const currentUser = useUser()
|
||||||
const isCurrentUser = user.id === currentUser?.id
|
const isCurrentUser = user.id === currentUser?.id
|
||||||
// const bannerUrl = user.bannerUrl ?? defaultBannerUrl(user.id)
|
|
||||||
const [showConfetti, setShowConfetti] = useState(false)
|
const [showConfetti, setShowConfetti] = useState(false)
|
||||||
const isMobile = useIsMobile()
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const claimedMana = router.query['claimed-mana'] === 'yes'
|
const claimedMana = router.query['claimed-mana'] === 'yes'
|
||||||
|
@ -113,17 +110,18 @@ export function UserPage(props: { user: User }) {
|
||||||
)}
|
)}
|
||||||
{!isCurrentUser && <UserFollowButton userId={user.id} />}
|
{!isCurrentUser && <UserFollowButton userId={user.id} />}
|
||||||
</div>
|
</div>
|
||||||
{!isMobile && (
|
<ProfilePublicStats
|
||||||
<ProfilePublicStats
|
className="sm:text-md text-greyscale-6 hidden text-sm md:inline"
|
||||||
className="sm:text-md text-greyscale-6 text-sm"
|
user={user}
|
||||||
user={user}
|
/>
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
<Col className="mx-4 mt-2">
|
<Col className="mx-4 mt-2">
|
||||||
<Spacer h={1} />
|
<Spacer h={1} />
|
||||||
{isMobile && <ProfilePublicStats className="text-sm" user={user} />}
|
<ProfilePublicStats
|
||||||
|
className="text-greyscale-6 text-sm md:hidden"
|
||||||
|
user={user}
|
||||||
|
/>
|
||||||
<Spacer h={1} />
|
<Spacer h={1} />
|
||||||
{user.bio && (
|
{user.bio && (
|
||||||
<>
|
<>
|
||||||
|
@ -197,6 +195,7 @@ export function UserPage(props: { user: User }) {
|
||||||
tabIcon: <FolderIcon className="h-5" />,
|
tabIcon: <FolderIcon className="h-5" />,
|
||||||
content: (
|
content: (
|
||||||
<>
|
<>
|
||||||
|
<Spacer h={4} />
|
||||||
<PortfolioValueSection userId={user.id} />
|
<PortfolioValueSection userId={user.id} />
|
||||||
<Spacer h={4} />
|
<Spacer h={4} />
|
||||||
<BetsList user={user} />
|
<BetsList user={user} />
|
||||||
|
@ -207,16 +206,22 @@ export function UserPage(props: { user: User }) {
|
||||||
title: 'Markets',
|
title: 'Markets',
|
||||||
tabIcon: <ScaleIcon className="h-5" />,
|
tabIcon: <ScaleIcon className="h-5" />,
|
||||||
content: (
|
content: (
|
||||||
<CreatorContractsList user={currentUser} creator={user} />
|
<>
|
||||||
|
<Spacer h={4} />
|
||||||
|
<CreatorContractsList user={currentUser} creator={user} />
|
||||||
|
</>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Comments',
|
title: 'Comments',
|
||||||
tabIcon: <ChatIcon className="h-5" />,
|
tabIcon: <ChatIcon className="h-5" />,
|
||||||
content: (
|
content: (
|
||||||
<Col>
|
<>
|
||||||
<UserCommentsList user={user} />
|
<Spacer h={4} />
|
||||||
</Col>
|
<Col>
|
||||||
|
<UserCommentsList user={user} />
|
||||||
|
</Col>
|
||||||
|
</>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
|
|
|
@ -176,27 +176,6 @@ export default function ProfilePage(props: {
|
||||||
onBlur={updateUsername}
|
onBlur={updateUsername}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* TODO: Allow users with M$ 2000 of assets to set custom banners */}
|
|
||||||
{/* <EditUserField
|
|
||||||
user={user}
|
|
||||||
field="bannerUrl"
|
|
||||||
label="Banner Url"
|
|
||||||
isEditing={isEditing}
|
|
||||||
/> */}
|
|
||||||
<label className="label">
|
|
||||||
Banner image{' '}
|
|
||||||
<span className="text-sm text-gray-400">Not editable for now</span>
|
|
||||||
</label>
|
|
||||||
<div
|
|
||||||
className="h-32 w-full bg-cover bg-center sm:h-40"
|
|
||||||
style={{
|
|
||||||
backgroundImage: `url(${
|
|
||||||
user.bannerUrl || defaultBannerUrl(user.id)
|
|
||||||
})`,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{(
|
{(
|
||||||
[
|
[
|
||||||
['bio', 'Bio'],
|
['bio', 'Bio'],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user