1
0
Fork 0

feat(lab): Draft view pretty ok now

This commit is contained in:
Joost De Cock 2022-01-28 16:57:07 +01:00
parent 73163f5676
commit 929822b249
15 changed files with 327 additions and 29 deletions

View file

@ -0,0 +1,36 @@
import Markdown from 'react-markdown'
import { linkClasses } from 'shared/components/navigation/primary.js'
const eventBlock = events => events.join(" \n")
const EventGroup = ({ type='info', events=[] }) => events.length > 0 ? (
<div className="">
<h3 className="capitalize" id={`events-${type}`}>{type}</h3>
<div className="mdx">
<Markdown>{eventBlock(events)}</Markdown>
</div>
</div>
) : null
const order = [
'error',
'warning',
'info',
'debug'
]
const Events = props => (
<div className="flex flex-col">
<ul className="flex flex-row row-wrap">
{order.map(type => (
<li key={type} className="">
<a href={`#events-${type}`} className={`text-secondary font-bold capitalize text-xl`}>{type}</a>
{type === 'debug' ? '' : <span className="px-2 font-bold">|</span>}
</li>
))}
</ul>
{order.map(type => <EventGroup type={type} events={props.events[type]} />)}
</div>
)
export default Events