Conversation Colors
This commit is contained in:
parent
b63d8e908c
commit
28f016ce48
128 changed files with 3997 additions and 1207 deletions
43
ts/components/GlobalModalContainer.tsx
Normal file
43
ts/components/GlobalModalContainer.tsx
Normal file
|
@ -0,0 +1,43 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
import { Modal } from './Modal';
|
||||
import { LocalizerType } from '../types/Util';
|
||||
import { ConversationColorType } from '../types/Colors';
|
||||
|
||||
type PropsType = {
|
||||
i18n: LocalizerType;
|
||||
isChatColorEditorVisible: boolean;
|
||||
renderChatColorPicker: (actions: {
|
||||
setAllConversationColors: (color: ConversationColorType) => unknown;
|
||||
}) => JSX.Element;
|
||||
setAllConversationColors: (color: ConversationColorType) => unknown;
|
||||
toggleChatColorEditor: () => unknown;
|
||||
};
|
||||
|
||||
export const GlobalModalContainer = ({
|
||||
i18n,
|
||||
isChatColorEditorVisible,
|
||||
renderChatColorPicker,
|
||||
setAllConversationColors,
|
||||
toggleChatColorEditor,
|
||||
}: PropsType): JSX.Element | null => {
|
||||
if (isChatColorEditorVisible) {
|
||||
return (
|
||||
<Modal
|
||||
hasXButton
|
||||
i18n={i18n}
|
||||
noMouseClose
|
||||
onClose={toggleChatColorEditor}
|
||||
title={i18n('ChatColorPicker__global-chat-color')}
|
||||
>
|
||||
{renderChatColorPicker({
|
||||
setAllConversationColors,
|
||||
})}
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue