Skip to content

Commit 3285d8b

Browse files
committed
Fix nits
1 parent 02b639b commit 3285d8b

File tree

6 files changed

+10
-13
lines changed

6 files changed

+10
-13
lines changed

packages/component/src/Icon/ComponentIcon.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { validateProps } from 'botframework-webchat-react-valibot';
22
import { useStyles } from 'botframework-webchat-styles/react';
33
import cx from 'classnames';
4-
import React from 'react';
4+
import React, { memo } from 'react';
55
import { object, optional, pipe, readonly, string, type InferInput } from 'valibot';
66

77
import createIconComponent from '../Utils/createIconComponent';
88
import styles from './ComponentIcon.module.css';
99

1010
const componentIconPropsSchema = pipe(
1111
object({
12+
appearance: optional(string()),
1213
className: optional(string()),
1314
icon: optional(string()),
14-
appearance: optional(string()),
1515
size: optional(string())
1616
}),
1717
readonly()
@@ -31,5 +31,5 @@ const ComponentIcon = createIconComponent(styles, BaseComponentIcon);
3131

3232
ComponentIcon.displayName = 'ComponentIcon';
3333

34-
export default ComponentIcon;
35-
export type { ComponentIconProps };
34+
export default memo(ComponentIcon);
35+
export { componentIconPropsSchema, type ComponentIconProps };

packages/component/src/SendBox/AttachmentBar/AttachmentBar.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
overflow-x: auto;
1313
}
1414

15-
.send-box-attachment-bar--box {
15+
.send-box-attachment-bar__box {
1616
gap: 4px;
1717
}
1818

packages/component/src/SendBox/AttachmentBar/AttachmentBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function SendBoxAttachmentBar(props: SendBoxAttachmentBarProps) {
5656
)}
5757
data-testid={testIds.sendBoxAttachmentBar}
5858
>
59-
<div className={classNames['send-box-attachment-bar--box']}>
59+
<div className={classNames['send-box-attachment-bar__box']}>
6060
{sendBoxAttachments.map((attachment, index) => (
6161
// eslint-disable-next-line react/no-array-index-key
6262
<AttachmentBarItem attachment={attachment} key={index} mode={mode} onDelete={handleAttachmentDelete} />

packages/component/src/SendBox/AttachmentBar/ItemDeleteButton.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { hooks } from 'botframework-webchat-api';
22
import { validateProps } from 'botframework-webchat-react-valibot';
33
import { useStyles } from 'botframework-webchat-styles/react';
4-
import cx from 'classnames';
54
import React, { KeyboardEventHandler, useCallback } from 'react';
65
import { function_, object, optional, pipe, readonly, string, type InferInput } from 'valibot';
76

@@ -25,7 +24,6 @@ type AttachmentDeleteButtonProps = InferInput<typeof attachmentDeleteButtonProps
2524
function AttachmentDeleteButton(props: AttachmentDeleteButtonProps) {
2625
const { attachmentName, onClick } = validateProps(attachmentDeleteButtonPropsSchema, props);
2726
const classNames = useStyles(styles);
28-
2927
const focus = useFocus();
3028
const localize = useLocalizer();
3129

@@ -43,7 +41,7 @@ function AttachmentDeleteButton(props: AttachmentDeleteButtonProps) {
4341
return (
4442
<button
4543
aria-label={localize('SEND_BOX_ATTACHMENT_BAR_DELETE_BUTTON_ALT', attachmentName)}
46-
className={cx(classNames['send-box-attachment-bar-item__delete-button'])}
44+
className={classNames['send-box-attachment-bar-item__delete-button']}
4745
data-testid={testIds.sendBoxAttachmentBarItemDeleteButton}
4846
onClick={onClick}
4947
onKeyDown={handleKeyDown}

packages/component/src/SendBox/AttachmentBar/Preview/ImagePreview.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { validateProps } from 'botframework-webchat-react-valibot';
22
import { useStyles } from 'botframework-webchat-styles/react';
3-
import cx from 'classnames';
43
import React, { memo } from 'react';
54
import { object, picklist, pipe, readonly, string, type InferInput } from 'valibot';
65

@@ -34,7 +33,7 @@ function SendBoxAttachmentBarItemImageAttachmentPreview(props: SendBoxAttachment
3433
) : (
3534
<img
3635
alt={attachmentName}
37-
className={cx(classNames['send-box-attachment-bar-item-image-preview'])}
36+
className={classNames['send-box-attachment-bar-item-image-preview']}
3837
src={attachment.thumbnailURL.href}
3938
/>
4039
);

packages/component/src/Utils/createIconComponent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useStyles } from 'botframework-webchat-styles/react';
22
import { validateProps } from 'botframework-webchat-react-valibot';
33
import cx from 'classnames';
44
import { object, optional, pipe, readonly, picklist } from 'valibot';
5-
import React from 'react';
5+
import React, { type ComponentType } from 'react';
66

77
type CSSModule = {
88
readonly [key: string | `${string}--${string}`]: any;
@@ -29,7 +29,7 @@ function createPropsSchema(styles: CSSModule) {
2929

3030
export default function createIconComponent<T extends { className?: string | undefined }>(
3131
styles: CSSModule,
32-
BaseIcon: React.ComponentType<T>
32+
BaseIcon: ComponentType<T>
3333
) {
3434
const propsSchema = createPropsSchema(styles);
3535
return (props => {

0 commit comments

Comments
 (0)