Skip to content

Commit

Permalink
fix quote's in testimonials
Browse files Browse the repository at this point in the history
  • Loading branch information
jnptk committed Apr 8, 2024
1 parent ed96e0a commit cb27728
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 3 deletions.
1 change: 1 addition & 0 deletions news/5.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix quote's in testimonials being typographically not correct. @jonaspiterek
13 changes: 11 additions & 2 deletions src/components/DefaultBody.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import config from '@plone/volto/registry';

const DefaultImage = (props) => <img {...props} alt={props.alt || ''} />;

const TestimonialsBody = ({ data, isActive }) => {
const TestimonialsBody = (props) => {
const { data, isActive, intl } = props;
const image = data.image?.[0];

const Image = config.getComponent('Image').component || DefaultImage;
Expand All @@ -18,7 +19,15 @@ const TestimonialsBody = ({ data, isActive }) => {
>
<div className="teaser-item top">
<div className="teaser-item-title fix-width-issue">
<p className="testimonial">"{data?.testimonial}"</p>
<p
className="testimonial"
lang={
data.testimonialLanguage !== intl.locale &&
data.testimonialLanguage
}
>
{data?.testimonial}
</p>
<div className="person">
<Image
item={image}
Expand Down
24 changes: 23 additions & 1 deletion src/components/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ const messages = defineMessages({
id: 'Testimonial',
defaultMessage: 'Testimonial',
},
testimonialLanguage: {
id: 'Language',
defaultMessage: 'Language',
},
image: {
id: 'Image',
defaultMessage: 'Image',
Expand All @@ -36,6 +40,11 @@ const messages = defineMessages({
id: 'Add item',
defaultMessage: 'Add item',
},
description: {
id: 'This field is not exposed, it is only used by accessibility tools to provide a better experience.',
defaultMessage:
'This field is not exposed, it is only used by accessibility tools to provide a better experience.',
},
});

export const itemSchema = (props) =>
Expand All @@ -47,7 +56,13 @@ export const itemSchema = (props) =>
{
id: 'default',
title: 'Default',
fields: ['testimonial', 'image', 'name', 'additionalData'],
fields: [
'testimonial',
'image',
'name',
'additionalData',
'testimonialLanguage',
],
},
],

Expand All @@ -68,6 +83,13 @@ export const itemSchema = (props) =>
additionalData: {
title: props.intl.formatMessage(messages.additionalData),
},
testimonialLanguage: {
title: props.intl.formatMessage(messages.testimonialLanguage),
vocabulary: {
'@id': 'plone.app.vocabularies.SupportedContentLanguages',
},
description: props.intl.formatMessage(messages.description),
},
},
required: [],
},
Expand Down
30 changes: 30 additions & 0 deletions src/theme/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,36 @@
--slider-dots-bg: #ececec;
}

html {
&[lang='de'] {
.block.testimonials {
p.testimonial {
&::before {
content: '';
}

&::after {
content: '';
}
}
}
}

&[lang='en'] {
.block.testimonials {
p.testimonial {
&::before {
content: '"';
}

&::after {
content: '"';
}
}
}
}
}

.testimonials-wrapper {
position: relative;
overflow: hidden;
Expand Down

0 comments on commit cb27728

Please sign in to comment.