ghost-portal/packages/ui-app/src/CardGrid.tsx
Jaco Greeff ba6b0c6df7
Basic council overview (#1267)
* Cleanup styles for staking

* Basic council members list

* AddressRow adjustments

* Less-spacy rows

* Adjust after merge

* Move accounts to first tranch

* s/council/members/

* Update CardGrid.tsx

* Remove any on styled props

* Small readability tweak
2019-06-04 10:04:14 +02:00

67 lines
1.3 KiB
TypeScript

// Copyright 2017-2019 @polkadot/ui-app authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import React from 'react';
import styled from 'styled-components';
type Props = {
buttons?: React.ReactNode,
children: React.ReactNode,
className?: string
};
class CardGrid extends React.PureComponent<Props> {
render () {
const { buttons, children, className } = this.props;
return (
<div className={className}>
{buttons && (
<div className='ui--CardGrid-buttons'>
{buttons}
</div>
)}
<div className='ui--CardGrid-grid'>
{children}
<div className='ui--CardGrid-spacer' />
</div>
</div>
);
}
}
export default styled(CardGrid)`
.ui--CardGrid-grid {
display: flex;
flex-wrap: wrap;
> .ui--CardGrid-spacer {
flex: 1 1;
margin: 0.25rem;
padding: 1rem 1.5rem;
}
}
.ui--Card {
flex: 1 1;
min-width: 24%;
max-width: 24%;
@media (max-width: 2060px) {
min-width: 32%;
max-width: 32%;
}
@media (max-width: 1580px) {
min-width: 49%;
max-width: 49%;
}
@media (max-width: 1100px) {
min-width: 100%;
max-width: 100%;
}
}
`;