Skip to content

Commit

Permalink
fix: swap button positions
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverlaz committed Dec 15, 2023
1 parent d23e221 commit 6a5c05c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
30 changes: 18 additions & 12 deletions packages/react-sdk/src/components/CallControls/CancelCallButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { forwardRef, MouseEventHandler, useCallback } from 'react';
import { useCall, useI18n } from '@stream-io/video-react-bindings';
import { OwnCapability } from '@stream-io/video-client';
import { Restricted, useCall, useI18n } from '@stream-io/video-react-bindings';

import { MenuToggle } from '../Menu';

Expand All @@ -22,8 +23,24 @@ export const EndCallMenu = ({
const { t } = useI18n();
return (
<div className="str-video__end-call__confirmation">
<Restricted requiredGrants={[OwnCapability.END_CALL]}>
<button
className="str-video__button str-video__end-call__end"
type="button"
data-testid="end-call-for-all-button"
onClick={handleEndCall}
>
<Icon
className="str-video__button__icon str-video__end-call__end-icon"
icon="call-end"
/>
{t('End call for all')}
</button>
</Restricted>
<button
className="str-video__button str-video__end-call__leave"
type="button"
data-testid="leave-call-button"
onClick={handleLeave}
>
<Icon
Expand All @@ -32,17 +49,6 @@ export const EndCallMenu = ({
/>
{t('Leave call')}
</button>

<button
className="str-video__button str-video__end-call__end"
onClick={handleEndCall}
>
<Icon
className="str-video__button__icon str-video__end-call__end-icon"
icon="call-end"
/>
{t('End call for all')}
</button>
</div>
);
};
Expand Down
4 changes: 3 additions & 1 deletion packages/styling/src/CallControls/CancelCallButton.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

padding: var(--str-video__spacing-sm);
gap: var(--str-video__spacing-md);

display: flex;
flex-direction: column;
}

&__leave,
Expand All @@ -20,7 +23,6 @@

&__leave {
background-color: var(--str-video__button-primary-base);
margin-bottom: var(--str-video__spacing-sm);
border: 1px solid transparent;

&:hover {
Expand Down

0 comments on commit 6a5c05c

Please sign in to comment.