Skip to content

Commit

Permalink
Feature/dao 368 aragon UI accordion should accept mode (#839)
Browse files Browse the repository at this point in the history
* test list view height calculation

* pass mode along to dataview

* add missing mode prop

* revert changes back to master branch

* fix github action error due to outdated yarn.lock file
  • Loading branch information
yuetloo authored Jun 4, 2021
1 parent 9947758 commit f846e0f
Show file tree
Hide file tree
Showing 2 changed files with 402 additions and 251 deletions.
9 changes: 8 additions & 1 deletion src/components/Accordion/Accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import React, { useCallback, useMemo } from 'react'
import PropTypes from 'prop-types'
import DataView from '../DataView/DataView'

const Accordion = React.memo(function Accordion({ items, className, style }) {
const Accordion = React.memo(function Accordion({
items,
className,
style,
mode,
}) {
const fields = useMemo(() => [null], [])
const renderEntry = useCallback(([row]) => [row], [])
const renderEntryExpansion = useCallback(
Expand All @@ -19,6 +24,7 @@ const Accordion = React.memo(function Accordion({ items, className, style }) {
renderEntry={renderEntry}
renderEntryExpansion={renderEntryExpansion}
style={style}
mode={mode}
/>
)
})
Expand All @@ -31,6 +37,7 @@ Accordion.propTypes = {
className: PropTypes.string,
items: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.node)).isRequired,
style: PropTypes.object,
mode: PropTypes.oneOf(['adaptive', 'table', 'list']),
}

export default Accordion
Loading

0 comments on commit f846e0f

Please sign in to comment.