Skip to content

Commit

Permalink
fix: added disabled state to the IconButton of RealTimeButton.
Browse files Browse the repository at this point in the history
  • Loading branch information
soslayando committed Apr 9, 2024
1 parent 1980b10 commit 6e09c77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/datetime/src/components/DateTimeRangeControl/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export const getButtonStateFromRealTimeState = (
state: TRealtimeState = 'inactive',
): IconButtonProps['state'] => {
switch (state) {
case 'disabled':
return 'disabled';
case 'inactive':
return 'enabled';
case 'activated':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ export const RealTimeButton: React.FC<RealTimeButtonProps> = ({
);

return (
<Box marginLeft="auto" paddingLeft="cmp-xxs" position="relative">
<Box
marginLeft="auto"
paddingLeft="cmp-xxs"
position="relative"
visibility={state === 'hidden' ? 'hidden' : undefined}
>
{state === 'activated' && (
<Box position="absolute" zIndex={1} css="pointer-events: none">
<SpinnerLoader
Expand Down

0 comments on commit 6e09c77

Please sign in to comment.