1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-06-29 00:57:50 +02:00
market/src/components/@shared/Page/PageHeader.tsx

31 lines
649 B
TypeScript
Raw Normal View History

2020-07-07 23:00:16 +02:00
import React, { ReactElement } from 'react'
import classNames from 'classnames/bind'
2020-05-07 08:03:30 +02:00
import styles from './PageHeader.module.css'
import Markdown from '@shared/Markdown'
2020-05-07 08:03:30 +02:00
2020-07-07 23:00:16 +02:00
const cx = classNames.bind(styles)
2020-05-07 08:03:30 +02:00
export default function PageHeader({
title,
2020-07-15 14:34:40 +02:00
description,
center
2020-05-07 08:03:30 +02:00
}: {
2021-10-21 20:58:55 +02:00
title: ReactElement
2020-05-07 08:03:30 +02:00
description?: string
2020-07-07 23:00:16 +02:00
center?: boolean
}): ReactElement {
const styleClasses = cx({
2020-07-15 14:34:40 +02:00
header: true,
center
2020-07-07 23:00:16 +02:00
})
2020-05-07 08:03:30 +02:00
return (
2020-07-07 23:00:16 +02:00
<header className={styleClasses}>
2020-05-07 08:03:30 +02:00
<h1 className={styles.title}>{title}</h1>
{description && (
<Markdown text={description} className={styles.description} />
)}
2020-05-07 08:03:30 +02:00
</header>
)
}