Skip to content

Commit

Permalink
WIP on columns
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Sep 22, 2020
1 parent 5685412 commit adbd733
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 0 deletions.
Empty file.
27 changes: 27 additions & 0 deletions src/ColumnsBlock/ColumnControls.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';
export default (props) => {
// selector for column sizes
return <div>25 33 50 66 75</div>;

// 25% 25% 50% 75%-> grid de 4 coloane
// 33% 66% -> grid de 3 coloane
//
//
// 4 coloane:
// 25 25 25 25
//
// 3 coloane
// 25 50 25
// 50 25 25
// 25 25 50
// 33 33 33
//
// 2 coloane
// 25 75
// 50 50
// 75 25
// 33 66
// 66 33
//
// 100% ---> pt mobile
};
7 changes: 7 additions & 0 deletions src/ColumnsBlock/ColumnsBlockEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import { emptyBlocksForm } from '@plone/volto/helpers';

import { ColumnsBlockSchema } from './schema';
import { getColumns, empty } from './utils';
import DeviceSelect from './DeviceSelect';
import ColumnControls from './ColumnControls';

import moreIcon from '@plone/volto/icons/more.svg';

import './styles.less';

Expand Down Expand Up @@ -58,6 +62,9 @@ class ColumnsBlockEdit extends React.Component {
return (
<>
<div className="columns-block">
<DeviceSelect />
<ColumnControls />
<hr class="splitter" />
{/* {<h3>{data.block_title}</h3>} */}
<Grid columns={columnList.length}>
{columnList.map(([colId, column], index) => {
Expand Down
17 changes: 17 additions & 0 deletions src/ColumnsBlock/DeviceSelect.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';

import { Icon } from '@plone/volto/components';

import computerIcon from './icons/desktop-computer.svg';
import mobileIcon from './icons/device-mobile.svg';
import tabletIcon from './icons/device-tablet.svg';

export default (props) => {
return (
<div>
<Icon name={computerIcon} size="18px" />
<Icon name={tabletIcon} size="18px" />
<Icon name={mobileIcon} size="18px" />
</div>
);
};
1 change: 1 addition & 0 deletions src/ColumnsBlock/icons/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Icons from MIT licensed https://github.com/tailwindlabs/heroicons
3 changes: 3 additions & 0 deletions src/ColumnsBlock/icons/desktop-computer.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/ColumnsBlock/icons/device-mobile.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/ColumnsBlock/icons/device-tablet.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/ColumnsBlock/icons/view-boards.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/ColumnsBlock/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
.block-column {
padding: 0.3em;
}

.splitter {
background-color: red;
height: 10px;
}

.block-column {
border-top: 4px solid gray;
border-radius: 6px;
padding: 0.3em 1em 0em 1em;
margin-top: 0.3em;
}
}

.drag-drop-list-widget {
Expand Down

0 comments on commit adbd733

Please sign in to comment.