signal-desktop/ts/components/AvatarLightbox.tsx

53 lines
1.1 KiB
TypeScript
Raw Normal View History

2021-08-06 00:17:05 +00:00
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import { AvatarColorType } from '../types/Colors';
import { AvatarPreview } from './AvatarPreview';
import { Lightbox } from './Lightbox';
import { LocalizerType } from '../types/Util';
export type PropsType = {
avatarColor?: AvatarColorType;
avatarPath?: string;
conversationTitle?: string;
i18n: LocalizerType;
isGroup?: boolean;
onClose: () => unknown;
};
export const AvatarLightbox = ({
avatarColor,
avatarPath,
conversationTitle,
i18n,
isGroup,
onClose,
}: PropsType): JSX.Element => {
return (
<Lightbox
contentType={undefined}
close={onClose}
i18n={i18n}
isViewOnce={false}
objectURL=""
>
<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>
);
};