Replace /markets
with /home
(#766)
* Make /home not kick out logged out users * Point people at /home instead of /markets
This commit is contained in:
parent
fb67010c0e
commit
97fa5fa636
|
@ -33,7 +33,7 @@ function getNavigation() {
|
||||||
|
|
||||||
const signedOutNavigation = [
|
const signedOutNavigation = [
|
||||||
{ name: 'Home', href: '/', icon: HomeIcon },
|
{ name: 'Home', href: '/', icon: HomeIcon },
|
||||||
{ name: 'Explore', href: '/markets', icon: SearchIcon },
|
{ name: 'Explore', href: '/home', icon: SearchIcon },
|
||||||
]
|
]
|
||||||
|
|
||||||
// From https://codepen.io/chris__sev/pen/QWGvYbL
|
// From https://codepen.io/chris__sev/pen/QWGvYbL
|
||||||
|
|
|
@ -99,8 +99,8 @@ function getMoreNavigation(user?: User | null) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const signedOutNavigation = [
|
const signedOutNavigation = [
|
||||||
{ name: 'Home', href: '/home', icon: HomeIcon },
|
{ name: 'Home', href: '/', icon: HomeIcon },
|
||||||
{ name: 'Explore', href: '/markets', icon: SearchIcon },
|
{ name: 'Explore', href: '/home', icon: SearchIcon },
|
||||||
{
|
{
|
||||||
name: 'About',
|
name: 'About',
|
||||||
href: 'https://docs.manifold.markets/$how-to',
|
href: 'https://docs.manifold.markets/$how-to',
|
||||||
|
|
|
@ -12,15 +12,18 @@ import { getContractFromSlug } from 'web/lib/firebase/contracts'
|
||||||
import { getUserAndPrivateUser } from 'web/lib/firebase/users'
|
import { getUserAndPrivateUser } from 'web/lib/firebase/users'
|
||||||
import { useTracking } from 'web/hooks/use-tracking'
|
import { useTracking } from 'web/hooks/use-tracking'
|
||||||
import { track } from 'web/lib/service/analytics'
|
import { track } from 'web/lib/service/analytics'
|
||||||
import { redirectIfLoggedOut } from 'web/lib/firebase/server-auth'
|
import { authenticateOnServer } from 'web/lib/firebase/server-auth'
|
||||||
import { useSaveReferral } from 'web/hooks/use-save-referral'
|
import { useSaveReferral } from 'web/hooks/use-save-referral'
|
||||||
|
import { GetServerSideProps } from 'next'
|
||||||
|
|
||||||
export const getServerSideProps = redirectIfLoggedOut('/', async (_, creds) => {
|
export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||||
return { props: { auth: await getUserAndPrivateUser(creds.user.uid) } }
|
const creds = await authenticateOnServer(ctx)
|
||||||
})
|
const auth = creds ? await getUserAndPrivateUser(creds.user.uid) : null
|
||||||
|
return { props: { auth } }
|
||||||
|
}
|
||||||
|
|
||||||
const Home = (props: { auth: { user: User } }) => {
|
const Home = (props: { auth: { user: User } | null }) => {
|
||||||
const { user } = props.auth
|
const user = props.auth ? props.auth.user : null
|
||||||
const [contract, setContract] = useContractPage()
|
const [contract, setContract] = useContractPage()
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
|
@ -30,12 +30,6 @@ export default function Home(props: { hotContracts: Contract[] }) {
|
||||||
<Col className="items-center">
|
<Col className="items-center">
|
||||||
<Col className="max-w-3xl">
|
<Col className="max-w-3xl">
|
||||||
<LandingPagePanel hotContracts={hotContracts ?? []} />
|
<LandingPagePanel hotContracts={hotContracts ?? []} />
|
||||||
{/* <p className="mt-6 text-gray-500">
|
|
||||||
View{' '}
|
|
||||||
<SiteLink href="/markets" className="font-bold text-gray-700">
|
|
||||||
all markets
|
|
||||||
</SiteLink>
|
|
||||||
</p> */}
|
|
||||||
</Col>
|
</Col>
|
||||||
</Col>
|
</Col>
|
||||||
</Page>
|
</Page>
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
import { useUser } from 'web/hooks/use-user'
|
|
||||||
import { ContractSearch } from '../components/contract-search'
|
|
||||||
import { Page } from '../components/page'
|
|
||||||
import { SEO } from '../components/SEO'
|
|
||||||
|
|
||||||
// TODO: Rename endpoint to "Explore"
|
|
||||||
export default function Markets() {
|
|
||||||
const user = useUser()
|
|
||||||
return (
|
|
||||||
<Page>
|
|
||||||
<SEO
|
|
||||||
title="Explore"
|
|
||||||
description="Discover what's new, trending, or soon-to-close. Or search thousands of prediction markets."
|
|
||||||
url="/markets"
|
|
||||||
/>
|
|
||||||
<ContractSearch user={user} />
|
|
||||||
</Page>
|
|
||||||
)
|
|
||||||
}
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
|
||||||
<url><loc>https://manifold.markets</loc><changefreq>hourly</changefreq><priority>1.0</priority></url>
|
<url><loc>https://manifold.markets</loc><changefreq>hourly</changefreq><priority>1.0</priority></url>
|
||||||
<url><loc>https://manifold.markets/markets</loc><changefreq>hourly</changefreq><priority>0.2</priority></url>
|
<url><loc>https://manifold.markets/home</loc><changefreq>hourly</changefreq><priority>0.2</priority></url>
|
||||||
<url><loc>https://manifold.markets/leaderboards</loc><changefreq>daily</changefreq><priority>0.2</priority></url>
|
<url><loc>https://manifold.markets/leaderboards</loc><changefreq>daily</changefreq><priority>0.2</priority></url>
|
||||||
</urlset>
|
</urlset>
|
Loading…
Reference in New Issue
Block a user