Skip to content

Commit

Permalink
Make format
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaspiterek committed Jan 8, 2024
1 parent ee703f3 commit d7aff5f
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 48 deletions.
6 changes: 3 additions & 3 deletions src/components/Data.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BlockDataForm } from "@plone/volto/components";
import { QuoteBlockSchema } from "./schema";
import React from "react";
import { BlockDataForm } from '@plone/volto/components';
import { QuoteBlockSchema } from './schema';
import React from 'react';

const QuoteBlockData = (props) => {
const { data, block, onChangeBlock, contentType, navRoot } = props;
Expand Down
8 changes: 4 additions & 4 deletions src/components/Edit.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import QuoteBlockSidebar from "./Data";
import React from "react";
import { SidebarPortal } from "@plone/volto/components";
import View from "./View";
import QuoteBlockSidebar from './Data';
import React from 'react';
import { SidebarPortal } from '@plone/volto/components';
import View from './View';

const Edit = (props) => {
const { data, block, onChangeBlock, selected } = props;
Expand Down
12 changes: 6 additions & 6 deletions src/components/View.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import config from "@plone/volto/registry";
import { flattenToAppURL } from "@plone/volto/helpers";
import cx from "classnames";
import React from 'react';
import config from '@plone/volto/registry';
import { flattenToAppURL } from '@plone/volto/helpers';
import cx from 'classnames';

const View = (props) => {
const { data } = props;
Expand All @@ -11,9 +11,9 @@ const View = (props) => {
<div className="inner-wrapper">
{config?.blocks?.blocksConfig?.quote.showImageField &&
data?.image?.[0] && (
<div className={cx("image-wrapper", `align-${data.alignment}`)}>
<div className={cx('image-wrapper', `align-${data.alignment}`)}>
<img
src={`${flattenToAppURL(data?.image[0]["@id"])}/${
src={`${flattenToAppURL(data?.image[0]['@id'])}/${
data?.image[0]?.image_scales?.image[0]?.scales?.preview
?.download
}}`}
Expand Down
54 changes: 27 additions & 27 deletions src/components/schema.js
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
import config from "@plone/volto/registry";
import { defineMessages } from "react-intl";
import config from '@plone/volto/registry';
import { defineMessages } from 'react-intl';

const messages = defineMessages({
quote: {
id: "Quote",
defaultMessage: "Quote",
id: 'Quote',
defaultMessage: 'Quote',
},
image: {
id: "Image",
defaultMessage: "Image",
id: 'Image',
defaultMessage: 'Image',
},
name: {
id: "Name",
defaultMessage: "Name",
id: 'Name',
defaultMessage: 'Name',
},
additionalData: {
id: "Additional data",
defaultMessage: "Additional data",
id: 'Additional data',
defaultMessage: 'Additional data',
},
alignment: {
id: "Alignment",
defineMessage: "Alignment",
id: 'Alignment',
defineMessage: 'Alignment',
},
});

export const QuoteBlockSchema = ({ intl }) => {
return {
title: intl.formatMessage(messages.quote),
block: "quote",
block: 'quote',
fieldsets: [
{
id: "default",
title: "Default",
id: 'default',
title: 'Default',
fields: config?.blocks?.blocksConfig?.quote.showImageField
? ["quote", "image", "alignment"]
: ["quote"],
? ['quote', 'image', 'alignment']
: ['quote'],
},
{
id: "person",
title: "Person",
fields: ["person", "additionalData"],
id: 'person',
title: 'Person',
fields: ['person', 'additionalData'],
},
],
properties: {
quote: {
title: intl.formatMessage(messages.quote),
widget: "textarea",
widget: 'textarea',
},
image: {
title: intl.formatMessage(messages.image),
widget: "object_browser",
mode: "image",
widget: 'object_browser',
mode: 'image',
allowExternals: true,
selectedItemAttrs: ["image_field", "image_scales"],
selectedItemAttrs: ['image_field', 'image_scales'],
},
person: {
title: intl.formatMessage(messages.name),
Expand All @@ -62,9 +62,9 @@ export const QuoteBlockSchema = ({ intl }) => {
},
alignment: {
title: intl.formatMessage(messages.alignment),
widget: "align",
actions: ["left", "center", "right"],
default: "center",
widget: 'align',
actions: ['left', 'center', 'right'],
default: 'center',
},
},
required: [],
Expand Down
16 changes: 8 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import "./theme/main.less";
import './theme/main.less';

import QuoteBlockEdit from "./components/Edit";
import { QuoteBlockSchema } from "./components/schema";
import QuoteBlockView from "./components/View";
import quoteSVG from "@plone/volto/icons/quote.svg";
import QuoteBlockEdit from './components/Edit';
import { QuoteBlockSchema } from './components/schema';
import QuoteBlockView from './components/View';
import quoteSVG from '@plone/volto/icons/quote.svg';

const applyConfig = (config) => {
config.blocks.blocksConfig.quote = {
id: "quote",
title: "Quote",
group: "text",
id: 'quote',
title: 'Quote',
group: 'text',
icon: quoteSVG,
view: QuoteBlockView,
edit: QuoteBlockEdit,
Expand Down

0 comments on commit d7aff5f

Please sign in to comment.