Skip to content

Commit

Permalink
add new icons for panel chooser
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgulia1 committed Nov 17, 2020
1 parent 5f1204b commit 3ee30e0
Show file tree
Hide file tree
Showing 11 changed files with 344 additions and 38 deletions.
2 changes: 1 addition & 1 deletion src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export AccordionBlockEdit from './manage/Blocks/Accordion/Edit';
export AccordionBlockView from './manage/Blocks/Accordion/View';
export AccordionBlockSchema from './manage/Blocks/Accordion/Schema';

export { options } from './manage/Blocks/Accordion/layout';
export { options } from './manage/Blocks/Accordion/panels';
28 changes: 5 additions & 23 deletions src/components/manage/Blocks/Accordion/Edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,15 @@ import InlineForm from '@plone/volto/components/manage/Form/InlineForm';
import { accordionBlockSchema } from './Schema';
import AccordionEdit from './AccordionEdit';
import EditBlockWrapper from './EditBlockWrapper';
import Layout from './Layout.jsx';
import Panels from './Panels.jsx';
import { empty, getColumns } from './util';
import { options } from './layout';
import { options } from './panels';
import './editor.less';
import upSVG from '@plone/volto/icons/up.svg';
import tuneSVG from '@plone/volto/icons/tune.svg';

const Edit = (props) => {
const {
block,
data,
onChangeBlock,
pathname,
selected,
data: { display },
} = props;
const { block, data, onChangeBlock, pathname, selected } = props;

const metadata = props.metadata || props.properties;
const properties = isEmpty(data?.data?.blocks)
Expand Down Expand Up @@ -67,19 +60,8 @@ const Edit = (props) => {

return (
<section className="section-block">
{!display && Object.keys(data).length === 1 ? (
<Layout
variants={options}
data={data}
onChange={(initialData) => {
onChangeBlock(block, {
...data,
...createPanes(initialData),
});
}}
/>
) : display && Object.keys(data).length === 2 ? (
<Layout
{Object.keys(data).length === 1 ? (
<Panels
variants={options}
data={data}
onChange={(initialData) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { Segment, Card } from 'semantic-ui-react';
import { Icon } from '@plone/volto/components';
import './editor.less';

export default ({ data, onChange, children, variants }) => {
return (
Expand All @@ -9,8 +10,8 @@ export default ({ data, onChange, children, variants }) => {
<Card.Group centered itemsPerRow={3}>
{variants.map(({ icon, defaultData, title }, index) => (
<Card key={index} onClick={() => onChange(defaultData)}>
<Card.Content>
<Icon name={icon} size="55" />
<Card.Content textAlign={'center'}>
<Icon name={icon} size="88" className={'panel-icon'} />
{title ? <p>{title}</p> : ''}
</Card.Content>
</Card>
Expand Down
4 changes: 4 additions & 0 deletions src/components/manage/Blocks/Accordion/editor.less
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@
.input-accordion-title {
width: 100%;
}

.panel-icon {
width: 100%;
}
67 changes: 67 additions & 0 deletions src/components/manage/Blocks/Accordion/icons/circle-bottom.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
165 changes: 165 additions & 0 deletions src/components/manage/Blocks/Accordion/icons/five-circle-bottom.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions src/components/manage/Blocks/Accordion/icons/full-column.svg

This file was deleted.

0 comments on commit 3ee30e0

Please sign in to comment.