Skip to content

Commit

Permalink
fix styles
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-bellenghi committed Aug 21, 2024
1 parent 7ee6a6a commit d627841
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 342 deletions.
2 changes: 1 addition & 1 deletion packages/volto-blocks/locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ msgstr ""
msgid "Text"
msgstr ""

#. Default: "Header text"
#. Default: "Type header text..."
#: components/blocks/IconsAndText/EditItem
msgid "Text placeholder"
msgstr ""
Expand Down
2 changes: 1 addition & 1 deletion packages/volto-blocks/locales/it/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ msgstr ""
msgid "Text"
msgstr "Testo"

#. Default: "Header text"
#. Default: "Type header text..."
#: components/blocks/IconsAndText/EditItem
msgid "Text placeholder"
msgstr ""
Expand Down
4 changes: 2 additions & 2 deletions packages/volto-blocks/locales/volto.pot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Plone\n"
"POT-Creation-Date: 2024-08-20T14:58:49.661Z\n"
"POT-Creation-Date: 2024-08-21T08:58:57.178Z\n"
"Last-Translator: Plone i18n <[email protected]>\n"
"Language-Team: Plone i18n <[email protected]>\n"
"Content-Type: text/plain; charset=utf-8\n"
Expand Down Expand Up @@ -42,7 +42,7 @@ msgstr ""
msgid "Text"
msgstr ""

#. Default: "Header text"
#. Default: "Type header text..."
#: components/blocks/IconsAndText/EditItem
msgid "Text placeholder"
msgstr ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export default function Edit(props: IconsAndTextEditProps) {
}

const Container = config.getComponent('Container').component || 'div';
const Image = config.getComponent('Image').component;

return (
<>
Expand All @@ -69,7 +68,6 @@ export default function Edit(props: IconsAndTextEditProps) {
className={cx(
styles['block-content-header'],
styles['header-align-center'],
styles['image-wrapper'],
)}
>
<TextEditorWidget
Expand Down Expand Up @@ -166,10 +164,10 @@ export default function Edit(props: IconsAndTextEditProps) {
const messages = defineMessages({
title: {
id: 'Title',
defaultMessage: 'Title',
defaultMessage: 'Title...',
},
text: {
id: 'Text',
defaultMessage: 'Text',
defaultMessage: 'Type text...',
},
});
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import cx from 'classnames';
import { defineMessages, useIntl } from 'react-intl';

import type { ArrayElement } from '@plone/types';
import { UniversalLink } from '@plone/volto/components';
import { flattenToAppURL } from '@plone/volto/helpers';
import type { IconsAndTextData } from '@redturtle/volto-blocks/components/blocks/IconsAndText/schema';
import styles from '@redturtle/volto-blocks/components/blocks/IconsAndText/styles.module.scss';
import { TextEditorWidget } from '@redturtle/volto-rt-slate';
import cx from 'classnames';
import { defineMessages, useIntl } from 'react-intl';

type Props = {
data: ArrayElement<IconsAndTextData['columns']>;
Expand All @@ -18,7 +17,6 @@ type Props = {

export default function EditItem({
data,
index,
focusOn,
setFocusOn,
onChange,
Expand All @@ -30,7 +28,6 @@ export default function EditItem({
if (__SERVER__) {
return <div />;
}
console.log(data.dividerPosition);
return (
<div
className={cx(
Expand Down Expand Up @@ -64,7 +61,7 @@ export default function EditItem({
)}

{data.headerTextPosition && (
<div className="header-text">
<div className={cx(styles['header-text'])}>
<TextEditorWidget
className={cx(styles['column-title'])}
as="h3"
Expand Down Expand Up @@ -131,14 +128,14 @@ export default function EditItem({
const messages = defineMessages({
title: {
id: 'Title',
defaultMessage: 'Title',
defaultMessage: 'Title...',
},
text: {
id: 'Text',
defaultMessage: 'Text',
defaultMessage: 'Type Text...',
},
textPlaceholder: {
id: 'Text placeholder',
defaultMessage: 'Header text',
defaultMessage: 'Type header text...',
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ export default function View({ data, className, style }: Props) {
const column_number = data.column_number ? parseInt(data.column_number) : 3;

const Container = config.getComponent('Container').component || 'div';
const Image = config.getComponent('Image').component;

return (
<>
<section
className={cx('block-icons-text', styles.block_icons_text)}
className={cx('block block-icons-text', styles.block_icons_text)}
aria-label={data.title}
>
<Container className={cx('block-iconsandtext-container')}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import cx from 'classnames';
import { useIntl } from 'react-intl';

import type { ArrayElement } from '@plone/types';
import { TextBlockView } from '@plone/volto-slate/blocks/Text';
Expand All @@ -8,22 +7,12 @@ import { flattenToAppURL } from '@plone/volto/helpers';
import type { IconsAndTextData } from '@redturtle/volto-blocks/components/blocks/IconsAndText/schema';
import styles from '@redturtle/volto-blocks/components/blocks/IconsAndText/styles.module.scss';

// XXX Queste con ? servono in view?
type Props = {
data: ArrayElement<IconsAndTextData['columns']>;
focusOn: string;
setFocusOn: Function;
onChange: (id: string, field: string, value: unknown) => void;
selected: boolean;
};

export default function ViewItem({
data,
focusOn,
setFocusOn,
onChange,
selected,
}: Props) {
const intl = useIntl();
export default function ViewItem({ data }: Props) {
const icon = data.iconImage;

return (
Expand Down Expand Up @@ -57,9 +46,8 @@ export default function ViewItem({
/>
</div>
)}

{data.headerTextPosition && (
<div className="header-text">
<div className={cx(styles['header-text'])}>
{data.title && (
<h3
className={cx('block-iconsandtext-title title', styles.title)}
Expand All @@ -71,7 +59,7 @@ export default function ViewItem({
)}
</div>
{data.title && (
<div className="column-title">
<div className={cx(styles['column-title'])}>
{data.title && (
<h4 className={cx('block-iconsandtext-column-title', styles.title)}>
{data.title}
Expand Down
Loading

0 comments on commit d627841

Please sign in to comment.