Skip to content

Instantly share code, notes, and snippets.

@jamiejohnsonkc
Last active November 3, 2020 17:33
Show Gist options
  • Select an option

  • Save jamiejohnsonkc/31814e0cf6217a755830a55d9bd84119 to your computer and use it in GitHub Desktop.

Select an option

Save jamiejohnsonkc/31814e0cf6217a755830a55d9bd84119 to your computer and use it in GitHub Desktop.
Mapping data within mapped data
/** @jsx jsx */
import { jsx, Box } from 'theme-ui'
import React from 'react'
import PropTypes from 'prop-types'
import ProgressBarGroup from '../ProgressBarGroup/ProgressBarGroup.jsx'
import LabeledProgressBar from '../../../../system/molecules/staticElements/LabeledProgressBar/LabeledProgressBar.jsx'
import Groups from '../progressBarData.js'
const App = ({
groupGridColumns,
groupsSubhead,
progressLabel,
done,
...props
}) => {
return (
<>
{Groups.map((group, id) => (
<ProgressBarGroup
key={id}
groupGridColumns={group.groupGridColumns}
groupSubhead={group.groupSubhead}
>
<Box>
{group.bars.map((bar, id) => (
<LabeledProgressBar
key={id}
progressLabel={bar.label}
done={bar.done}
/>
))}
</Box>
</ProgressBarGroup>
))}
</>
)
}
App.propTypes = {}
App.defaultProps = {}
export default App
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment