getting rid of irrelevant things

This commit is contained in:
ingawei 2022-07-29 13:19:39 -07:00
parent 4e72e8d1df
commit a1c4be47d6
2 changed files with 38 additions and 106 deletions

View File

@ -2,12 +2,10 @@ import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/react/solid'
import clsx from 'clsx' import clsx from 'clsx'
import { useState } from 'react' import { useState } from 'react'
import { useUser } from 'web/hooks/use-user' import { useUser } from 'web/hooks/use-user'
import { changeUserInfo } from 'web/lib/firebase/api'
import { updateUser } from 'web/lib/firebase/users' import { updateUser } from 'web/lib/firebase/users'
import { Col } from '../layout/col' import { Col } from '../layout/col'
import { Modal } from '../layout/modal' import { Modal } from '../layout/modal'
import { Row } from '../layout/row' import { Row } from '../layout/row'
import { Subtitle } from '../subtitle'
import { Title } from '../title' import { Title } from '../title'
export default function Welcome() { export default function Welcome() {

View File

@ -51,7 +51,6 @@ import { ENV_CONFIG } from 'common/envs/constants'
import { useSaveReferral } from 'web/hooks/use-save-referral' import { useSaveReferral } from 'web/hooks/use-save-referral'
import { Button } from 'web/components/button' import { Button } from 'web/components/button'
const manifundGroupNames = ['Cause Exploration Prize']
export const getStaticProps = fromPropz(getStaticPropz) export const getStaticProps = fromPropz(getStaticPropz)
export async function getStaticPropz(props: { params: { slugs: string[] } }) { export async function getStaticPropz(props: { params: { slugs: string[] } }) {
const { slugs } = props.params const { slugs } = props.params
@ -244,113 +243,48 @@ export default function GroupPage(props: {
}, },
] ]
const manifundTabs = [
{
title: 'Chat',
content: chatTab,
href: groupPath(group.slug, GROUP_CHAT_SLUG),
},
{
title: 'Markets',
content: questionsTab,
href: groupPath(group.slug, 'markets'),
},
{
title: 'Leaderboards',
content: leaderboard,
href: groupPath(group.slug, 'leaderboards'),
},
{
title: 'About',
content: aboutTab,
href: groupPath(group.slug, 'about'),
},
]
const tabIndex = tabs.map((t) => t.title).indexOf(page ?? GROUP_CHAT_SLUG) const tabIndex = tabs.map((t) => t.title).indexOf(page ?? GROUP_CHAT_SLUG)
if (manifundGroupNames.includes(group.name)) { return (
return ( <Page
<Page rightSidebar={showChatSidebar ? chatTab : undefined}
rightSidebar={showChatSidebar ? chatTab : undefined} rightSidebarClassName={showChatSidebar ? '!top-0' : ''}
rightSidebarClassName={showChatSidebar ? '!top-0' : ''} className={showChatSidebar ? '!max-w-7xl !pb-0' : ''}
className={showChatSidebar ? '!max-w-7xl !pb-0' : ''} >
> <SEO
<SEO title={group.name}
title={group.name} description={`Created by ${creator.name}. ${group.about}`}
description={`Created by ${creator.name}. ${group.about}`} url={groupPath(group.slug)}
url={groupPath(group.slug)} />
/> <Col className="px-3">
<Col className="px-3"> <Row className={'items-center justify-between gap-4'}>
<Row className={'items-center justify-between gap-4'}> <div className={'sm:mb-1'}>
<div className={'sm:mb-1'}> <div
<div className={'line-clamp-1 my-2 text-2xl text-indigo-700 sm:my-3'}
className={'line-clamp-1 my-2 text-2xl text-indigo-700 sm:my-3'} >
> {group.name}
{group.name}
</div>
<div className={'hidden sm:block'}>
<Linkify text={group.about} />
</div>
</div> </div>
<div className="mt-2"> <div className={'hidden sm:block'}>
<JoinOrAddQuestionsButtons <Linkify text={group.about} />
group={group}
user={user}
isMember={!!isMember}
/>
</div> </div>
</Row> </div>
</Col> <div className="mt-2">
<Tabs <JoinOrAddQuestionsButtons
currentPageForAnalytics={groupPath(group.slug)} group={group}
className={'mb-0 sm:mb-2'} user={user}
defaultIndex={tabIndex > 0 ? tabIndex : 0} isMember={!!isMember}
tabs={tabs} />
/> </div>
</Page> </Row>
) </Col>
} else { <Tabs
return ( currentPageForAnalytics={groupPath(group.slug)}
<Page className={'mb-0 sm:mb-2'}
rightSidebar={showChatSidebar ? chatTab : undefined} defaultIndex={tabIndex > 0 ? tabIndex : 0}
rightSidebarClassName={showChatSidebar ? '!top-0' : ''} tabs={tabs}
className={showChatSidebar ? '!max-w-7xl !pb-0' : ''} />
> </Page>
<SEO )
title={group.name}
description={`Created by ${creator.name}. ${group.about}`}
url={groupPath(group.slug)}
/>
<Col className="px-3">
<Row className={'items-center justify-between gap-4'}>
<div className={'sm:mb-1'}>
<div
className={'line-clamp-1 my-2 text-2xl text-indigo-700 sm:my-3'}
>
{group.name}
</div>
<div className={'hidden sm:block'}>
<Linkify text={group.about} />
</div>
</div>
<div className="mt-2">
<JoinOrAddQuestionsButtons
group={group}
user={user}
isMember={!!isMember}
/>
</div>
</Row>
</Col>
<Tabs
currentPageForAnalytics={groupPath(group.slug)}
className={'mb-0 sm:mb-2'}
defaultIndex={tabIndex > 0 ? tabIndex : 0}
tabs={tabs}
/>
</Page>
)
}
} }
function JoinOrAddQuestionsButtons(props: { function JoinOrAddQuestionsButtons(props: {