forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChangelog.tsx
More file actions
52 lines (47 loc) · 1.63 KB
/
Changelog.tsx
File metadata and controls
52 lines (47 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import React from 'react'
import cx from 'classnames'
import { HeadingLink } from 'components/article/HeadingLink'
import { ChangelogItemT } from './types'
import styles from 'components/ui/MarkdownContent/MarkdownContent.module.scss'
type Props = {
changelogItems: ChangelogItemT[]
}
export function Changelog({ changelogItems }: Props) {
const changes = changelogItems.map((item) => {
const heading = `Schema changes for ${item.date}`
return (
<div key={item.date}>
<HeadingLink as="h2">{heading}</HeadingLink>
{(item.schemaChanges || []).map((change, index) => (
<React.Fragment key={index}>
<p>{change.title}</p>
<ul>
{change.changes.map((change) => (
<li key={change} dangerouslySetInnerHTML={{ __html: change }} />
))}
</ul>
</React.Fragment>
))}
{(item.previewChanges || []).map((change, index) => (
<React.Fragment key={index}>
<p>{change.title}</p>
<ul>
{change.changes.map((change) => (
<li key={change} dangerouslySetInnerHTML={{ __html: change }} />
))}
</ul>
</React.Fragment>
))}
{(item.upcomingChanges || []).map((change, index) => (
<React.Fragment key={index}>
<p>{change.title}</p>
{change.changes.map((change) => (
<li key={change} dangerouslySetInnerHTML={{ __html: change }} />
))}
</React.Fragment>
))}
</div>
)
})
return <div className={cx(styles.markdownBody)}>{changes}</div>
}