Skip to content

Commit 1de33ce

Browse files
committed
feat: Quote Component 구현
1 parent 3681c38 commit 1de33ce

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

packages/notion-to-jsx/src/components/Renderer/components/Block/BlockRenderer.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
import { CodeBlock } from '../Code';
1010
import { Heading1, Heading2, Heading3, Paragraph } from '../Typography';
1111
import { ColumnList } from '../Column';
12+
import { Quote } from '../Quote';
1213

1314
export interface Props {
1415
block: any;
@@ -91,6 +92,9 @@ const BlockRenderer: React.FC<Props> = ({ block, onFocus, index }) => {
9192
// 개별 column은 ColumnList에서 처리됩니다
9293
return null;
9394

95+
case 'quote':
96+
return <Quote richText={block.quote.rich_text} {...blockProps} />;
97+
9498
default:
9599
console.log(`지원되지 않는 블록 타입: ${block.type}`, block);
96100
return null;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from 'react';
2+
import { MemoizedRichText } from '../MemoizedComponents';
3+
import { container } from './styles.css';
4+
5+
export interface QuoteProps {
6+
richText: any[];
7+
tabIndex?: number;
8+
}
9+
10+
const Quote: React.FC<QuoteProps> = ({ richText, tabIndex }) => {
11+
return (
12+
<blockquote className={container} tabIndex={tabIndex}>
13+
<MemoizedRichText richTexts={richText} />
14+
</blockquote>
15+
);
16+
};
17+
18+
export default Quote;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as Quote } from './Quote';
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { style } from '@vanilla-extract/css';
2+
3+
export const container = style({
4+
position: 'relative',
5+
margin: '0.5rem 0',
6+
padding: '0.25rem 0 0.25rem 1rem',
7+
borderLeft: '3px solid #e1e1e1',
8+
color: '#37352f',
9+
fontSize: '1rem',
10+
lineHeight: '1.5',
11+
fontStyle: 'italic',
12+
});

0 commit comments

Comments
 (0)