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

Use Image from @plone/volto/components/theme/Image/Image instead of semantic-ui-react #6754

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wesleybl
Copy link
Member

This is part of #3592, to address #4290.

That PR is to make Volto run on a subpath. For example:

http://mydomain.com/site

The idea is to use react-router's basename property to prefix routes. However, it doesn't add a prefix to the src of the img tag. So, to solve this, the idea is to insert the prefix in the Image component of @plone/volto/components/theme/Image/Image. Then all Volto images would be rendered with the Volto component.

The Image component of semantic-ui-react generates an img tag. That's why we want to stop using it.

Some points of this PR:

  • The only thing that the size property of the Image of semantic-ui-react does is add a class to the img tag. So we use the className property of Volto's Image to simulate this behavior.

  • The semantic-ui-react Image adds the "ui" and "image" classes. So we use the className property of the Volto Image for this.

  • If you agree, we can use an eslint check to prevent the semantic-ui-react component from being used in the future.

Copy link

netlify bot commented Feb 14, 2025

Deploy Preview for plone-components canceled.

Name Link
🔨 Latest commit df4294f
🔍 Latest deploy log https://app.netlify.com/sites/plone-components/deploys/67af64fa3c89e60008f2741c

@wesleybl wesleybl changed the title Use Image from @plone/volto/components/theme/Image/Image instead of Use Image from @plone/volto/components/theme/Image/Image instead of semantic-ui-react Feb 14, 2025
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.

1 participant