Voice notes mini-player

This commit is contained in:
Alvaro 2023-02-24 16:18:57 -07:00 committed by GitHub
parent b5849f872a
commit 0e655ceeed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 1599 additions and 487 deletions

View file

@ -3,7 +3,7 @@
import type { ReactElement } from 'react';
import React from 'react';
import { GlobalAudioContext } from '../../components/GlobalAudioContext';
import { VoiceNotesPlaybackContext } from '../../components/VoiceNotesPlaybackContext';
import type { Props as MessageAudioProps } from './MessageAudio';
import { SmartMessageAudio } from './MessageAudio';
@ -13,14 +13,14 @@ export function renderAudioAttachment(
props: AudioAttachmentProps
): ReactElement {
return (
<GlobalAudioContext.Consumer>
{globalAudioProps => {
<VoiceNotesPlaybackContext.Consumer>
{voiceNotesPlaybackProps => {
return (
globalAudioProps && (
<SmartMessageAudio {...props} {...globalAudioProps} />
voiceNotesPlaybackProps && (
<SmartMessageAudio {...props} {...voiceNotesPlaybackProps} />
)
);
}}
</GlobalAudioContext.Consumer>
</VoiceNotesPlaybackContext.Consumer>
);
}