Skip to content

Commit 9515dee

Browse files
committed
fix tests
1 parent cfde709 commit 9515dee

10 files changed

Lines changed: 16 additions & 8 deletions
74 Bytes
Loading
83 Bytes
Loading
86 Bytes
Loading
87 Bytes
Loading
85 Bytes
Loading
-49 Bytes
Loading

packages/component/src/Activity/ActivityFeedback.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ function ActivityFeedback({ activity }: ActivityFeedbackProps) {
8484
// Intentionally left blank.
8585
}
8686
return Object.freeze(new Set([] as OrgSchemaAction[]));
87-
}, [feedbackSubmitted, graph, messageThing?.potentialAction, selectedAction]);
87+
// Do not want to add selectedAction to the dependency array as it will cause an infinite loop
88+
// eslint-disable-next-line react-hooks/exhaustive-deps
89+
}, [feedbackSubmitted, graph, messageThing?.potentialAction]);
8890

8991
const handleFeedbackActionClick = useCallback(
9092
(action: OrgSchemaAction) => setSelectedAction(action === selectedAction ? undefined : action),

packages/component/src/Activity/private/Feedback.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,13 @@ const Feedback = memo(({ actions, className, isFeedbackFormSupported, onActionCl
4747

4848
const actionProps = useMemo(
4949
() =>
50-
[...actions].some(action => action.actionStatus === 'CompletedActionStatus') ||
51-
selectedAction?.actionStatus === 'CompletedActionStatus'
50+
[...actions].some(action => action.actionStatus === 'CompletedActionStatus')
5251
? {
5352
disabled: true,
5453
title: localize('VOTE_COMPLETE_ALT')
5554
}
5655
: undefined,
57-
[actions, localize, selectedAction]
56+
[actions, localize]
5857
);
5958

6059
return (

packages/component/src/Activity/private/ThumbButton.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ const ThumbButton = memo(({ className, direction, disabled, onClick, pressed, ti
5757
direction={direction}
5858
filled={true}
5959
/>
60-
<Tooltip>{buttonTitle}</Tooltip>
60+
<Tooltip className={buttonTitle === title ? 'webchat__tooltip__long--block-start' : undefined}>
61+
{buttonTitle}
62+
</Tooltip>
6163
</button>
6264
);
6365
});

packages/component/src/Styles/StyleSet/Tooltip.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,23 @@ export default () => ({
4545
'&.webchat__tooltip--block-start': {
4646
insetBlockEnd: 'calc(100% + 7px)',
4747
insetInlineStart: '50%',
48-
transform: 'translate(-20%, 0)',
49-
48+
transform: 'translate(-50%, 0)',
5049
'&::after': {
5150
border: '1px solid var(--webchat__tooltip-background)',
5251
borderBottomLeftRadius: '2px',
5352
clipPath: 'polygon(0% 0%, 100% 100%, 0% 100%)',
5453
height: 'var(--webchat__tooltip-tip-size)',
5554
insetBlockStart: 'calc(100% - 6px)',
56-
insetInlineStart: 'calc(20% - var(--webchat__tooltip-tip-size) / 2)',
55+
insetInlineStart: 'calc(50% - var(--webchat__tooltip-tip-size) / 2)',
5756
transform: 'rotate(-45deg)',
5857
width: 'var(--webchat__tooltip-tip-size)'
5958
}
59+
},
60+
'&.webchat__tooltip__long--block-start': {
61+
transform: 'translate(-20%, 0)',
62+
'&::after': {
63+
insetInlineStart: 'calc(20% - var(--webchat__tooltip-tip-size) / 2)'
64+
}
6065
}
6166
}
6267
});

0 commit comments

Comments
 (0)