Last active
November 3, 2020 17:33
-
-
Save jamiejohnsonkc/31814e0cf6217a755830a55d9bd84119 to your computer and use it in GitHub Desktop.
Mapping data within mapped data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** @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