Skip to content

Commit af784fa

Browse files
committed
Switch createIconComponent usage to union
1 parent 085725c commit af784fa

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

packages/fluent-theme/src/components/icon/FluentIcon.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useStyles } from '@msinternal/botframework-webchat-styles/react';
33
import { createIconComponent } from 'botframework-webchat/internal';
44
import cx from 'classnames';
55
import React, { memo, useMemo, type CSSProperties } from 'react';
6-
import { object, optional, pipe, readonly, string, type InferInput } from 'valibot';
6+
import { object, optional, pipe, readonly, string, union, type InferInput } from 'valibot';
77

88
import styles from './FluentIcon.module.css';
99

@@ -37,13 +37,7 @@ const { component: FluentIcon, modifierPropsSchema } = createIconComponent(
3737

3838
FluentIcon.displayName = 'FluentIcon';
3939

40-
const fluentIconPropsSchema = pipe(
41-
object({
42-
...baseFluentIconPropsSchema.entries,
43-
...modifierPropsSchema.entries
44-
}),
45-
readonly()
46-
);
40+
const fluentIconPropsSchema = pipe(union([baseFluentIconPropsSchema, modifierPropsSchema]), readonly());
4741

4842
type FluentIconProps = InferInput<typeof fluentIconPropsSchema>;
4943

0 commit comments

Comments
 (0)