manifold/web/pages/home.tsx

32 lines
703 B
TypeScript
Raw Normal View History

import React from 'react'
import Router from 'next/router'
import { Page } from 'web/components/page'
import { Col } from 'web/components/layout/col'
import { useUser } from 'web/hooks/use-user'
import { ContractSearch } from 'web/components/contract-search'
2022-01-23 00:16:23 +00:00
const Home = () => {
2022-01-23 00:16:23 +00:00
const user = useUser()
2022-04-11 21:13:26 +00:00
2022-01-23 00:16:23 +00:00
if (user === null) {
Router.replace('/')
return <></>
}
return (
<Page assertUser="signed-in">
<Col className="mx-auto w-full">
<ContractSearch
querySortOptions={{
shouldLoadFromStorage: false,
defaultSort: '24-hour-vol',
}}
showCategorySelector
2022-04-11 21:13:26 +00:00
/>
</Col>
</Page>
2022-01-23 00:16:23 +00:00
)
}
export default Home