2020-10-30 20:34:04 +00:00
|
|
|
// Copyright 2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-10-08 01:25:33 +00:00
|
|
|
import React from 'react';
|
|
|
|
import classNames from 'classnames';
|
|
|
|
import { ColorType } from '../types/Colors';
|
|
|
|
|
|
|
|
export type PropsType = {
|
|
|
|
avatarPath?: string;
|
|
|
|
children: React.ReactNode;
|
|
|
|
color?: ColorType;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const CallBackgroundBlur = ({
|
|
|
|
avatarPath,
|
|
|
|
children,
|
|
|
|
color,
|
|
|
|
}: PropsType): JSX.Element => {
|
|
|
|
return (
|
2020-11-04 19:56:03 +00:00
|
|
|
<div
|
|
|
|
className={classNames('module-calling__background', {
|
|
|
|
[`module-background-color__${color || 'default'}`]: !avatarPath,
|
|
|
|
})}
|
|
|
|
>
|
|
|
|
{avatarPath && (
|
|
|
|
<div
|
|
|
|
className="module-calling__background--blur"
|
|
|
|
style={{
|
|
|
|
backgroundImage: `url("${avatarPath}")`,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
)}
|
2020-10-08 01:25:33 +00:00
|
|
|
{children}
|
2020-10-12 18:26:24 +00:00
|
|
|
</div>
|
2020-10-08 01:25:33 +00:00
|
|
|
);
|
|
|
|
};
|