Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions packages/markups/src/blocks/QuoteBlock.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
import React from 'react';
import PropTypes from 'prop-types';
import { useTheme } from '@embeddedchat/ui-elements';
import { css } from '@emotion/react';
import ParagraphBlock from './ParagraphBlock';

const QuoteBlock = ({ contents }) => (
<blockquote>
{contents.map((paragraph, index) => (
<ParagraphBlock key={index} contents={paragraph.value} />
))}
</blockquote>
);
const QuoteBlock = ({ contents }) => {
const { theme } = useTheme();
return (
<blockquote
css={css`
background-color: ${theme.colors.secondary};
border-left: 1.7px solid ${theme.colors.primary};
padding-left: 0.5rem;
`}
>
{contents.map((paragraph, index) => (
<ParagraphBlock key={index} contents={paragraph.value} />
))}
</blockquote>
);
};

export default QuoteBlock;

Expand Down
21 changes: 19 additions & 2 deletions packages/markups/src/elements/PlainSpan.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
import React from 'react';
import PropTypes from 'prop-types';
import { css } from '@emotion/react';
import { useTheme } from '@embeddedchat/ui-elements';

const PlainSpan = ({ contents }) => <>{contents}</>;

const PlainSpan = ({ contents }) => {
const { theme } = useTheme();
if (contents === '>') {
return (
<blockquote
css={css`
background-color: ${theme.colors.secondary};
border-left: 1.7px solid ${theme.colors.primary};
padding-left: 0.5rem;
`}
>
&nbsp;
</blockquote>
);
}
return <>{contents}</>;
};
export default PlainSpan;

PlainSpan.propTypes = {
Expand Down
Loading