Fixes storybook for AudioCapture
This commit is contained in:
parent
99c95794af
commit
b5947e0ef1
7 changed files with 27 additions and 21 deletions
|
@ -16,7 +16,7 @@ import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext';
|
||||||
|
|
||||||
import { fakeDraftAttachment } from '../test-both/helpers/fakeAttachment';
|
import { fakeDraftAttachment } from '../test-both/helpers/fakeAttachment';
|
||||||
import { landscapeGreenUrl } from '../storybook/Fixtures';
|
import { landscapeGreenUrl } from '../storybook/Fixtures';
|
||||||
import { RecordingState } from '../state/ducks/audioRecorder';
|
import { RecordingState } from '../types/AudioRecorder';
|
||||||
import { ConversationColors } from '../types/Colors';
|
import { ConversationColors } from '../types/Colors';
|
||||||
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
|
||||||
import { PaymentEventKind } from '../types/Payment';
|
import { PaymentEventKind } from '../types/Payment';
|
||||||
|
|
|
@ -9,8 +9,8 @@ import type {
|
||||||
LocalizerType,
|
LocalizerType,
|
||||||
ThemeType,
|
ThemeType,
|
||||||
} from '../types/Util';
|
} from '../types/Util';
|
||||||
import type { ErrorDialogAudioRecorderType } from '../state/ducks/audioRecorder';
|
import type { ErrorDialogAudioRecorderType } from '../types/AudioRecorder';
|
||||||
import { RecordingState } from '../state/ducks/audioRecorder';
|
import { RecordingState } from '../types/AudioRecorder';
|
||||||
import type { imageToBlurHash } from '../util/imageToBlurHash';
|
import type { imageToBlurHash } from '../util/imageToBlurHash';
|
||||||
import { Spinner } from './Spinner';
|
import { Spinner } from './Spinner';
|
||||||
import type {
|
import type {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { select } from '@storybook/addon-knobs';
|
||||||
import {
|
import {
|
||||||
ErrorDialogAudioRecorderType,
|
ErrorDialogAudioRecorderType,
|
||||||
RecordingState,
|
RecordingState,
|
||||||
} from '../../state/ducks/audioRecorder';
|
} from '../../types/AudioRecorder';
|
||||||
import type { PropsType } from './AudioCapture';
|
import type { PropsType } from './AudioCapture';
|
||||||
import { AudioCapture } from './AudioCapture';
|
import { AudioCapture } from './AudioCapture';
|
||||||
import { setupI18n } from '../../util/setupI18n';
|
import { setupI18n } from '../../util/setupI18n';
|
||||||
|
|
|
@ -11,10 +11,6 @@ import type {
|
||||||
} from '../../types/Attachment';
|
} from '../../types/Attachment';
|
||||||
import { ConfirmationDialog } from '../ConfirmationDialog';
|
import { ConfirmationDialog } from '../ConfirmationDialog';
|
||||||
import type { LocalizerType } from '../../types/Util';
|
import type { LocalizerType } from '../../types/Util';
|
||||||
import {
|
|
||||||
ErrorDialogAudioRecorderType,
|
|
||||||
RecordingState,
|
|
||||||
} from '../../state/ducks/audioRecorder';
|
|
||||||
import { ToastVoiceNoteLimit } from '../ToastVoiceNoteLimit';
|
import { ToastVoiceNoteLimit } from '../ToastVoiceNoteLimit';
|
||||||
import { ToastVoiceNoteMustBeOnlyAttachment } from '../ToastVoiceNoteMustBeOnlyAttachment';
|
import { ToastVoiceNoteMustBeOnlyAttachment } from '../ToastVoiceNoteMustBeOnlyAttachment';
|
||||||
import { useEscapeHandling } from '../../hooks/useEscapeHandling';
|
import { useEscapeHandling } from '../../hooks/useEscapeHandling';
|
||||||
|
@ -22,6 +18,10 @@ import {
|
||||||
useStartRecordingShortcut,
|
useStartRecordingShortcut,
|
||||||
useKeyboardShortcuts,
|
useKeyboardShortcuts,
|
||||||
} from '../../hooks/useKeyboardShortcuts';
|
} from '../../hooks/useKeyboardShortcuts';
|
||||||
|
import {
|
||||||
|
ErrorDialogAudioRecorderType,
|
||||||
|
RecordingState,
|
||||||
|
} from '../../types/AudioRecorder';
|
||||||
|
|
||||||
type OnSendAudioRecordingType = (rec: InMemoryAttachmentDraftType) => unknown;
|
type OnSendAudioRecordingType = (rec: InMemoryAttachmentDraftType) => unknown;
|
||||||
|
|
||||||
|
|
|
@ -14,21 +14,13 @@ import { stringToMIMEType } from '../../types/MIME';
|
||||||
import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions';
|
import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions';
|
||||||
import { useBoundActions } from '../../hooks/useBoundActions';
|
import { useBoundActions } from '../../hooks/useBoundActions';
|
||||||
import { getComposerStateForConversation } from './composer';
|
import { getComposerStateForConversation } from './composer';
|
||||||
|
import {
|
||||||
export enum ErrorDialogAudioRecorderType {
|
ErrorDialogAudioRecorderType,
|
||||||
Blur,
|
RecordingState,
|
||||||
ErrorRecording,
|
} from '../../types/AudioRecorder';
|
||||||
Timeout,
|
|
||||||
}
|
|
||||||
|
|
||||||
// State
|
// State
|
||||||
|
|
||||||
export enum RecordingState {
|
|
||||||
Recording = 'recording',
|
|
||||||
Initializing = 'initializing',
|
|
||||||
Idle = 'idle',
|
|
||||||
}
|
|
||||||
|
|
||||||
export type AudioPlayerStateType = ReadonlyDeep<{
|
export type AudioPlayerStateType = ReadonlyDeep<{
|
||||||
recordingState: RecordingState;
|
recordingState: RecordingState;
|
||||||
errorDialogAudioRecorderType?: ErrorDialogAudioRecorderType;
|
errorDialogAudioRecorderType?: ErrorDialogAudioRecorderType;
|
||||||
|
|
|
@ -34,7 +34,7 @@ import {
|
||||||
REMOVE_PREVIEW as REMOVE_LINK_PREVIEW,
|
REMOVE_PREVIEW as REMOVE_LINK_PREVIEW,
|
||||||
} from './linkPreviews';
|
} from './linkPreviews';
|
||||||
import { LinkPreviewSourceType } from '../../types/LinkPreview';
|
import { LinkPreviewSourceType } from '../../types/LinkPreview';
|
||||||
import { RecordingState } from './audioRecorder';
|
import { RecordingState } from '../../types/AudioRecorder';
|
||||||
import { SHOW_TOAST } from './toast';
|
import { SHOW_TOAST } from './toast';
|
||||||
import { ToastType } from '../../types/Toast';
|
import { ToastType } from '../../types/Toast';
|
||||||
import { SafetyNumberChangeSource } from '../../components/SafetyNumberChangeDialog';
|
import { SafetyNumberChangeSource } from '../../components/SafetyNumberChangeDialog';
|
||||||
|
|
14
ts/types/AudioRecorder.ts
Normal file
14
ts/types/AudioRecorder.ts
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
// Copyright 2023 Signal Messenger, LLC
|
||||||
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
export enum ErrorDialogAudioRecorderType {
|
||||||
|
Blur,
|
||||||
|
ErrorRecording,
|
||||||
|
Timeout,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum RecordingState {
|
||||||
|
Recording = 'recording',
|
||||||
|
Initializing = 'initializing',
|
||||||
|
Idle = 'idle',
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue