2021-08-06 00:17:05 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { AvatarColorType } from '../types/Colors';
|
2021-08-06 00:17:05 +00:00
|
|
|
import { AvatarPreview } from './AvatarPreview';
|
|
|
|
import { Lightbox } from './Lightbox';
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { LocalizerType } from '../types/Util';
|
2021-08-06 00:17:05 +00:00
|
|
|
|
|
|
|
export type PropsType = {
|
|
|
|
avatarColor?: AvatarColorType;
|
|
|
|
avatarPath?: string;
|
|
|
|
conversationTitle?: string;
|
|
|
|
i18n: LocalizerType;
|
|
|
|
isGroup?: boolean;
|
|
|
|
onClose: () => unknown;
|
|
|
|
};
|
|
|
|
|
2022-11-18 00:45:19 +00:00
|
|
|
export function AvatarLightbox({
|
2021-08-06 00:17:05 +00:00
|
|
|
avatarColor,
|
|
|
|
avatarPath,
|
|
|
|
conversationTitle,
|
|
|
|
i18n,
|
|
|
|
isGroup,
|
|
|
|
onClose,
|
2022-11-18 00:45:19 +00:00
|
|
|
}: PropsType): JSX.Element {
|
2021-08-06 00:17:05 +00:00
|
|
|
return (
|
2021-08-23 23:14:53 +00:00
|
|
|
<Lightbox close={onClose} i18n={i18n} media={[]}>
|
2021-08-06 00:17:05 +00:00
|
|
|
<AvatarPreview
|
|
|
|
avatarColor={avatarColor}
|
2021-08-06 21:35:25 +00:00
|
|
|
avatarPath={avatarPath}
|
2021-08-06 00:17:05 +00:00
|
|
|
conversationTitle={conversationTitle}
|
|
|
|
i18n={i18n}
|
|
|
|
isGroup={isGroup}
|
|
|
|
style={{
|
|
|
|
fontSize: '16em',
|
|
|
|
height: '2em',
|
2021-08-06 21:35:25 +00:00
|
|
|
maxHeight: 512,
|
|
|
|
maxWidth: 512,
|
2021-08-06 00:17:05 +00:00
|
|
|
width: '2em',
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</Lightbox>
|
|
|
|
);
|
2022-11-18 00:45:19 +00:00
|
|
|
}
|