Fix storybook
This commit is contained in:
parent
950c90f75d
commit
2710f463a7
20 changed files with 64 additions and 8 deletions
|
@ -50,5 +50,9 @@
|
||||||
hasCustomTitleBar: () => false,
|
hasCustomTitleBar: () => false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
window.ConversationController = window.ConversationController || {};
|
||||||
|
window.ConversationController.isSignalConversation = () => false;
|
||||||
|
window.ConversationController.onConvoMessageMount = noop;
|
||||||
window.getPreferredSystemLocales = () => ['en'];
|
window.getPreferredSystemLocales = () => ['en'];
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -19,6 +19,7 @@ export type PropsType = {
|
||||||
editHistoryMessages: Array<MessagePropsType>;
|
editHistoryMessages: Array<MessagePropsType>;
|
||||||
getPreferredBadge: PreferredBadgeSelectorType;
|
getPreferredBadge: PreferredBadgeSelectorType;
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
|
platform: string;
|
||||||
kickOffAttachmentDownload: (options: {
|
kickOffAttachmentDownload: (options: {
|
||||||
attachment: AttachmentType;
|
attachment: AttachmentType;
|
||||||
messageId: string;
|
messageId: string;
|
||||||
|
@ -70,6 +71,7 @@ export function EditHistoryMessagesModal({
|
||||||
getPreferredBadge,
|
getPreferredBadge,
|
||||||
editHistoryMessages,
|
editHistoryMessages,
|
||||||
i18n,
|
i18n,
|
||||||
|
platform,
|
||||||
kickOffAttachmentDownload,
|
kickOffAttachmentDownload,
|
||||||
showLightbox,
|
showLightbox,
|
||||||
}: PropsType): JSX.Element {
|
}: PropsType): JSX.Element {
|
||||||
|
@ -100,6 +102,7 @@ export function EditHistoryMessagesModal({
|
||||||
containerElementRef={containerElementRef}
|
containerElementRef={containerElementRef}
|
||||||
getPreferredBadge={getPreferredBadge}
|
getPreferredBadge={getPreferredBadge}
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
|
platform={platform}
|
||||||
key={messageAttributes.timestamp}
|
key={messageAttributes.timestamp}
|
||||||
kickOffAttachmentDownload={kickOffAttachmentDownload}
|
kickOffAttachmentDownload={kickOffAttachmentDownload}
|
||||||
showLightbox={closeAndShowLightbox}
|
showLightbox={closeAndShowLightbox}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import type { ConversationType } from '../state/ducks/conversations';
|
||||||
import type { PreferredBadgeSelectorType } from '../state/selectors/badges';
|
import type { PreferredBadgeSelectorType } from '../state/selectors/badges';
|
||||||
import { GroupDialog } from './GroupDialog';
|
import { GroupDialog } from './GroupDialog';
|
||||||
import { sortByTitle } from '../util/sortByTitle';
|
import { sortByTitle } from '../util/sortByTitle';
|
||||||
import { missingCaseError } from '../util';
|
import { missingCaseError } from '../util/missingCaseError';
|
||||||
|
|
||||||
export type DataPropsType = {
|
export type DataPropsType = {
|
||||||
conversationId: string;
|
conversationId: string;
|
||||||
|
|
|
@ -39,6 +39,9 @@ export default {
|
||||||
i18n: {
|
i18n: {
|
||||||
defaultValue: i18n,
|
defaultValue: i18n,
|
||||||
},
|
},
|
||||||
|
platform: {
|
||||||
|
defaultValue: 'darwin',
|
||||||
|
},
|
||||||
loadStoryReplies: { action: true },
|
loadStoryReplies: { action: true },
|
||||||
markStoryRead: { action: true },
|
markStoryRead: { action: true },
|
||||||
numStories: {
|
numStories: {
|
||||||
|
|
|
@ -101,6 +101,7 @@ export type PropsType = {
|
||||||
) => unknown;
|
) => unknown;
|
||||||
onUseEmoji: (_: EmojiPickDataType) => unknown;
|
onUseEmoji: (_: EmojiPickDataType) => unknown;
|
||||||
onMediaPlaybackStart: () => void;
|
onMediaPlaybackStart: () => void;
|
||||||
|
platform: string;
|
||||||
preferredReactionEmoji: ReadonlyArray<string>;
|
preferredReactionEmoji: ReadonlyArray<string>;
|
||||||
queueStoryDownload: (storyId: string) => unknown;
|
queueStoryDownload: (storyId: string) => unknown;
|
||||||
recentEmojis?: ReadonlyArray<string>;
|
recentEmojis?: ReadonlyArray<string>;
|
||||||
|
@ -155,6 +156,7 @@ export function StoryViewer({
|
||||||
onTextTooLong,
|
onTextTooLong,
|
||||||
onUseEmoji,
|
onUseEmoji,
|
||||||
onMediaPlaybackStart,
|
onMediaPlaybackStart,
|
||||||
|
platform,
|
||||||
preferredReactionEmoji,
|
preferredReactionEmoji,
|
||||||
queueStoryDownload,
|
queueStoryDownload,
|
||||||
recentEmojis,
|
recentEmojis,
|
||||||
|
@ -914,6 +916,7 @@ export function StoryViewer({
|
||||||
hasViewReceiptSetting={hasViewReceiptSetting}
|
hasViewReceiptSetting={hasViewReceiptSetting}
|
||||||
hasViewsCapability={isSent}
|
hasViewsCapability={isSent}
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
|
platform={platform}
|
||||||
isInternalUser={isInternalUser}
|
isInternalUser={isInternalUser}
|
||||||
group={group}
|
group={group}
|
||||||
onClose={() => setCurrentViewTarget(null)}
|
onClose={() => setCurrentViewTarget(null)}
|
||||||
|
|
|
@ -39,6 +39,9 @@ export default {
|
||||||
i18n: {
|
i18n: {
|
||||||
defaultValue: i18n,
|
defaultValue: i18n,
|
||||||
},
|
},
|
||||||
|
platform: {
|
||||||
|
defaultValue: 'darwin',
|
||||||
|
},
|
||||||
onClose: { action: true },
|
onClose: { action: true },
|
||||||
onSetSkinTone: { action: true },
|
onSetSkinTone: { action: true },
|
||||||
onReact: { action: true },
|
onReact: { action: true },
|
||||||
|
|
|
@ -87,6 +87,7 @@ export type PropsType = {
|
||||||
hasViewReceiptSetting: boolean;
|
hasViewReceiptSetting: boolean;
|
||||||
hasViewsCapability: boolean;
|
hasViewsCapability: boolean;
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
|
platform: string;
|
||||||
isInternalUser?: boolean;
|
isInternalUser?: boolean;
|
||||||
onChangeViewTarget: (target: StoryViewTargetType) => unknown;
|
onChangeViewTarget: (target: StoryViewTargetType) => unknown;
|
||||||
onClose: () => unknown;
|
onClose: () => unknown;
|
||||||
|
@ -120,6 +121,7 @@ export function StoryViewsNRepliesModal({
|
||||||
hasViewReceiptSetting,
|
hasViewReceiptSetting,
|
||||||
hasViewsCapability,
|
hasViewsCapability,
|
||||||
i18n,
|
i18n,
|
||||||
|
platform,
|
||||||
isInternalUser,
|
isInternalUser,
|
||||||
onChangeViewTarget,
|
onChangeViewTarget,
|
||||||
onClose,
|
onClose,
|
||||||
|
@ -286,6 +288,7 @@ export function StoryViewsNRepliesModal({
|
||||||
}
|
}
|
||||||
getPreferredBadge={getPreferredBadge}
|
getPreferredBadge={getPreferredBadge}
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
|
platform={platform}
|
||||||
id={reply.id}
|
id={reply.id}
|
||||||
isInternalUser={isInternalUser}
|
isInternalUser={isInternalUser}
|
||||||
reply={reply}
|
reply={reply}
|
||||||
|
@ -463,6 +466,7 @@ type ReplyOrReactionMessageProps = {
|
||||||
deleteGroupStoryReplyForEveryone: (replyId: string) => void;
|
deleteGroupStoryReplyForEveryone: (replyId: string) => void;
|
||||||
getPreferredBadge: PreferredBadgeSelectorType;
|
getPreferredBadge: PreferredBadgeSelectorType;
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
|
platform: string;
|
||||||
id: string;
|
id: string;
|
||||||
isInternalUser?: boolean;
|
isInternalUser?: boolean;
|
||||||
onContextMenu?: (ev: React.MouseEvent) => void;
|
onContextMenu?: (ev: React.MouseEvent) => void;
|
||||||
|
@ -481,6 +485,7 @@ function ReplyOrReactionMessage({
|
||||||
deleteGroupStoryReplyForEveryone,
|
deleteGroupStoryReplyForEveryone,
|
||||||
containerElementRef,
|
containerElementRef,
|
||||||
getPreferredBadge,
|
getPreferredBadge,
|
||||||
|
platform,
|
||||||
shouldCollapseAbove,
|
shouldCollapseAbove,
|
||||||
shouldCollapseBelow,
|
shouldCollapseBelow,
|
||||||
showContactModal,
|
showContactModal,
|
||||||
|
@ -549,6 +554,7 @@ function ReplyOrReactionMessage({
|
||||||
onContextMenu={onContextMenu}
|
onContextMenu={onContextMenu}
|
||||||
getPreferredBadge={getPreferredBadge}
|
getPreferredBadge={getPreferredBadge}
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
|
platform={platform}
|
||||||
id={reply.id}
|
id={reply.id}
|
||||||
interactionMode="mouse"
|
interactionMode="mouse"
|
||||||
readStatus={reply.readStatus}
|
readStatus={reply.readStatus}
|
||||||
|
|
|
@ -98,7 +98,6 @@ import { Emojify } from './Emojify';
|
||||||
import { getPaymentEventDescription } from '../../messages/helpers';
|
import { getPaymentEventDescription } from '../../messages/helpers';
|
||||||
import { PanelType } from '../../types/Panels';
|
import { PanelType } from '../../types/Panels';
|
||||||
import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser';
|
import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser';
|
||||||
import { isMacOS } from '../../OS';
|
|
||||||
|
|
||||||
const GUESS_METADATA_WIDTH_TIMESTAMP_SIZE = 16;
|
const GUESS_METADATA_WIDTH_TIMESTAMP_SIZE = 16;
|
||||||
const GUESS_METADATA_WIDTH_EXPIRE_TIMER_SIZE = 18;
|
const GUESS_METADATA_WIDTH_EXPIRE_TIMER_SIZE = 18;
|
||||||
|
@ -297,6 +296,7 @@ export type PropsHousekeeping = {
|
||||||
getPreferredBadge: PreferredBadgeSelectorType;
|
getPreferredBadge: PreferredBadgeSelectorType;
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
interactionMode: InteractionModeType;
|
interactionMode: InteractionModeType;
|
||||||
|
platform: string;
|
||||||
renderAudioAttachment: (props: AudioAttachmentProps) => JSX.Element;
|
renderAudioAttachment: (props: AudioAttachmentProps) => JSX.Element;
|
||||||
shouldCollapseAbove: boolean;
|
shouldCollapseAbove: boolean;
|
||||||
shouldCollapseBelow: boolean;
|
shouldCollapseBelow: boolean;
|
||||||
|
@ -2577,6 +2577,7 @@ export class Message extends React.PureComponent<Props, State> {
|
||||||
isSelected,
|
isSelected,
|
||||||
isSelectMode,
|
isSelectMode,
|
||||||
onKeyDown,
|
onKeyDown,
|
||||||
|
platform,
|
||||||
renderMenu,
|
renderMenu,
|
||||||
shouldCollapseAbove,
|
shouldCollapseAbove,
|
||||||
shouldCollapseBelow,
|
shouldCollapseBelow,
|
||||||
|
@ -2584,6 +2585,7 @@ export class Message extends React.PureComponent<Props, State> {
|
||||||
onToggleSelect,
|
onToggleSelect,
|
||||||
onReplyToMessage,
|
onReplyToMessage,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
const isMacOS = platform === 'darwin';
|
||||||
const { expired, expiring, isTargeted, imageBroken } = this.state;
|
const { expired, expiring, isTargeted, imageBroken } = this.state;
|
||||||
|
|
||||||
if (expired) {
|
if (expired) {
|
||||||
|
@ -2622,7 +2624,7 @@ export class Message extends React.PureComponent<Props, State> {
|
||||||
// We use `onClickCapture` here and preven default/stop propagation to
|
// We use `onClickCapture` here and preven default/stop propagation to
|
||||||
// prevent other click handlers from firing.
|
// prevent other click handlers from firing.
|
||||||
onClickCapture: event => {
|
onClickCapture: event => {
|
||||||
if (isMacOS() ? event.metaKey : event.ctrlKey) {
|
if (isMacOS ? event.metaKey : event.ctrlKey) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
onToggleSelect(true, false);
|
onToggleSelect(true, false);
|
||||||
|
|
|
@ -68,6 +68,7 @@ const createProps = (overrideProps: Partial<Props> = {}): Props => ({
|
||||||
|
|
||||||
getPreferredBadge: () => getFakeBadge(),
|
getPreferredBadge: () => getFakeBadge(),
|
||||||
i18n,
|
i18n,
|
||||||
|
platform: 'darwin',
|
||||||
interactionMode: 'keyboard',
|
interactionMode: 'keyboard',
|
||||||
theme: ThemeType.light,
|
theme: ThemeType.light,
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,7 @@ export type PropsData = {
|
||||||
sentAt: number;
|
sentAt: number;
|
||||||
|
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
|
platform: string;
|
||||||
theme: ThemeType;
|
theme: ThemeType;
|
||||||
getPreferredBadge: PreferredBadgeSelectorType;
|
getPreferredBadge: PreferredBadgeSelectorType;
|
||||||
} & Pick<MessagePropsType, 'getPreferredBadge' | 'interactionMode'>;
|
} & Pick<MessagePropsType, 'getPreferredBadge' | 'interactionMode'>;
|
||||||
|
@ -303,6 +304,7 @@ export class MessageDetail extends React.Component<Props> {
|
||||||
kickOffAttachmentDownload,
|
kickOffAttachmentDownload,
|
||||||
markAttachmentAsCorrupted,
|
markAttachmentAsCorrupted,
|
||||||
openGiftBadge,
|
openGiftBadge,
|
||||||
|
platform,
|
||||||
pushPanelForConversation,
|
pushPanelForConversation,
|
||||||
renderAudioAttachment,
|
renderAudioAttachment,
|
||||||
saveAttachment,
|
saveAttachment,
|
||||||
|
@ -346,6 +348,7 @@ export class MessageDetail extends React.Component<Props> {
|
||||||
kickOffAttachmentDownload={kickOffAttachmentDownload}
|
kickOffAttachmentDownload={kickOffAttachmentDownload}
|
||||||
markAttachmentAsCorrupted={markAttachmentAsCorrupted}
|
markAttachmentAsCorrupted={markAttachmentAsCorrupted}
|
||||||
messageExpanded={noop}
|
messageExpanded={noop}
|
||||||
|
platform={platform}
|
||||||
showConversation={showConversation}
|
showConversation={showConversation}
|
||||||
openGiftBadge={openGiftBadge}
|
openGiftBadge={openGiftBadge}
|
||||||
pushPanelForConversation={pushPanelForConversation}
|
pushPanelForConversation={pushPanelForConversation}
|
||||||
|
|
|
@ -44,6 +44,9 @@ export default {
|
||||||
i18n: {
|
i18n: {
|
||||||
defaultValue: i18n,
|
defaultValue: i18n,
|
||||||
},
|
},
|
||||||
|
platform: {
|
||||||
|
defautlValue: 'darwin',
|
||||||
|
},
|
||||||
isFromMe: {
|
isFromMe: {
|
||||||
control: { type: 'checkbox' },
|
control: { type: 'checkbox' },
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
|
@ -103,6 +106,7 @@ const defaultMessageProps: TimelineMessagesProps = {
|
||||||
),
|
),
|
||||||
getPreferredBadge: () => undefined,
|
getPreferredBadge: () => undefined,
|
||||||
i18n,
|
i18n,
|
||||||
|
platform: 'darwin',
|
||||||
id: 'messageId',
|
id: 'messageId',
|
||||||
// renderingContext: 'storybook',
|
// renderingContext: 'storybook',
|
||||||
interactionMode: 'keyboard',
|
interactionMode: 'keyboard',
|
||||||
|
|
|
@ -344,6 +344,7 @@ const renderItem = ({
|
||||||
interactionMode="keyboard"
|
interactionMode="keyboard"
|
||||||
isNextItemCallingNotification={false}
|
isNextItemCallingNotification={false}
|
||||||
theme={ThemeType.light}
|
theme={ThemeType.light}
|
||||||
|
platform="darwin"
|
||||||
containerElementRef={containerElementRef}
|
containerElementRef={containerElementRef}
|
||||||
containerWidthBreakpoint={containerWidthBreakpoint}
|
containerWidthBreakpoint={containerWidthBreakpoint}
|
||||||
conversationId=""
|
conversationId=""
|
||||||
|
|
|
@ -61,6 +61,7 @@ const getDefaultProps = () => ({
|
||||||
isTargeted: false,
|
isTargeted: false,
|
||||||
interactionMode: 'keyboard' as const,
|
interactionMode: 'keyboard' as const,
|
||||||
theme: ThemeType.light,
|
theme: ThemeType.light,
|
||||||
|
platform: 'darwin',
|
||||||
targetMessage: action('targetMessage'),
|
targetMessage: action('targetMessage'),
|
||||||
toggleSelectMessage: action('toggleSelectMessage'),
|
toggleSelectMessage: action('toggleSelectMessage'),
|
||||||
reactToMessage: action('reactToMessage'),
|
reactToMessage: action('reactToMessage'),
|
||||||
|
|
|
@ -151,6 +151,7 @@ type PropsLocalType = {
|
||||||
isTargeted: boolean;
|
isTargeted: boolean;
|
||||||
targetMessage: (messageId: string, conversationId: string) => unknown;
|
targetMessage: (messageId: string, conversationId: string) => unknown;
|
||||||
shouldRenderDateHeader: boolean;
|
shouldRenderDateHeader: boolean;
|
||||||
|
platform: string;
|
||||||
renderContact: SmartContactRendererType<FullJSXType>;
|
renderContact: SmartContactRendererType<FullJSXType>;
|
||||||
renderUniversalTimerNotification: () => JSX.Element;
|
renderUniversalTimerNotification: () => JSX.Element;
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
|
@ -188,6 +189,7 @@ export class TimelineItem extends React.PureComponent<PropsType> {
|
||||||
isNextItemCallingNotification,
|
isNextItemCallingNotification,
|
||||||
isTargeted,
|
isTargeted,
|
||||||
item,
|
item,
|
||||||
|
platform,
|
||||||
renderUniversalTimerNotification,
|
renderUniversalTimerNotification,
|
||||||
returnToActiveCall,
|
returnToActiveCall,
|
||||||
targetMessage,
|
targetMessage,
|
||||||
|
@ -223,6 +225,7 @@ export class TimelineItem extends React.PureComponent<PropsType> {
|
||||||
shouldHideMetadata={shouldHideMetadata}
|
shouldHideMetadata={shouldHideMetadata}
|
||||||
containerElementRef={containerElementRef}
|
containerElementRef={containerElementRef}
|
||||||
getPreferredBadge={getPreferredBadge}
|
getPreferredBadge={getPreferredBadge}
|
||||||
|
platform={platform}
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
theme={theme}
|
theme={theme}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -281,6 +281,7 @@ const createProps = (overrideProps: Partial<Props> = {}): Props => ({
|
||||||
getPreferredBadge: overrideProps.getPreferredBadge || (() => undefined),
|
getPreferredBadge: overrideProps.getPreferredBadge || (() => undefined),
|
||||||
giftBadge: overrideProps.giftBadge,
|
giftBadge: overrideProps.giftBadge,
|
||||||
i18n,
|
i18n,
|
||||||
|
platform: 'darwin',
|
||||||
id: text('id', overrideProps.id || 'random-message-id'),
|
id: text('id', overrideProps.id || 'random-message-id'),
|
||||||
// renderingContext: 'storybook',
|
// renderingContext: 'storybook',
|
||||||
interactionMode: overrideProps.interactionMode || 'keyboard',
|
interactionMode: overrideProps.interactionMode || 'keyboard',
|
||||||
|
|
|
@ -24,7 +24,7 @@ import { Emoji } from './Emoji';
|
||||||
import { dataByCategory, search } from './lib';
|
import { dataByCategory, search } from './lib';
|
||||||
import type { LocalizerType } from '../../types/Util';
|
import type { LocalizerType } from '../../types/Util';
|
||||||
import { isSingleGrapheme } from '../../util/grapheme';
|
import { isSingleGrapheme } from '../../util/grapheme';
|
||||||
import { missingCaseError } from '../../util';
|
import { missingCaseError } from '../../util/missingCaseError';
|
||||||
|
|
||||||
export type EmojiPickDataType = {
|
export type EmojiPickDataType = {
|
||||||
skinTone?: number;
|
skinTone?: number;
|
||||||
|
|
|
@ -7,7 +7,7 @@ import type { GlobalModalsStateType } from '../ducks/globalModals';
|
||||||
import type { MessageAttributesType } from '../../model-types.d';
|
import type { MessageAttributesType } from '../../model-types.d';
|
||||||
import type { StateType } from '../reducer';
|
import type { StateType } from '../reducer';
|
||||||
import { EditHistoryMessagesModal } from '../../components/EditHistoryMessagesModal';
|
import { EditHistoryMessagesModal } from '../../components/EditHistoryMessagesModal';
|
||||||
import { getIntl } from '../selectors/user';
|
import { getIntl, getPlatform } from '../selectors/user';
|
||||||
import { getMessagePropsSelector } from '../selectors/message';
|
import { getMessagePropsSelector } from '../selectors/message';
|
||||||
import { getPreferredBadgeSelector } from '../selectors/badges';
|
import { getPreferredBadgeSelector } from '../selectors/badges';
|
||||||
import { useConversationsActions } from '../ducks/conversations';
|
import { useConversationsActions } from '../ducks/conversations';
|
||||||
|
@ -17,6 +17,7 @@ import { strictAssert } from '../../util/assert';
|
||||||
|
|
||||||
export function SmartEditHistoryMessagesModal(): JSX.Element {
|
export function SmartEditHistoryMessagesModal(): JSX.Element {
|
||||||
const i18n = useSelector(getIntl);
|
const i18n = useSelector(getIntl);
|
||||||
|
const platform = useSelector(getPlatform);
|
||||||
|
|
||||||
const { closeEditHistoryModal } = useGlobalModalActions();
|
const { closeEditHistoryModal } = useGlobalModalActions();
|
||||||
|
|
||||||
|
@ -50,6 +51,7 @@ export function SmartEditHistoryMessagesModal(): JSX.Element {
|
||||||
editHistoryMessages={editHistoryMessages}
|
editHistoryMessages={editHistoryMessages}
|
||||||
getPreferredBadge={getPreferredBadge}
|
getPreferredBadge={getPreferredBadge}
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
|
platform={platform}
|
||||||
kickOffAttachmentDownload={kickOffAttachmentDownload}
|
kickOffAttachmentDownload={kickOffAttachmentDownload}
|
||||||
showLightbox={showLightbox}
|
showLightbox={showLightbox}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -7,7 +7,12 @@ import { useSelector } from 'react-redux';
|
||||||
import type { Props as MessageDetailProps } from '../../components/conversation/MessageDetail';
|
import type { Props as MessageDetailProps } from '../../components/conversation/MessageDetail';
|
||||||
import { MessageDetail } from '../../components/conversation/MessageDetail';
|
import { MessageDetail } from '../../components/conversation/MessageDetail';
|
||||||
import { getContactNameColorSelector } from '../selectors/conversations';
|
import { getContactNameColorSelector } from '../selectors/conversations';
|
||||||
import { getIntl, getInteractionMode, getTheme } from '../selectors/user';
|
import {
|
||||||
|
getIntl,
|
||||||
|
getInteractionMode,
|
||||||
|
getTheme,
|
||||||
|
getPlatform,
|
||||||
|
} from '../selectors/user';
|
||||||
import { getMessageDetails } from '../selectors/message';
|
import { getMessageDetails } from '../selectors/message';
|
||||||
import { getPreferredBadgeSelector } from '../selectors/badges';
|
import { getPreferredBadgeSelector } from '../selectors/badges';
|
||||||
import { renderAudioAttachment } from './renderAudioAttachment';
|
import { renderAudioAttachment } from './renderAudioAttachment';
|
||||||
|
@ -27,6 +32,7 @@ export function SmartMessageDetail(): JSX.Element | null {
|
||||||
const getContactNameColor = useSelector(getContactNameColorSelector);
|
const getContactNameColor = useSelector(getContactNameColorSelector);
|
||||||
const getPreferredBadge = useSelector(getPreferredBadgeSelector);
|
const getPreferredBadge = useSelector(getPreferredBadgeSelector);
|
||||||
const i18n = useSelector(getIntl);
|
const i18n = useSelector(getIntl);
|
||||||
|
const platform = useSelector(getPlatform);
|
||||||
const interactionMode = useSelector(getInteractionMode);
|
const interactionMode = useSelector(getInteractionMode);
|
||||||
const messageDetails = useSelector(getMessageDetails);
|
const messageDetails = useSelector(getMessageDetails);
|
||||||
const theme = useSelector(getTheme);
|
const theme = useSelector(getTheme);
|
||||||
|
@ -76,6 +82,7 @@ export function SmartMessageDetail(): JSX.Element | null {
|
||||||
errors={errors}
|
errors={errors}
|
||||||
getPreferredBadge={getPreferredBadge}
|
getPreferredBadge={getPreferredBadge}
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
|
platform={platform}
|
||||||
interactionMode={interactionMode}
|
interactionMode={interactionMode}
|
||||||
kickOffAttachmentDownload={kickOffAttachmentDownload}
|
kickOffAttachmentDownload={kickOffAttachmentDownload}
|
||||||
markAttachmentAsCorrupted={markAttachmentAsCorrupted}
|
markAttachmentAsCorrupted={markAttachmentAsCorrupted}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import {
|
||||||
getPreferredReactionEmoji,
|
getPreferredReactionEmoji,
|
||||||
isInternalUser,
|
isInternalUser,
|
||||||
} from '../selectors/items';
|
} from '../selectors/items';
|
||||||
import { getIntl } from '../selectors/user';
|
import { getIntl, getPlatform } from '../selectors/user';
|
||||||
import { getPreferredBadgeSelector } from '../selectors/badges';
|
import { getPreferredBadgeSelector } from '../selectors/badges';
|
||||||
import {
|
import {
|
||||||
getSelectedStoryData,
|
getSelectedStoryData,
|
||||||
|
@ -56,6 +56,7 @@ export function SmartStoryViewer(): JSX.Element | null {
|
||||||
const isWindowActive = useIsWindowActive();
|
const isWindowActive = useIsWindowActive();
|
||||||
|
|
||||||
const i18n = useSelector<StateType, LocalizerType>(getIntl);
|
const i18n = useSelector<StateType, LocalizerType>(getIntl);
|
||||||
|
const platform = useSelector(getPlatform);
|
||||||
const getPreferredBadge = useSelector(getPreferredBadgeSelector);
|
const getPreferredBadge = useSelector(getPreferredBadgeSelector);
|
||||||
const preferredReactionEmoji = useSelector<StateType, ReadonlyArray<string>>(
|
const preferredReactionEmoji = useSelector<StateType, ReadonlyArray<string>>(
|
||||||
getPreferredReactionEmoji
|
getPreferredReactionEmoji
|
||||||
|
@ -111,6 +112,7 @@ export function SmartStoryViewer(): JSX.Element | null {
|
||||||
hasAllStoriesUnmuted={hasAllStoriesUnmuted}
|
hasAllStoriesUnmuted={hasAllStoriesUnmuted}
|
||||||
hasViewReceiptSetting={hasViewReceiptSetting}
|
hasViewReceiptSetting={hasViewReceiptSetting}
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
|
platform={platform}
|
||||||
isInternalUser={internalUser}
|
isInternalUser={internalUser}
|
||||||
saveAttachment={internalUser ? saveAttachment : asyncShouldNeverBeCalled}
|
saveAttachment={internalUser ? saveAttachment : asyncShouldNeverBeCalled}
|
||||||
isSignalConversation={isSignalConversation({
|
isSignalConversation={isSignalConversation({
|
||||||
|
|
|
@ -16,7 +16,12 @@ import { useLightboxActions } from '../ducks/lightbox';
|
||||||
import { useStoriesActions } from '../ducks/stories';
|
import { useStoriesActions } from '../ducks/stories';
|
||||||
import { useCallingActions } from '../ducks/calling';
|
import { useCallingActions } from '../ducks/calling';
|
||||||
import { getPreferredBadgeSelector } from '../selectors/badges';
|
import { getPreferredBadgeSelector } from '../selectors/badges';
|
||||||
import { getIntl, getInteractionMode, getTheme } from '../selectors/user';
|
import {
|
||||||
|
getIntl,
|
||||||
|
getInteractionMode,
|
||||||
|
getTheme,
|
||||||
|
getPlatform,
|
||||||
|
} from '../selectors/user';
|
||||||
import { getTargetedMessage } from '../selectors/conversations';
|
import { getTargetedMessage } from '../selectors/conversations';
|
||||||
import { getTimelineItem } from '../selectors/timeline';
|
import { getTimelineItem } from '../selectors/timeline';
|
||||||
import {
|
import {
|
||||||
|
@ -67,6 +72,7 @@ export function SmartTimelineItem(props: ExternalProps): JSX.Element {
|
||||||
const getPreferredBadge = useSelector(getPreferredBadgeSelector);
|
const getPreferredBadge = useSelector(getPreferredBadgeSelector);
|
||||||
const interactionMode = useSelector(getInteractionMode);
|
const interactionMode = useSelector(getInteractionMode);
|
||||||
const theme = useSelector(getTheme);
|
const theme = useSelector(getTheme);
|
||||||
|
const platform = useSelector(getPlatform);
|
||||||
const item = useProxySelector(getTimelineItem, messageId);
|
const item = useProxySelector(getTimelineItem, messageId);
|
||||||
const previousItem = useProxySelector(getTimelineItem, previousMessageId);
|
const previousItem = useProxySelector(getTimelineItem, previousMessageId);
|
||||||
const nextItem = useProxySelector(getTimelineItem, nextMessageId);
|
const nextItem = useProxySelector(getTimelineItem, nextMessageId);
|
||||||
|
@ -166,6 +172,7 @@ export function SmartTimelineItem(props: ExternalProps): JSX.Element {
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
interactionMode={interactionMode}
|
interactionMode={interactionMode}
|
||||||
theme={theme}
|
theme={theme}
|
||||||
|
platform={platform}
|
||||||
blockGroupLinkRequests={blockGroupLinkRequests}
|
blockGroupLinkRequests={blockGroupLinkRequests}
|
||||||
checkForAccount={checkForAccount}
|
checkForAccount={checkForAccount}
|
||||||
clearTargetedMessage={clearSelectedMessage}
|
clearTargetedMessage={clearSelectedMessage}
|
||||||
|
|
Loading…
Reference in a new issue