put your challenges first
This commit is contained in:
parent
40b7877f1d
commit
1e0feae186
|
@ -38,6 +38,22 @@ export default function LinkPage() {
|
||||||
const userChallenges = useUserChallenges(user?.id ?? '')
|
const userChallenges = useUserChallenges(user?.id ?? '')
|
||||||
const challenges = useAcceptedChallenges()
|
const challenges = useAcceptedChallenges()
|
||||||
|
|
||||||
|
const userTab = user
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
content: <YourChallengesTable links={userChallenges} />,
|
||||||
|
title: 'Your Challenges',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: []
|
||||||
|
|
||||||
|
const publicTab = [
|
||||||
|
{
|
||||||
|
content: <PublicChallengesTable links={challenges} />,
|
||||||
|
title: 'Public Challenges',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<SEO
|
<SEO
|
||||||
|
@ -45,26 +61,14 @@ export default function LinkPage() {
|
||||||
description="Challenge your friends to a bet!"
|
description="Challenge your friends to a bet!"
|
||||||
url="/send"
|
url="/send"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Col className="w-full px-8">
|
<Col className="w-full px-8">
|
||||||
<Row className="items-center justify-between">
|
<Row className="items-center justify-between">
|
||||||
<Title text="Challenges" />
|
<Title text="Challenges" />
|
||||||
</Row>
|
</Row>
|
||||||
<p>Find or create a question to challenge someone to a bet.</p>
|
<p>Find or create a question to challenge someone to a bet.</p>
|
||||||
<Tabs
|
|
||||||
tabs={[
|
<Tabs tabs={[...userTab, ...publicTab]} />
|
||||||
{
|
|
||||||
content: <PublicChallengesTable links={challenges} />,
|
|
||||||
title: 'Public Challenges',
|
|
||||||
},
|
|
||||||
].concat(
|
|
||||||
user
|
|
||||||
? {
|
|
||||||
content: <YourChallengesTable links={userChallenges} />,
|
|
||||||
title: 'Your Challenges',
|
|
||||||
}
|
|
||||||
: []
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Col>
|
</Col>
|
||||||
</Page>
|
</Page>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user