diff --git a/packages/volto-blocks/src/components/blocks/Accordion/EditItem.tsx b/packages/volto-blocks/src/components/blocks/Accordion/EditItem.tsx index 7d76927..c6259a6 100644 --- a/packages/volto-blocks/src/components/blocks/Accordion/EditItem.tsx +++ b/packages/volto-blocks/src/components/blocks/Accordion/EditItem.tsx @@ -1,14 +1,11 @@ -import { useState } from 'react'; import { useIntl, defineMessages } from 'react-intl'; import cx from 'classnames'; -import { Icon } from '@plone/volto/components'; import type { ArrayElement } from '@plone/types'; import { TextEditorWidget } from '@redturtle/volto-rt-slate'; import styles from '@redturtle/volto-blocks/components/blocks/Accordion/styles.module.css'; -import arrowUpSVG from '@redturtle/volto-blocks/icons/arrow-up.svg'; import type { AccordionData } from '@redturtle/volto-blocks/components/blocks/Accordion/schema'; type Props = { @@ -27,7 +24,6 @@ export default function EditItem({ selected, }: Props) { const intl = useIntl(); - const [collapsed, setCollapsed] = useState(true); if (__SERVER__) { return
; @@ -36,7 +32,7 @@ export default function EditItem({ return (
- - + setFocusOn('text' + data['@id'])} + onChangeBlock={(id: string, value: { text: string }) => { + onChange(id, 'text', value.text); + }} + placeholder={intl.formatMessage(messages.text)} + />
); } diff --git a/packages/volto-blocks/src/components/blocks/Accordion/ViewItem.tsx b/packages/volto-blocks/src/components/blocks/Accordion/ViewItem.tsx index 6b92998..bb50805 100644 --- a/packages/volto-blocks/src/components/blocks/Accordion/ViewItem.tsx +++ b/packages/volto-blocks/src/components/blocks/Accordion/ViewItem.tsx @@ -23,19 +23,27 @@ export default function EditItem({ data }: Props) { diff --git a/packages/volto-blocks/src/components/blocks/Accordion/styles.module.css b/packages/volto-blocks/src/components/blocks/Accordion/styles.module.css index e834e8d..66caf54 100644 --- a/packages/volto-blocks/src/components/blocks/Accordion/styles.module.css +++ b/packages/volto-blocks/src/components/blocks/Accordion/styles.module.css @@ -10,7 +10,27 @@ break-inside: avoid; } -@container (width > 700px) { +.itemTitle, +:global(.block) .itemTitle h3:last-child { + margin-top: 0; +} + +.button { + padding: 0; + border: 0; + background: 0 none; + cursor: pointer; +} + +.icon { + transition: 0.2s transform ease; +} + +:global(.collapsed).icon { + transform: scaleY(-1); +} + +@container (width < 700px) { .wrapper { column-count: 1; } diff --git a/packages/volto-blocks/src/icons/arrow-up.svg b/packages/volto-blocks/src/icons/arrow-up.svg index 2645bf9..8776fdf 100644 --- a/packages/volto-blocks/src/icons/arrow-up.svg +++ b/packages/volto-blocks/src/icons/arrow-up.svg @@ -1,3 +1,3 @@ - + \ No newline at end of file