manifold/web/pages/contract/[contractId].tsx
James Grugett 48a249eaa9
Contract page (#5)
* Add Firestore package and config

* Upload basic Firebase Auth code

* Basic ability to sign in and view profile

* Move html head content to Next's _document

* Apply dark theme to all DaisyUI components

* Add contract page

* Smaller width bet input

* Add some buttons

* Add Row, Col, and Spacer components

* Implement skeleton ContractPage

* Apply dark theme to all DaisyUI components

* Fix hooks lints (#3)

* Add background to bet panel

* Changes based on review comments

Co-authored-by: Austin Chen <akrolsmir@gmail.com>
2021-12-10 08:56:17 -06:00

37 lines
992 B
TypeScript

import React from 'react'
import { useRouter } from 'next/router'
import { useContract } from '../../hooks/use-contract'
import { Header } from '../../components/header'
import { Row } from '../../components/layout/row'
import { ContractOverview } from '../../components/contract-overview'
import { BetPanel } from '../../components/bet-panel'
export default function ContractPage() {
const router = useRouter()
const { contractId } = router.query as { contractId: string }
const contract = useContract(contractId)
if (contract === 'loading') {
return <div />
}
if (!contract) {
return <div>Contract not found...</div>
}
return (
<div className="max-w-7xl mx-auto sm:px-6 lg:px-8">
<Header />
<div className="w-full flex flex-col p-4 mt-4">
<Row className="justify-between">
<ContractOverview contract={contract} />
<BetPanel className="self-start" contract={contract} />
</Row>
</div>
</div>
)
}