signal-desktop/ts/components/CallBackgroundBlur.tsx

38 lines
784 B
TypeScript
Raw Normal View History

2023-01-03 19:55:46 +00:00
// Copyright 2020 Signal Messenger, LLC
2020-10-30 20:34:04 +00:00
// SPDX-License-Identifier: AGPL-3.0-only
2020-10-08 01:25:33 +00:00
import React from 'react';
import classNames from 'classnames';
export type PropsType = {
avatarPath?: string;
children?: React.ReactNode;
className?: string;
2020-10-08 01:25:33 +00:00
};
2022-11-18 00:45:19 +00:00
export function CallBackgroundBlur({
2020-10-08 01:25:33 +00:00
avatarPath,
children,
className,
2022-11-18 00:45:19 +00:00
}: PropsType): JSX.Element {
2020-10-08 01:25:33 +00:00
return (
<div
className={classNames(
'module-calling__background',
!avatarPath && 'module-calling__background--no-avatar',
className
)}
>
{avatarPath && (
<div
className="module-calling__background--blur"
style={{
2021-02-19 17:50:32 +00:00
backgroundImage: `url('${encodeURI(avatarPath)}')`,
}}
/>
)}
2020-10-08 01:25:33 +00:00
{children}
</div>
2020-10-08 01:25:33 +00:00
);
2022-11-18 00:45:19 +00:00
}