Make the button icon change
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
7d5fb5f041
commit
a150619d08
3 changed files with 14 additions and 5 deletions
|
@ -30,7 +30,7 @@ import { ReactComponent as SettingsIcon } from "../icons/Settings.svg";
|
||||||
import { ReactComponent as AddUserIcon } from "../icons/AddUser.svg";
|
import { ReactComponent as AddUserIcon } from "../icons/AddUser.svg";
|
||||||
import { ReactComponent as ArrowDownIcon } from "../icons/ArrowDown.svg";
|
import { ReactComponent as ArrowDownIcon } from "../icons/ArrowDown.svg";
|
||||||
import { TooltipTrigger } from "../Tooltip";
|
import { TooltipTrigger } from "../Tooltip";
|
||||||
import { ReactComponent as AudioIcon } from "../icons/Audio.svg";
|
import { VolumeIcon } from "./VolumeIcon";
|
||||||
|
|
||||||
export type ButtonVariant =
|
export type ButtonVariant =
|
||||||
| "default"
|
| "default"
|
||||||
|
@ -239,11 +239,18 @@ export function InviteButton({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function AudioButton(props: Omit<Props, "variant">) {
|
interface AudioButtonProps extends Omit<Props, "variant"> {
|
||||||
|
/**
|
||||||
|
* A number between 0 and 1
|
||||||
|
*/
|
||||||
|
volume: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function AudioButton({ volume, ...rest }: AudioButtonProps) {
|
||||||
return (
|
return (
|
||||||
<TooltipTrigger tooltip={() => "Local volume"}>
|
<TooltipTrigger tooltip={() => "Local volume"}>
|
||||||
<Button variant="icon" {...props}>
|
<Button variant="icon" {...rest}>
|
||||||
<AudioIcon />
|
<VolumeIcon volume={volume} />
|
||||||
</Button>
|
</Button>
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
);
|
);
|
||||||
|
|
|
@ -38,6 +38,7 @@ export const VideoTile = forwardRef(
|
||||||
mediaRef,
|
mediaRef,
|
||||||
onOptionsPress,
|
onOptionsPress,
|
||||||
showOptions,
|
showOptions,
|
||||||
|
localVolume,
|
||||||
...rest
|
...rest
|
||||||
},
|
},
|
||||||
ref
|
ref
|
||||||
|
@ -86,7 +87,7 @@ export const VideoTile = forwardRef(
|
||||||
styles.audioButton
|
styles.audioButton
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<AudioButton onPress={onOptionsPress} />
|
<AudioButton volume={localVolume} onPress={onOptionsPress} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<video ref={mediaRef} playsInline disablePictureInPicture />
|
<video ref={mediaRef} playsInline disablePictureInPicture />
|
||||||
|
|
|
@ -82,6 +82,7 @@ export function VideoTileContainer({
|
||||||
avatar={getAvatar && getAvatar(member, width, height)}
|
avatar={getAvatar && getAvatar(member, width, height)}
|
||||||
onOptionsPress={onOptionsPress}
|
onOptionsPress={onOptionsPress}
|
||||||
showOptions={!item.callFeed.isLocal()}
|
showOptions={!item.callFeed.isLocal()}
|
||||||
|
localVolume={localVolume}
|
||||||
{...rest}
|
{...rest}
|
||||||
/>
|
/>
|
||||||
{videoTileSettingsModalState.isOpen && (
|
{videoTileSettingsModalState.isOpen && (
|
||||||
|
|
Loading…
Reference in a new issue