Skip to content

Commit 548d2cb

Browse files
codeBox height
1 parent 36064ab commit 548d2cb

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

website/docs/destinations/event_mapping.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ to a `WalkerOS.Property`.
153153
Loops over the first parameter and maps the second to the current value. It is
154154
used for creating an array of dynamic length.
155155

156-
<DestinationPush event={{ nested: event.nested }}>
156+
<DestinationPush event={{ nested: event.nested }} height={'256px'}>
157157
{`{
158158
data: {
159159
loop: ['nested', 'data.name']

website/src/components/molecules/codeBox.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ interface CodeBoxProps {
3939
language?: string;
4040
inline?: boolean;
4141
className?: string;
42+
height?: number;
4243
}
4344

4445
const CodeBox: React.FC<CodeBoxProps> = ({
@@ -48,6 +49,7 @@ const CodeBox: React.FC<CodeBoxProps> = ({
4849
disabled = false,
4950
language = 'javascript',
5051
className = '',
52+
height,
5153
}) => {
5254
const highlightCode = (code: string) => (
5355
<Highlight theme={prismThemes.palenight} code={code} language={language}>
@@ -68,6 +70,7 @@ const CodeBox: React.FC<CodeBoxProps> = ({
6870
return (
6971
<div
7072
className={`border border-base-300 rounded-lg overflow-hidden bg-gray-800 text-sm ${className}`}
73+
style={height && { height: `${height}` }}
7174
>
7275
{label && (
7376
<div className="font-bold px-2 py-1 bg-base-100 text-base">{label}</div>

website/src/components/organisms/mapping.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ interface MappingProps {
2020
labelMiddle?: string;
2121
labelRight?: string;
2222
showMiddle?: boolean;
23+
height?: number;
2324
}
2425

2526
const Mapping: React.FC<MappingProps> = memo(
@@ -34,6 +35,7 @@ const Mapping: React.FC<MappingProps> = memo(
3435
labelMiddle = 'Custom Config',
3536
labelRight = 'Result',
3637
showMiddle = true,
38+
height,
3739
}) => {
3840
const [left, setLeft] = useState(initLeft);
3941
const [middle, setMiddle] = useState(initMiddle);
@@ -80,6 +82,7 @@ const Mapping: React.FC<MappingProps> = memo(
8082
value={left}
8183
onChange={setLeft}
8284
className={boxClassNames}
85+
height={height}
8386
/>
8487

8588
{showMiddle && (
@@ -88,6 +91,7 @@ const Mapping: React.FC<MappingProps> = memo(
8891
value={middle}
8992
onChange={setMiddle}
9093
className={boxClassNames}
94+
height={height}
9195
/>
9296
)}
9397

@@ -96,6 +100,7 @@ const Mapping: React.FC<MappingProps> = memo(
96100
disabled
97101
value={right[0] || 'No event yet.'}
98102
className={boxClassNames}
103+
height={height}
99104
/>
100105
</div>
101106
</div>

website/src/components/templates/destination.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,14 @@ interface DestinationPushProps {
102102
event: WalkerOS.PartialEvent;
103103
mapping?: Mapping.EventConfig | string;
104104
children?: React.ReactNode;
105+
height?: number;
105106
}
106107

107108
export const DestinationPush: React.FC<DestinationPushProps> = ({
108109
event,
109110
mapping = {},
110111
children,
112+
height,
111113
}) => {
112114
const { customConfig, destination, fnName } = useDestinationContext();
113115
const middleValue = children ?? mapping;
@@ -152,6 +154,7 @@ export const DestinationPush: React.FC<DestinationPushProps> = ({
152154
middle={formatValue(middleValue)}
153155
fn={mappingFn}
154156
options={customConfig}
157+
height={height}
155158
/>
156159
);
157160
};

0 commit comments

Comments
 (0)