summaryrefslogtreecommitdiff
path: root/src/components/about-entry.js
blob: 553b5e527c2d81186938ba275d0959081118e8ac (plain)
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
import React from 'react'
import { css } from '@emotion/core'
import { margins } from './globals'

const aboutEntryStyle = css`
  margin: 0 0 ${margins.lg}px 0;
  & li {
    margin-bottom: ${margins.sm}px;
  }
`

export const AboutEntry = ({ headerMargin, listItems, header }) => {
  const headingStyle = css`
    margin: ${headerMargin || 0};
  `
  return (
    <article css={aboutEntryStyle}>
      <h2 css={headingStyle}>{header}</h2>
      {listItems ? (
        <ul>
          {listItems.map((item, i) => (
            <li key={`about-item-${i}`}>{item}</li>
          ))}
        </ul>
      ) : null}
    </article>
  )
}