Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support accordion block, description block, teaser block. Make tooltip component customizable. #14

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

ksuess
Copy link
Member

@ksuess ksuess commented Dec 20, 2024

No description provided.

@ksuess ksuess changed the title Support accordion block, description block, teaser block. Make tootip component customizable Support accordion block, description block, teaser block. Make tooltip component customizable. Dec 20, 2024
@ksuess ksuess linked an issue Dec 20, 2024 that may be closed by this pull request
Copy link
Collaborator

@mauritsvanrees mauritsvanrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I finally made time to test this. Yes, this works. Thanks!

I made a few inline suggestions for the documentation.

Question: you are saying to register a new view for the description block. I am used to customising the existing view by putting it in customizations/components/manage/Blocks/Description/View.tsx. I tried it, and both work. I wonder if the documentation should show this second method instead. I don't really mind, and don't know which would be better.

I wonder if the same approach could work for the title block, and also the titles of accordions and teasers. But the client has not asked about this yet, and maybe it is better this way.

Thanks!

```js
import { TextWithGlossaryTooltips } from '@rohberg/volto-slate-glossary/utils';

const DescriptionBlockView = ({ properties, metadata, id }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the configuration you set

config.blocks.blocksConfig.description.view = DescriptionBlockViewWithTooltips;

so the name here should be the same:

Suggested change
const DescriptionBlockView = ({ properties, metadata, id }) => {
const DescriptionBlockViewWithTooltips = ({ properties, metadata, id }) => {

README.md Show resolved Hide resolved
);
};

export default withBlockExtensions(TeaserView);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the blocks config you set teaser.view = TeaserViewWithTooltips, so that should be the item that is exported.

Suggested change
export default withBlockExtensions(TeaserView);
const TeaserViewWithTooltips = withBlockExtensions(TeaserView);
export default TeaserViewWithTooltips;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not all blocks show tooltips
2 participants