mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-25 07:47:55 +01:00
24 lines
785 B
React
24 lines
785 B
React
|
import Component from '../Component';
|
||
|
|
||
|
export default class Cell extends Component {
|
||
|
view(vnode) {
|
||
|
const spans = [];
|
||
|
for (const device of ['desktop', 'tablet', 'phone']) {
|
||
|
const key = `columnspan-${device}`;
|
||
|
if (this.attrs.has(key)) {
|
||
|
spans.push(`mdc-layout-grid__cell--span-${this.attrs.get(key)}-${device}`);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
this.attrs.addClassNames('mdc-layout-grid__cell', {
|
||
|
[`mdc-layout-grid__cell--span-${this.attrs.columnspan}`]: this.attrs.has('columnspan'),
|
||
|
[`mdc-layout-grid__cell--order-${this.attrs.get('order')}`]: this.attrs.has('order'),
|
||
|
[`mdc-layout-grid__cell--align-${this.attrs.get('align')}`]: this.attrs.has('align')
|
||
|
}, spans);
|
||
|
|
||
|
return <div {...this.attrs.all()}>
|
||
|
{vnode.children}
|
||
|
</div>;
|
||
|
}
|
||
|
}
|