File tree Expand file tree Collapse file tree 4 files changed +18
-3
lines changed
Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ section of the mapping.
5151}
5252```
5353
54- <DestinationPush event = { event } height = { ' 666px' } eventConfig = { false } >
54+ <DestinationPush event = { event } height = { ' 666px' } labelMiddle = { ' Config ' } eventConfig = { false } smallText = { true } >
5555 { ` {
5656 order: {
5757 complete: {
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ interface CodeBoxProps {
4040 inline ?: boolean ;
4141 className ?: string ;
4242 height ?: number ;
43+ smallText ?: boolean ;
4344}
4445
4546const CodeBox : React . FC < CodeBoxProps > = ( {
@@ -50,6 +51,7 @@ const CodeBox: React.FC<CodeBoxProps> = ({
5051 language = 'javascript' ,
5152 className = '' ,
5253 height,
54+ smallText = false ,
5355} ) => {
5456 const highlightCode = ( code : string ) => (
5557 < Highlight theme = { prismThemes . palenight } code = { code } language = { language } >
@@ -69,7 +71,7 @@ const CodeBox: React.FC<CodeBoxProps> = ({
6971
7072 return (
7173 < div
72- className = { `border border-base-300 rounded-lg overflow-hidden bg-gray-800 text-sm ${ className } ` }
74+ className = { `border border-base-300 rounded-lg overflow-hidden bg-gray-800 ${ smallText ? ' text-xs' : 'text-sm' } ${ className } ` }
7375 style = { height && { height : `${ height } ` } }
7476 >
7577 { label && (
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ interface MappingProps {
2121 labelRight ?: string ;
2222 showMiddle ?: boolean ;
2323 height ?: number ;
24+ smallText ?: boolean ;
25+ className ?: string ;
2426}
2527
2628const Mapping : React . FC < MappingProps > = memo (
@@ -36,6 +38,8 @@ const Mapping: React.FC<MappingProps> = memo(
3638 labelRight = 'Result' ,
3739 showMiddle = true ,
3840 height,
41+ smallText,
42+ className,
3943 } ) => {
4044 const [ left , setLeft ] = useState ( initLeft ) ;
4145 const [ middle , setMiddle ] = useState ( initMiddle ) ;
@@ -72,7 +76,7 @@ const Mapping: React.FC<MappingProps> = memo(
7276 updateRight ( left , middle , options ) ;
7377 } , [ left , middle , options ] ) ;
7478
75- const boxClassNames = ' flex-1 resize max-h-96 xl:max-h-full flex flex-col' ;
79+ const boxClassNames = ` flex-1 resize max-h-96 xl:max-h-full flex flex-col ${ className } ` ;
7680
7781 return (
7882 < div className = "my-4" >
@@ -83,6 +87,7 @@ const Mapping: React.FC<MappingProps> = memo(
8387 onChange = { setLeft }
8488 className = { boxClassNames }
8589 height = { height }
90+ smallText = { smallText }
8691 />
8792
8893 { showMiddle && (
@@ -92,6 +97,7 @@ const Mapping: React.FC<MappingProps> = memo(
9297 onChange = { setMiddle }
9398 className = { boxClassNames }
9499 height = { height }
100+ smallText = { smallText }
95101 />
96102 ) }
97103
@@ -101,6 +107,7 @@ const Mapping: React.FC<MappingProps> = memo(
101107 value = { right [ 0 ] || 'No event yet.' }
102108 className = { boxClassNames }
103109 height = { height }
110+ smallText = { smallText }
104111 />
105112 </ div >
106113 </ div >
Original file line number Diff line number Diff line change @@ -103,6 +103,8 @@ interface DestinationPushProps {
103103 mapping ?: Mapping . EventConfig | string ;
104104 children ?: React . ReactNode ;
105105 height ?: number ;
106+ smallText ?: boolean ;
107+ className ?: string ;
106108 labelLeft ?: string ;
107109 labelMiddle ?: string ;
108110 labelRight ?: string ;
@@ -114,6 +116,8 @@ export const DestinationPush: React.FC<DestinationPushProps> = ({
114116 mapping = { } ,
115117 children,
116118 height,
119+ smallText,
120+ className,
117121 labelLeft,
118122 labelMiddle = 'Event Config' ,
119123 labelRight,
@@ -165,6 +169,8 @@ export const DestinationPush: React.FC<DestinationPushProps> = ({
165169 fn = { mappingFn }
166170 options = { customConfig }
167171 height = { height }
172+ smallText = { smallText }
173+ className = { className }
168174 labelLeft = { labelLeft }
169175 labelMiddle = { labelMiddle }
170176 labelRight = { labelRight }
You can’t perform that action at this time.
0 commit comments