Skip to content

Instantly share code, notes, and snippets.

@jsmanifest
Created April 14, 2020 15:03
Show Gist options
  • Save jsmanifest/eed618be46c0b4c0843494866e6f96d9 to your computer and use it in GitHub Desktop.
Save jsmanifest/eed618be46c0b4c0843494866e6f96d9 to your computer and use it in GitHub Desktop.
function App() {
const [collapsed, setCollapsed] = React.useState(true)
function toggle() {
setCollapsed((prevValue) => !prevValue)
}
const pediatricians = [
'Michael Lopez',
'Sally Tran',
'Brian Lu',
'Troy Sakulbulwanthana',
'Lisa Wellington',
]
const psychiatrists = [
'Miguel Rodriduez',
'Cassady Campbell',
'Mike Torrence',
]
const limit = 3
function BeautifulListContainer({ children }) {
return (
<div
style={{
background: 'teal',
padding: 12,
borderRadius: 4,
color: '#fff',
}}
>
{children}
Today is: {new Date().toDateString()}
</div>
)
}
return (
<div className="root">
<div className="listContainer">
<List
component={BeautifulListContainer}
collapsed={collapsed}
toggle={toggle}
header={null}
label="Bidders"
items={pediatricians}
limit={limit}
/>
</div>
<div className="listContainer">
<List header="Bids on" label="Bidders" items={psychiatrists} />
</div>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment