2023-01-03 11:55:46 -08:00
|
|
|
// Copyright 2020 Signal Messenger, LLC
|
2020-10-30 15:34:04 -05:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-10-07 21:25:33 -04:00
|
|
|
import React from 'react';
|
|
|
|
import classNames from 'classnames';
|
|
|
|
|
|
|
|
export type PropsType = {
|
2024-07-11 12:44:09 -07:00
|
|
|
avatarUrl?: string;
|
2021-08-17 16:45:18 -05:00
|
|
|
children?: React.ReactNode;
|
|
|
|
className?: string;
|
2020-10-07 21:25:33 -04:00
|
|
|
};
|
|
|
|
|
2022-11-17 16:45:19 -08:00
|
|
|
export function CallBackgroundBlur({
|
2024-07-11 12:44:09 -07:00
|
|
|
avatarUrl,
|
2020-10-07 21:25:33 -04:00
|
|
|
children,
|
2021-08-17 16:45:18 -05:00
|
|
|
className,
|
2022-11-17 16:45:19 -08:00
|
|
|
}: PropsType): JSX.Element {
|
2020-10-07 21:25:33 -04:00
|
|
|
return (
|
2020-11-04 13:56:03 -06:00
|
|
|
<div
|
2021-08-17 16:45:18 -05:00
|
|
|
className={classNames(
|
|
|
|
'module-calling__background',
|
2024-07-11 12:44:09 -07:00
|
|
|
!avatarUrl && 'module-calling__background--no-avatar',
|
2021-08-17 16:45:18 -05:00
|
|
|
className
|
|
|
|
)}
|
2020-11-04 13:56:03 -06:00
|
|
|
>
|
2024-07-11 12:44:09 -07:00
|
|
|
{avatarUrl && (
|
2020-11-04 13:56:03 -06:00
|
|
|
<div
|
|
|
|
className="module-calling__background--blur"
|
|
|
|
style={{
|
2024-07-11 12:44:09 -07:00
|
|
|
backgroundImage: `url('${avatarUrl}')`,
|
2020-11-04 13:56:03 -06:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
)}
|
2020-10-07 21:25:33 -04:00
|
|
|
{children}
|
2020-10-12 14:26:24 -04:00
|
|
|
</div>
|
2020-10-07 21:25:33 -04:00
|
|
|
);
|
2022-11-17 16:45:19 -08:00
|
|
|
}
|