noobify welcome demo, still need to add new field so this doesn't appear everytime
This commit is contained in:
parent
013ff1d941
commit
2abe6b9bc4
|
@ -39,8 +39,10 @@ export function Button(props: {
|
||||||
color === 'yellow' && 'bg-yellow-400 text-white hover:bg-yellow-500',
|
color === 'yellow' && 'bg-yellow-400 text-white hover:bg-yellow-500',
|
||||||
color === 'blue' && 'bg-blue-400 text-white hover:bg-blue-500',
|
color === 'blue' && 'bg-blue-400 text-white hover:bg-blue-500',
|
||||||
color === 'indigo' && 'bg-indigo-500 text-white hover:bg-indigo-600',
|
color === 'indigo' && 'bg-indigo-500 text-white hover:bg-indigo-600',
|
||||||
color === 'gray' && 'bg-gray-100 text-gray-600 hover:bg-gray-200',
|
color === 'gray' &&
|
||||||
color === 'gray-white' && 'bg-white text-gray-500 hover:bg-gray-200',
|
'bg-greyscale-1 text-greyscale-7 hover:bg-greyscale-2',
|
||||||
|
color === 'gray-white' &&
|
||||||
|
'text-greyscale-6 hover:bg-greyscale-2 bg-white',
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
|
|
|
@ -15,8 +15,8 @@ export function PillButton(props: {
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'cursor-pointer select-none whitespace-nowrap rounded-full',
|
'cursor-pointer select-none whitespace-nowrap rounded-full',
|
||||||
selected
|
selected
|
||||||
? ['text-white', color ?? 'bg-gray-700']
|
? ['text-white', color ?? 'bg-greyscale-6']
|
||||||
: 'bg-gray-100 hover:bg-gray-200',
|
: 'bg-greyscale-2 hover:bg-greyscale-3',
|
||||||
big ? 'px-8 py-2' : 'px-3 py-1.5 text-sm'
|
big ? 'px-8 py-2' : 'px-3 py-1.5 text-sm'
|
||||||
)}
|
)}
|
||||||
onClick={onSelect}
|
onClick={onSelect}
|
||||||
|
|
|
@ -5,7 +5,7 @@ export function Title(props: { text: string; className?: string }) {
|
||||||
return (
|
return (
|
||||||
<h1
|
<h1
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'my-4 inline-block text-2xl text-indigo-700 sm:my-6 sm:text-3xl',
|
'my-4 inline-block text-2xl font-normal text-indigo-700 sm:my-6 sm:text-3xl',
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|
|
@ -6,6 +6,8 @@ import Script from 'next/script'
|
||||||
import { usePreserveScroll } from 'web/hooks/use-preserve-scroll'
|
import { usePreserveScroll } from 'web/hooks/use-preserve-scroll'
|
||||||
import { QueryClient, QueryClientProvider } from 'react-query'
|
import { QueryClient, QueryClientProvider } from 'react-query'
|
||||||
import { AuthProvider } from 'web/components/auth-context'
|
import { AuthProvider } from 'web/components/auth-context'
|
||||||
|
import { useUser } from 'web/hooks/use-user'
|
||||||
|
import Welcome from 'web/components/onboarding/welcome'
|
||||||
|
|
||||||
function firstLine(msg: string) {
|
function firstLine(msg: string) {
|
||||||
return msg.replace(/\r?\n.*/s, '')
|
return msg.replace(/\r?\n.*/s, '')
|
||||||
|
@ -78,9 +80,9 @@ function MyApp({ Component, pageProps }: AppProps) {
|
||||||
content="width=device-width, initial-scale=1, maximum-scale=1"
|
content="width=device-width, initial-scale=1, maximum-scale=1"
|
||||||
/>
|
/>
|
||||||
</Head>
|
</Head>
|
||||||
|
|
||||||
<AuthProvider>
|
<AuthProvider>
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
|
<Welcome {...pageProps}/>
|
||||||
<Component {...pageProps} />
|
<Component {...pageProps} />
|
||||||
</QueryClientProvider>
|
</QueryClientProvider>
|
||||||
</AuthProvider>
|
</AuthProvider>
|
||||||
|
|
|
@ -51,6 +51,7 @@ 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
|
||||||
|
@ -242,48 +243,114 @@ export default function GroupPage(props: {
|
||||||
href: groupPath(group.slug, 'about'),
|
href: groupPath(group.slug, 'about'),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
return (
|
if (manifundGroupNames.includes(group.name)) {
|
||||||
<Page
|
return (
|
||||||
rightSidebar={showChatSidebar ? chatTab : undefined}
|
<Page
|
||||||
rightSidebarClassName={showChatSidebar ? '!top-0' : ''}
|
rightSidebar={showChatSidebar ? chatTab : undefined}
|
||||||
className={showChatSidebar ? '!max-w-7xl !pb-0' : ''}
|
rightSidebarClassName={showChatSidebar ? '!top-0' : ''}
|
||||||
>
|
className={showChatSidebar ? '!max-w-7xl !pb-0' : ''}
|
||||||
<SEO
|
>
|
||||||
title={group.name}
|
<SEO
|
||||||
description={`Created by ${creator.name}. ${group.about}`}
|
title={group.name}
|
||||||
url={groupPath(group.slug)}
|
description={`Created by ${creator.name}. ${group.about}`}
|
||||||
/>
|
url={groupPath(group.slug)}
|
||||||
<Col className="px-3">
|
/>
|
||||||
<Row className={'items-center justify-between gap-4'}>
|
<Col className="px-3">
|
||||||
<div className={'sm:mb-1'}>
|
<Row className={'items-center justify-between gap-4'}>
|
||||||
<div
|
<div className={'sm:mb-1'}>
|
||||||
className={'line-clamp-1 my-2 text-2xl text-indigo-700 sm:my-3'}
|
<div
|
||||||
>
|
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={'hidden sm:block'}>
|
<div className="mt-2">
|
||||||
<Linkify text={group.about} />
|
<JoinOrAddQuestionsButtons
|
||||||
|
group={group}
|
||||||
|
user={user}
|
||||||
|
isMember={!!isMember}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Row>
|
||||||
<div className="mt-2">
|
</Col>
|
||||||
<JoinOrAddQuestionsButtons
|
<Tabs
|
||||||
group={group}
|
currentPageForAnalytics={groupPath(group.slug)}
|
||||||
user={user}
|
className={'mb-0 sm:mb-2'}
|
||||||
isMember={!!isMember}
|
defaultIndex={tabIndex > 0 ? tabIndex : 0}
|
||||||
/>
|
tabs={tabs}
|
||||||
</div>
|
/>
|
||||||
</Row>
|
</Page>
|
||||||
</Col>
|
)
|
||||||
<Tabs
|
} else {
|
||||||
currentPageForAnalytics={groupPath(group.slug)}
|
return (
|
||||||
className={'mb-0 sm:mb-2'}
|
<Page
|
||||||
defaultIndex={tabIndex > 0 ? tabIndex : 0}
|
rightSidebar={showChatSidebar ? chatTab : undefined}
|
||||||
tabs={tabs}
|
rightSidebarClassName={showChatSidebar ? '!top-0' : ''}
|
||||||
/>
|
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: {
|
||||||
|
|
|
@ -18,6 +18,19 @@ module.exports = {
|
||||||
backgroundImage: {
|
backgroundImage: {
|
||||||
'world-trading': "url('/world-trading-background.webp')",
|
'world-trading': "url('/world-trading-background.webp')",
|
||||||
},
|
},
|
||||||
|
colors: {
|
||||||
|
// primary: '#4338CA',
|
||||||
|
// 'primary-dark': '#1F1F6D',
|
||||||
|
// secondary: '#E97176',
|
||||||
|
// 'secondary-dark': '#6060C6',
|
||||||
|
'greyscale-1': '#FBFBFF',
|
||||||
|
'greyscale-2': '#E7E7F4',
|
||||||
|
'greyscale-3': '#D8D8EB',
|
||||||
|
'greyscale-4': '#B1B1C7',
|
||||||
|
'greyscale-5': '#9191A7',
|
||||||
|
'greyscale-6': '#66667C',
|
||||||
|
'greyscale-7': '#111140',
|
||||||
|
},
|
||||||
typography: {
|
typography: {
|
||||||
quoteless: {
|
quoteless: {
|
||||||
css: {
|
css: {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user