Skip to content

Commit

Permalink
refactor(quote): Rename sourceInfo field to extra
Browse files Browse the repository at this point in the history
  • Loading branch information
avoinea committed May 19, 2022
1 parent 3261f27 commit 51a9e32
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/Blocks/Quote/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default (props) => {
? ['value']
: []),
'source',
'sourceInfo',
'extra',
],
},
],
Expand All @@ -34,8 +34,8 @@ export default (props) => {
title: 'Source',
widget: 'slate',
},
sourceInfo: {
title: 'Source info',
extra: {
title: 'Extra info',
widget: 'slate',
},
},
Expand Down
10 changes: 5 additions & 5 deletions src/Blocks/Quote/variations/DefaultQuote.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const Quote = (props) => {
onFocusPreviousBlock,
onSelectBlock,
} = props;
const { value, source, sourceInfo, position = null, reversed = false } = data;
const { value, source, extra, position = null, reversed = false } = data;
const floated = isFloated(position);

const withBlockProperties = React.useCallback(
Expand Down Expand Up @@ -108,8 +108,8 @@ const Quote = (props) => {
{reversed && source && (
<Quote.Source>{serializeText(source)}</Quote.Source>
)}
{reversed && sourceInfo && (
<Quote.SourceInfo>{serializeText(sourceInfo)}</Quote.SourceInfo>
{reversed && extra && (
<Quote.SourceInfo>{serializeText(extra)}</Quote.SourceInfo>
)}
{mode === 'edit' && !floated ? (
<Quote.Quote icons={icons}>
Expand Down Expand Up @@ -139,8 +139,8 @@ const Quote = (props) => {
{!reversed && source && (
<Quote.Source>{serializeText(source)}</Quote.Source>
)}
{!reversed && sourceInfo && (
<Quote.SourceInfo>{serializeText(sourceInfo)}</Quote.SourceInfo>
{!reversed && extra && (
<Quote.SourceInfo>{serializeText(extra)}</Quote.SourceInfo>
)}
</div>
</blockquote>
Expand Down
4 changes: 2 additions & 2 deletions src/Blocks/Quote/variations/TestimonialQuote.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const Testimonial = (props) => {
onFocusPreviousBlock,
onSelectBlock,
} = props;
const { value, source, sourceInfo, image, title } = data;
const { value, source, extra, image, title } = data;

const withBlockProperties = React.useCallback(
(editor) => {
Expand Down Expand Up @@ -107,7 +107,7 @@ const Testimonial = (props) => {
: image || DefaultImageSVG
}
title={source}
description={sourceInfo}
description={extra}
/>
<Testimonial.Content>
{title && (
Expand Down
2 changes: 1 addition & 1 deletion src/Blocks/Quote/variations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default [
...schema.properties,
title: {
title: 'Title',
widget: 'slate_richtext',
widget: 'slate',
},
image: {
title: 'Image',
Expand Down

0 comments on commit 51a9e32

Please sign in to comment.