signal-desktop/ts/components/LeftPane.stories.tsx

1061 lines
28 KiB
TypeScript
Raw Normal View History

2023-01-03 19:55:46 +00:00
// Copyright 2020 Signal Messenger, LLC
2020-10-30 20:34:04 +00:00
// SPDX-License-Identifier: AGPL-3.0-only
2020-08-21 16:09:39 +00:00
import * as React from 'react';
import { action } from '@storybook/addon-actions';
import type { Meta } from '@storybook/react';
import type { PropsType } from './LeftPane';
import { LeftPane } from './LeftPane';
import { CaptchaDialog } from './CaptchaDialog';
2022-01-11 20:02:46 +00:00
import { CrashReportDialog } from './CrashReportDialog';
import { ToastManager } from './ToastManager';
2023-01-18 23:31:10 +00:00
import type { PropsType as DialogNetworkStatusPropsType } from './DialogNetworkStatus';
import { DialogExpiredBuild } from './DialogExpiredBuild';
import { DialogNetworkStatus } from './DialogNetworkStatus';
import { DialogRelink } from './DialogRelink';
import type { PropsType as DialogUpdatePropsType } from './DialogUpdate';
import { DialogUpdate } from './DialogUpdate';
import { UnsupportedOSDialog } from './UnsupportedOSDialog';
import type { ConversationType } from '../state/ducks/conversations';
import { MessageSearchResult } from './conversationList/MessageSearchResult';
2021-09-18 00:30:08 +00:00
import { setupI18n } from '../util/setupI18n';
2023-01-18 23:31:10 +00:00
import { DurationInSeconds, DAY } from '../util/durations';
2020-08-21 16:09:39 +00:00
import enMessages from '../../_locales/en/messages.json';
import { LeftPaneMode } from '../types/leftPane';
2021-11-17 21:11:21 +00:00
import { ThemeType } from '../types/Util';
import {
getDefaultConversation,
getDefaultGroupListItem,
} from '../test-both/helpers/getDefaultConversation';
2023-01-18 23:31:10 +00:00
import { DialogType } from '../types/Dialogs';
import { SocketStatus } from '../types/SocketStatus';
2021-11-02 23:01:13 +00:00
import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext';
import {
makeFakeLookupConversationWithoutServiceId,
useUuidFetchState,
} from '../test-both/helpers/fakeLookupConversationWithoutServiceId';
import type { GroupListItemConversationType } from './conversationList/GroupListItem';
2020-09-12 00:46:52 +00:00
2020-08-21 16:09:39 +00:00
const i18n = setupI18n('en', enMessages);
2023-01-18 23:31:10 +00:00
type OverridePropsType = Partial<PropsType> & {
dialogNetworkStatus?: Partial<DialogNetworkStatusPropsType>;
dialogUpdate?: Partial<DialogUpdatePropsType>;
};
2022-06-07 00:48:02 +00:00
export default {
title: 'Components/LeftPane',
argTypes: {},
args: {},
} satisfies Meta<PropsType>;
2020-08-21 16:09:39 +00:00
2021-05-07 22:21:10 +00:00
const defaultConversations: Array<ConversationType> = [
getDefaultConversation({
2020-08-21 16:09:39 +00:00
id: 'fred-convo',
title: 'Fred Willard',
2021-05-07 22:21:10 +00:00
}),
getDefaultConversation({
2020-08-21 16:09:39 +00:00
id: 'marc-convo',
isSelected: true,
title: 'Marc Barraca',
2021-05-07 22:21:10 +00:00
}),
2020-08-21 16:09:39 +00:00
];
2022-01-27 22:12:26 +00:00
const defaultSearchProps = {
searchConversation: undefined,
searchDisabled: false,
searchTerm: 'hello',
startSearchCounter: 0,
};
const defaultGroups: Array<GroupListItemConversationType> = [
getDefaultGroupListItem({
id: 'biking-group',
title: 'Mtn Biking Arizona 🚵☀️⛰',
2021-05-07 22:21:10 +00:00
}),
getDefaultGroupListItem({
id: 'dance-group',
title: 'Are we dancers? 💃',
2021-05-07 22:21:10 +00:00
}),
];
2021-05-07 22:21:10 +00:00
const defaultArchivedConversations: Array<ConversationType> = [
getDefaultConversation({
2020-08-21 16:09:39 +00:00
id: 'michelle-archive-convo',
title: 'Michelle Mercure',
2021-05-07 22:21:10 +00:00
isArchived: true,
}),
2020-08-21 16:09:39 +00:00
];
2021-05-07 22:21:10 +00:00
const pinnedConversations: Array<ConversationType> = [
getDefaultConversation({
id: 'philly-convo',
isPinned: true,
title: 'Philip Glass',
2021-05-07 22:21:10 +00:00
}),
getDefaultConversation({
id: 'robbo-convo',
isPinned: true,
title: 'Robert Moog',
2021-05-07 22:21:10 +00:00
}),
];
const defaultModeSpecificProps = {
2022-01-27 22:12:26 +00:00
...defaultSearchProps,
mode: LeftPaneMode.Inbox as const,
pinnedConversations,
conversations: defaultConversations,
archivedConversations: defaultArchivedConversations,
isAboutToSearch: false,
};
const emptySearchResultsGroup = { isLoading: false, results: [] };
2023-01-18 23:31:10 +00:00
const useProps = (overrideProps: OverridePropsType = {}): PropsType => {
let modeSpecificProps =
overrideProps.modeSpecificProps ?? defaultModeSpecificProps;
const [uuidFetchState, setIsFetchingUUID] = useUuidFetchState(
'uuidFetchState' in modeSpecificProps
? modeSpecificProps.uuidFetchState
: {}
);
if ('uuidFetchState' in modeSpecificProps) {
modeSpecificProps = {
...modeSpecificProps,
uuidFetchState,
};
}
const isUpdateDownloaded = false;
2023-01-18 23:31:10 +00:00
return {
2023-08-21 20:12:27 +00:00
otherTabsUnreadStats: {
unreadCount: 0,
unreadMentionsCount: 0,
markedUnread: false,
},
clearConversationSearch: action('clearConversationSearch'),
clearGroupCreationError: action('clearGroupCreationError'),
clearSearch: action('clearSearch'),
closeMaximumGroupSizeModal: action('closeMaximumGroupSizeModal'),
closeRecommendedGroupSizeModal: action('closeRecommendedGroupSizeModal'),
composeDeleteAvatarFromDisk: action('composeDeleteAvatarFromDisk'),
composeReplaceAvatar: action('composeReplaceAvatar'),
composeSaveAvatarToDisk: action('composeSaveAvatarToDisk'),
createGroup: action('createGroup'),
getPreferredBadge: () => undefined,
hasFailedStorySends: false,
hasPendingUpdate: false,
i18n,
isMacOS: false,
preferredWidthFromStorage: 320,
challengeStatus: 'idle',
crashReportCount: 0,
hasNetworkDialog: false,
hasExpiredDialog: false,
hasRelinkDialog: false,
hasUpdateDialog: false,
unsupportedOSDialogType: undefined,
usernameCorrupted: false,
usernameLinkCorrupted: false,
2023-01-18 23:31:10 +00:00
isUpdateDownloaded,
navTabsCollapsed: false,
2023-01-18 23:31:10 +00:00
setChallengeStatus: action('setChallengeStatus'),
lookupConversationWithoutServiceId:
makeFakeLookupConversationWithoutServiceId(),
showUserNotFoundModal: action('showUserNotFoundModal'),
setIsFetchingUUID,
showConversation: action('showConversation'),
2023-04-05 20:48:00 +00:00
blockConversation: action('blockConversation'),
onOutgoingAudioCallInConversation: action(
'onOutgoingAudioCallInConversation'
),
onOutgoingVideoCallInConversation: action(
'onOutgoingVideoCallInConversation'
),
removeConversation: action('removeConversation'),
renderMessageSearchResult: (id: string) => (
<MessageSearchResult
body="Lorem ipsum wow"
bodyRanges={[]}
conversationId="marc-convo"
from={defaultConversations[0]}
getPreferredBadge={() => undefined}
i18n={i18n}
id={id}
sentAt={1587358800000}
showConversation={action('showConversation')}
snippet="Lorem <<left>>ipsum<<right>> wow"
theme={ThemeType.light}
to={defaultConversations[1]}
/>
),
2023-01-18 23:31:10 +00:00
renderNetworkStatus: props => (
<DialogNetworkStatus
i18n={i18n}
socketStatus={SocketStatus.CLOSED}
isOnline={false}
isOutage={false}
2023-01-18 23:31:10 +00:00
manualReconnect={action('manualReconnect')}
{...overrideProps.dialogNetworkStatus}
{...props}
/>
),
renderRelinkDialog: props => (
<DialogRelink
i18n={i18n}
relinkDevice={action('relinkDevice')}
{...props}
/>
),
renderUpdateDialog: props => (
<DialogUpdate
i18n={i18n}
dialogType={
2023-03-15 16:57:27 +00:00
isUpdateDownloaded ? DialogType.AutoUpdate : DialogType.DownloadReady
2023-01-18 23:31:10 +00:00
}
dismissDialog={action('dismissUpdate')}
snoozeUpdate={action('snoozeUpdate')}
startUpdate={action('startUpdate')}
currentVersion="1.0.0"
{...overrideProps.dialogUpdate}
{...props}
/>
),
renderCaptchaDialog: () => (
<CaptchaDialog
i18n={i18n}
isPending={overrideProps.challengeStatus === 'pending'}
onContinue={action('onCaptchaContinue')}
onSkip={action('onCaptchaSkip')}
/>
),
renderCrashReportDialog: () => (
<CrashReportDialog
i18n={i18n}
isPending={false}
writeCrashReportsToLog={action('writeCrashReportsToLog')}
eraseCrashReports={action('eraseCrashReports')}
/>
),
2023-01-18 23:31:10 +00:00
renderExpiredBuildDialog: props => <DialogExpiredBuild {...props} />,
renderUnsupportedOSDialog: props => (
<UnsupportedOSDialog
i18n={i18n}
OS="macOS"
expirationTimestamp={Date.now() + 5 * DAY}
{...props}
/>
),
renderToastManager: ({ containerWidthBreakpoint }) => (
<ToastManager
OS="unused"
hideToast={action('hideToast')}
i18n={i18n}
onShowDebugLog={action('onShowDebugLog')}
onUndoArchive={action('onUndoArchive')}
openFileInFolder={action('openFileInFolder')}
toast={undefined}
megaphone={undefined}
containerWidthBreakpoint={containerWidthBreakpoint}
/>
),
selectedConversationId: undefined,
2023-03-20 22:23:53 +00:00
targetedMessageId: undefined,
2024-02-06 18:35:59 +00:00
openUsernameReservationModal: action('openUsernameReservationModal'),
savePreferredLeftPaneWidth: action('savePreferredLeftPaneWidth'),
searchInConversation: action('searchInConversation'),
setComposeSearchTerm: action('setComposeSearchTerm'),
setComposeSelectedRegion: action('setComposeSelectedRegion'),
setComposeGroupAvatar: action('setComposeGroupAvatar'),
setComposeGroupName: action('setComposeGroupName'),
setComposeGroupExpireTimer: action('setComposeGroupExpireTimer'),
showArchivedConversations: action('showArchivedConversations'),
showInbox: action('showInbox'),
startComposing: action('startComposing'),
showChooseGroupMembers: action('showChooseGroupMembers'),
showFindByUsername: action('showFindByUsername'),
showFindByPhoneNumber: action('showFindByPhoneNumber'),
startSearch: action('startSearch'),
startSettingGroupMetadata: action('startSettingGroupMetadata'),
theme: React.useContext(StorybookThemeContext),
toggleComposeEditingAvatar: action('toggleComposeEditingAvatar'),
toggleConversationInChooseMembers: action(
'toggleConversationInChooseMembers'
),
2023-08-09 00:53:06 +00:00
toggleNavTabsCollapse: action('toggleNavTabsCollapse'),
toggleProfileEditor: action('toggleProfileEditor'),
updateSearchTerm: action('updateSearchTerm'),
...overrideProps,
modeSpecificProps,
};
};
2020-08-21 16:09:39 +00:00
2023-04-05 20:48:00 +00:00
function LeftPaneInContainer(props: PropsType): JSX.Element {
return (
<div style={{ height: '600px' }}>
<LeftPane {...props} />
</div>
);
}
2022-11-18 00:45:19 +00:00
export function InboxNoConversations(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Inbox,
pinnedConversations: [],
conversations: [],
archivedConversations: [],
isAboutToSearch: false,
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2022-06-07 00:48:02 +00:00
export function InboxUsernameCorrupted(): JSX.Element {
return (
<LeftPaneInContainer
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Inbox,
pinnedConversations: [],
conversations: [],
archivedConversations: [],
isAboutToSearch: false,
},
usernameCorrupted: true,
})}
/>
);
}
export function InboxUsernameLinkCorrupted(): JSX.Element {
return (
<LeftPaneInContainer
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Inbox,
pinnedConversations: [],
conversations: [],
archivedConversations: [],
isAboutToSearch: false,
},
usernameLinkCorrupted: true,
})}
/>
);
}
2022-11-18 00:45:19 +00:00
export function InboxOnlyPinnedConversations(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Inbox,
pinnedConversations,
conversations: [],
archivedConversations: [],
isAboutToSearch: false,
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2022-06-07 00:48:02 +00:00
2022-11-18 00:45:19 +00:00
export function InboxOnlyNonPinnedConversations(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Inbox,
pinnedConversations: [],
conversations: defaultConversations,
archivedConversations: [],
isAboutToSearch: false,
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2022-06-07 00:48:02 +00:00
2022-11-18 00:45:19 +00:00
export function InboxOnlyArchivedConversations(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Inbox,
pinnedConversations: [],
conversations: [],
archivedConversations: defaultArchivedConversations,
isAboutToSearch: false,
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2022-11-18 00:45:19 +00:00
export function InboxPinnedAndArchivedConversations(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Inbox,
pinnedConversations,
conversations: [],
archivedConversations: defaultArchivedConversations,
isAboutToSearch: false,
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2022-11-18 00:45:19 +00:00
export function InboxNonPinnedAndArchivedConversations(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Inbox,
pinnedConversations: [],
conversations: defaultConversations,
archivedConversations: defaultArchivedConversations,
isAboutToSearch: false,
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2022-06-07 00:48:02 +00:00
2022-11-18 00:45:19 +00:00
export function InboxPinnedAndNonPinnedConversations(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Inbox,
pinnedConversations,
conversations: defaultConversations,
archivedConversations: [],
isAboutToSearch: false,
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2022-06-07 00:48:02 +00:00
2022-11-18 00:45:19 +00:00
export function InboxPinnedNonPinnedAndArchivedConversations(): JSX.Element {
2023-04-05 20:48:00 +00:00
return <LeftPaneInContainer {...useProps()} />;
2022-11-18 00:45:19 +00:00
}
2022-11-18 00:45:19 +00:00
export function SearchNoResultsWhenSearchingEverywhere(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Search,
conversationResults: emptySearchResultsGroup,
contactResults: emptySearchResultsGroup,
messageResults: emptySearchResultsGroup,
primarySendsSms: false,
},
})}
/>
);
}
2022-06-07 00:48:02 +00:00
2022-11-18 00:45:19 +00:00
export function SearchNoResultsWhenSearchingEverywhereSms(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Search,
conversationResults: emptySearchResultsGroup,
contactResults: emptySearchResultsGroup,
messageResults: emptySearchResultsGroup,
primarySendsSms: true,
},
})}
/>
);
}
2022-11-18 00:45:19 +00:00
export function SearchNoResultsWhenSearchingInAConversation(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Search,
conversationResults: emptySearchResultsGroup,
contactResults: emptySearchResultsGroup,
messageResults: emptySearchResultsGroup,
searchConversationName: 'Bing Bong',
primarySendsSms: false,
},
})}
/>
);
}
2022-11-18 00:45:19 +00:00
export function SearchAllResultsLoading(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Search,
conversationResults: { isLoading: true },
contactResults: { isLoading: true },
messageResults: { isLoading: true },
primarySendsSms: false,
},
})}
/>
);
}
2022-11-18 00:45:19 +00:00
export function SearchSomeResultsLoading(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Search,
conversationResults: {
isLoading: false,
results: defaultConversations,
},
contactResults: { isLoading: true },
messageResults: { isLoading: true },
primarySendsSms: false,
2020-08-21 16:09:39 +00:00
},
2022-11-18 00:45:19 +00:00
})}
/>
);
}
2022-11-18 00:45:19 +00:00
export function SearchHasConversationsAndContactsButNotMessages(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-06-07 00:48:02 +00:00
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Search,
conversationResults: {
isLoading: false,
results: defaultConversations,
},
contactResults: { isLoading: false, results: defaultConversations },
messageResults: { isLoading: false, results: [] },
primarySendsSms: false,
2020-08-21 16:09:39 +00:00
},
2022-06-07 00:48:02 +00:00
})}
/>
);
2022-11-18 00:45:19 +00:00
}
2022-06-07 00:48:02 +00:00
2022-11-18 00:45:19 +00:00
export function SearchAllResults(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Search,
conversationResults: {
isLoading: false,
results: defaultConversations,
},
contactResults: { isLoading: false, results: defaultConversations },
messageResults: {
isLoading: false,
results: [
{ id: 'msg1', type: 'outgoing', conversationId: 'foo' },
{ id: 'msg2', type: 'incoming', conversationId: 'bar' },
],
},
primarySendsSms: false,
2020-08-21 16:09:39 +00:00
},
2022-11-18 00:45:19 +00:00
})}
/>
);
}
2022-11-18 00:45:19 +00:00
export function ArchiveNoArchivedConversations(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.Archive,
archivedConversations: [],
searchConversation: undefined,
searchTerm: '',
startSearchCounter: 0,
},
})}
/>
);
}
2022-06-07 00:48:02 +00:00
2022-11-18 00:45:19 +00:00
export function ArchiveArchivedConversations(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.Archive,
archivedConversations: defaultConversations,
searchConversation: undefined,
searchTerm: '',
startSearchCounter: 0,
},
})}
/>
);
}
2021-11-01 18:43:02 +00:00
2022-11-18 00:45:19 +00:00
export function ArchiveSearchingAConversation(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.Archive,
archivedConversations: defaultConversations,
searchConversation: undefined,
searchTerm: '',
startSearchCounter: 0,
},
})}
/>
);
}
2022-11-18 00:45:19 +00:00
export function ComposeNoResults(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.Compose,
composeContacts: [],
composeGroups: [],
uuidFetchState: {},
regionCode: 'US',
searchTerm: '',
2024-02-14 18:18:49 +00:00
username: undefined,
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2022-11-18 00:45:19 +00:00
export function ComposeSomeContactsNoSearchTerm(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.Compose,
composeContacts: defaultConversations,
composeGroups: [],
uuidFetchState: {},
regionCode: 'US',
searchTerm: '',
2024-02-14 18:18:49 +00:00
username: undefined,
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2022-06-07 00:48:02 +00:00
2022-11-18 00:45:19 +00:00
export function ComposeSomeContactsWithASearchTerm(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.Compose,
composeContacts: defaultConversations,
composeGroups: [],
uuidFetchState: {},
regionCode: 'US',
searchTerm: 'ar',
2024-02-14 18:18:49 +00:00
username: undefined,
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2022-06-07 00:48:02 +00:00
2022-11-18 00:45:19 +00:00
export function ComposeSomeGroupsNoSearchTerm(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.Compose,
composeContacts: [],
composeGroups: defaultGroups,
uuidFetchState: {},
regionCode: 'US',
searchTerm: '',
2024-02-14 18:18:49 +00:00
username: undefined,
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2022-06-07 00:48:02 +00:00
2022-11-18 00:45:19 +00:00
export function ComposeSomeGroupsWithSearchTerm(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.Compose,
composeContacts: [],
composeGroups: defaultGroups,
uuidFetchState: {},
regionCode: 'US',
searchTerm: 'ar',
2024-02-14 18:18:49 +00:00
username: undefined,
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2022-11-18 00:45:19 +00:00
export function ComposeSearchIsValidUsername(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.Compose,
composeContacts: [],
composeGroups: [],
uuidFetchState: {},
regionCode: 'US',
searchTerm: 'someone',
2024-02-14 18:18:49 +00:00
username: 'someone',
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2021-11-12 01:17:29 +00:00
2022-11-18 00:45:19 +00:00
export function ComposeSearchIsValidUsernameFetchingUsername(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.Compose,
composeContacts: [],
composeGroups: [],
uuidFetchState: {
'username:someone': true,
},
regionCode: 'US',
searchTerm: 'someone',
2024-02-14 18:18:49 +00:00
username: 'someone',
},
2022-11-18 00:45:19 +00:00
})}
/>
);
}
2021-11-12 01:17:29 +00:00
2022-11-18 00:45:19 +00:00
export function ComposeSearchIsValidPhoneNumber(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.Compose,
composeContacts: [],
composeGroups: [],
uuidFetchState: {},
regionCode: 'US',
searchTerm: '2125555454',
2024-02-14 18:18:49 +00:00
username: undefined,
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2022-06-07 00:48:02 +00:00
2022-11-18 00:45:19 +00:00
export function ComposeSearchIsValidPhoneNumberFetchingPhoneNumber(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.Compose,
composeContacts: [],
composeGroups: [],
uuidFetchState: {
'e164:+12125555454': true,
},
regionCode: 'US',
searchTerm: '(212)5555454',
2024-02-14 18:18:49 +00:00
username: undefined,
},
})}
/>
2022-06-07 00:48:02 +00:00
);
2022-11-18 00:45:19 +00:00
}
2022-11-18 00:45:19 +00:00
export function ComposeAllKindsOfResultsNoSearchTerm(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.Compose,
composeContacts: defaultConversations,
composeGroups: defaultGroups,
uuidFetchState: {},
regionCode: 'US',
searchTerm: '',
2024-02-14 18:18:49 +00:00
username: undefined,
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2022-06-07 00:48:02 +00:00
2022-11-18 00:45:19 +00:00
export function ComposeAllKindsOfResultsWithASearchTerm(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.Compose,
composeContacts: defaultConversations,
composeGroups: defaultGroups,
uuidFetchState: {},
regionCode: 'US',
searchTerm: 'someone',
2024-02-14 18:18:49 +00:00
username: 'someone',
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2022-11-18 00:45:19 +00:00
export function CaptchaDialogRequired(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Inbox,
pinnedConversations,
conversations: defaultConversations,
archivedConversations: [],
isAboutToSearch: false,
2022-11-18 00:45:19 +00:00
searchTerm: '',
},
challengeStatus: 'required',
})}
/>
);
}
2022-06-07 00:48:02 +00:00
2022-11-18 00:45:19 +00:00
export function CaptchaDialogPending(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Inbox,
pinnedConversations,
conversations: defaultConversations,
archivedConversations: [],
isAboutToSearch: false,
2022-11-18 00:45:19 +00:00
searchTerm: '',
},
challengeStatus: 'pending',
})}
/>
);
}
export function _CrashReportDialog(): JSX.Element {
return (
<LeftPaneInContainer
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Inbox,
pinnedConversations,
conversations: defaultConversations,
archivedConversations: [],
isAboutToSearch: false,
searchTerm: '',
},
crashReportCount: 42,
})}
/>
);
}
2022-11-18 00:45:19 +00:00
export function ChooseGroupMembersPartialPhoneNumber(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.ChooseGroupMembers,
uuidFetchState: {},
candidateContacts: [],
groupSizeRecommendedLimit: 151,
groupSizeHardLimit: 1001,
isShowingRecommendedGroupSizeModal: false,
isShowingMaximumGroupSizeModal: false,
ourE164: undefined,
ourUsername: undefined,
2022-11-18 00:45:19 +00:00
searchTerm: '+1(212) 555',
2024-02-14 18:18:49 +00:00
username: undefined,
2022-11-18 00:45:19 +00:00
regionCode: 'US',
selectedContacts: [],
},
})}
/>
);
}
2022-11-18 00:45:19 +00:00
export function ChooseGroupMembersValidPhoneNumber(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.ChooseGroupMembers,
uuidFetchState: {},
candidateContacts: [],
groupSizeRecommendedLimit: 151,
groupSizeHardLimit: 1001,
isShowingRecommendedGroupSizeModal: false,
isShowingMaximumGroupSizeModal: false,
ourE164: undefined,
ourUsername: undefined,
2022-11-18 00:45:19 +00:00
searchTerm: '+1(212) 555 5454',
regionCode: 'US',
selectedContacts: [],
2024-02-14 18:18:49 +00:00
username: undefined,
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2022-11-18 00:45:19 +00:00
export function ChooseGroupMembersUsername(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.ChooseGroupMembers,
uuidFetchState: {},
candidateContacts: [],
groupSizeRecommendedLimit: 151,
groupSizeHardLimit: 1001,
isShowingRecommendedGroupSizeModal: false,
isShowingMaximumGroupSizeModal: false,
ourE164: undefined,
ourUsername: undefined,
2024-02-14 18:18:49 +00:00
searchTerm: 'signal.01',
2022-11-18 00:45:19 +00:00
regionCode: 'US',
selectedContacts: [],
2024-02-14 18:18:49 +00:00
username: 'signal.01',
2022-11-18 00:45:19 +00:00
},
})}
/>
);
}
2022-06-17 00:38:28 +00:00
2022-11-18 00:45:19 +00:00
export function GroupMetadataNoTimer(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.SetGroupMetadata,
groupAvatar: undefined,
groupName: 'Group 1',
groupExpireTimer: DurationInSeconds.ZERO,
hasError: false,
isCreating: false,
isEditingAvatar: false,
selectedContacts: defaultConversations,
userAvatarData: [],
},
})}
/>
);
}
2022-11-18 00:45:19 +00:00
export function GroupMetadataRegularTimer(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.SetGroupMetadata,
groupAvatar: undefined,
groupName: 'Group 1',
groupExpireTimer: DurationInSeconds.DAY,
hasError: false,
isCreating: false,
isEditingAvatar: false,
selectedContacts: defaultConversations,
userAvatarData: [],
},
})}
/>
);
}
2022-06-07 00:48:02 +00:00
2022-11-18 00:45:19 +00:00
export function GroupMetadataCustomTimer(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
mode: LeftPaneMode.SetGroupMetadata,
groupAvatar: undefined,
groupName: 'Group 1',
groupExpireTimer: DurationInSeconds.fromHours(7),
hasError: false,
isCreating: false,
isEditingAvatar: false,
selectedContacts: defaultConversations,
userAvatarData: [],
},
})}
/>
);
}
2022-06-07 00:48:02 +00:00
2022-11-18 00:45:19 +00:00
export function SearchingConversation(): JSX.Element {
return (
2023-04-05 20:48:00 +00:00
<LeftPaneInContainer
2022-11-18 00:45:19 +00:00
{...useProps({
modeSpecificProps: {
...defaultSearchProps,
mode: LeftPaneMode.Inbox,
pinnedConversations: [],
conversations: defaultConversations,
archivedConversations: [],
isAboutToSearch: false,
2022-11-18 00:45:19 +00:00
searchConversation: getDefaultConversation(),
searchTerm: '',
},
})}
/>
);
}