Move contract description out of activity feed
This commit is contained in:
parent
5e8decfa4e
commit
14cef9ffc3
|
@ -13,6 +13,7 @@ import BetRow from './bet-row'
|
|||
import { ContractActivity } from './feed/contract-activity'
|
||||
import { AnswersGraph } from './answers/answers-graph'
|
||||
import { DPM, FreeResponse, FullContract } from '../../common/contract'
|
||||
import { ContractDescription } from './feed/feed-items'
|
||||
|
||||
export const ContractOverview = (props: {
|
||||
contract: Contract
|
||||
|
@ -71,6 +72,14 @@ export const ContractOverview = (props: {
|
|||
|
||||
{children}
|
||||
|
||||
<Spacer h={6} />
|
||||
|
||||
<ContractDescription
|
||||
className="px-2"
|
||||
contract={contract}
|
||||
isCreator={isCreator}
|
||||
/>
|
||||
|
||||
<Spacer h={12} />
|
||||
|
||||
<ContractActivity
|
||||
|
|
|
@ -326,8 +326,9 @@ function EditContract(props: {
|
|||
export function ContractDescription(props: {
|
||||
contract: Contract
|
||||
isCreator: boolean
|
||||
className?: string
|
||||
}) {
|
||||
const { contract, isCreator } = props
|
||||
const { contract, isCreator, className } = props
|
||||
const descriptionTimestamp = () => `${dayjs().format('MMM D, h:mma')}: `
|
||||
const isAdmin = useAdmin()
|
||||
|
||||
|
@ -348,7 +349,12 @@ export function ContractDescription(props: {
|
|||
if (!isCreator && !contract.description.trim()) return null
|
||||
|
||||
return (
|
||||
<div className="mt-2 whitespace-pre-line break-words text-gray-700">
|
||||
<div
|
||||
className={clsx(
|
||||
'mt-2 whitespace-pre-line break-words text-gray-700',
|
||||
className
|
||||
)}
|
||||
>
|
||||
<Linkify text={contract.description} />
|
||||
<br />
|
||||
{isCreator && (
|
||||
|
@ -506,7 +512,6 @@ function FeedDescription(props: { contract: Contract }) {
|
|||
/>{' '}
|
||||
created this market <RelativeTimestamp time={contract.createdTime} />
|
||||
</div>
|
||||
<ContractDescription contract={contract} isCreator={isCreator} />
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user