Skip to content

Commit

Permalink
fix(masonry): remove any type in BrickWrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Karan-Palan committed Sep 6, 2024
1 parent bd52b37 commit f2d9c12
Showing 1 changed file with 64 additions and 4 deletions.
68 changes: 64 additions & 4 deletions modules/masonry/src/brick/design0/components/BrickWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,82 @@ interface BrickWrapperProps {
const BrickWrapper: React.FC<BrickWrapperProps> = ({ type, params }) => {
switch (type) {
case 'block': {
const instance = createBrickBlock(params as any);
const instance = createBrickBlock(
params as {
name: string;
label: string;
glyph: string;
args: { id: string; label: string }[];
colorBg: TColor;
colorFg: TColor;
colorBgHighlight: TColor;
colorFgHighlight: TColor;
outline: TColor;
scale: number;
connectAbove: boolean;
connectBelow: boolean;
nestLengthY: number;
folded?: boolean;
},
);
return <BrickBlockComponent instance={instance} />;
}

case 'data': {
const instance = createBrickData(params as any);
const instance = createBrickData(
params as {
name: string;
label: string;
glyph: string;
dynamic: boolean;
value?: boolean | number | string;
input?: 'boolean' | 'number' | 'string' | 'options';
colorBg: TColor;
colorFg: TColor;
colorBgHighlight: TColor;
colorFgHighlight: TColor;
outline: TColor;
scale: number;
},
);
return <BrickDataComponent instance={instance} />;
}

case 'expression': {
const instance = createBrickExpression(params as any);
const instance = createBrickExpression(
params as {
name: string;
label: string;
glyph: string;
args: Record<string, { label: string; dataType: string; meta: unknown }>;
colorBg: TColor;
colorFg: TColor;
colorBgHighlight: TColor;
colorFgHighlight: TColor;
outline: TColor;
scale: number;
},
);
return <BrickExpressionComponent instance={instance} />;
}

case 'statement': {
const instance = createBrickStatement(params as any);
const instance = createBrickStatement(
params as {
name: string;
label: string;
glyph: string;
args: Record<string, { label: string; dataType: string; meta: unknown }>;
colorBg: TColor;
colorFg: TColor;
colorBgHighlight: TColor;
colorFgHighlight: TColor;
outline: TColor;
scale: number;
connectAbove: boolean;
connectBelow: boolean;
},
);
return <BrickStatementComponent instance={instance} />;
}

Expand Down

0 comments on commit f2d9c12

Please sign in to comment.