2022-05-19 17:42:03 +00:00
|
|
|
import React, { useState } from 'react'
|
2022-05-17 17:56:10 +00:00
|
|
|
import Router from 'next/router'
|
2022-05-19 17:42:03 +00:00
|
|
|
|
2022-05-09 13:04:36 +00:00
|
|
|
import { Page } from 'web/components/page'
|
|
|
|
import { Col } from 'web/components/layout/col'
|
|
|
|
import { useUser } from 'web/hooks/use-user'
|
2022-05-17 17:56:10 +00:00
|
|
|
import { ContractSearch } from 'web/components/contract-search'
|
2022-01-23 00:16:23 +00:00
|
|
|
|
2022-04-09 23:10:58 +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 (
|
2022-05-17 17:56:10 +00:00
|
|
|
<Page assertUser="signed-in">
|
2022-05-20 17:53:12 +00:00
|
|
|
<Col className="mx-auto w-full p-2">
|
2022-05-17 17:56:10 +00:00
|
|
|
<ContractSearch
|
|
|
|
querySortOptions={{
|
2022-05-20 19:08:00 +00:00
|
|
|
shouldLoadFromStorage: true,
|
2022-05-17 17:56:10 +00:00
|
|
|
defaultSort: '24-hour-vol',
|
|
|
|
}}
|
|
|
|
showCategorySelector
|
2022-04-11 21:13:26 +00:00
|
|
|
/>
|
2022-05-17 17:56:10 +00:00
|
|
|
</Col>
|
|
|
|
</Page>
|
2022-01-23 00:16:23 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Home
|