Extract methods aMessageComposerModeEdit() and aMessageComposerModeReply()
This commit is contained in:
parent
751b5f73bf
commit
097d0567ac
1 changed files with 21 additions and 4 deletions
|
|
@ -579,7 +579,7 @@ internal fun TextComposerEditPreview() = ElementPreview {
|
||||||
ATextComposer(
|
ATextComposer(
|
||||||
TextEditorState.Rich(aRichTextEditorState(initialText = "A message", initialFocus = true)),
|
TextEditorState.Rich(aRichTextEditorState(initialText = "A message", initialFocus = true)),
|
||||||
voiceMessageState = VoiceMessageState.Idle,
|
voiceMessageState = VoiceMessageState.Idle,
|
||||||
composerMode = MessageComposerMode.Edit(EventId("$1234"), TransactionId("1234"), "Some text"),
|
composerMode = aMessageComposerModeEdit(),
|
||||||
enableVoiceMessages = true,
|
enableVoiceMessages = true,
|
||||||
)
|
)
|
||||||
}))
|
}))
|
||||||
|
|
@ -592,7 +592,7 @@ internal fun MarkdownTextComposerEditPreview() = ElementPreview {
|
||||||
ATextComposer(
|
ATextComposer(
|
||||||
TextEditorState.Markdown(aMarkdownTextEditorState(initialText = "A message", initialFocus = true)),
|
TextEditorState.Markdown(aMarkdownTextEditorState(initialText = "A message", initialFocus = true)),
|
||||||
voiceMessageState = VoiceMessageState.Idle,
|
voiceMessageState = VoiceMessageState.Idle,
|
||||||
composerMode = MessageComposerMode.Edit(EventId("$1234"), TransactionId("1234"), "Some text"),
|
composerMode = aMessageComposerModeEdit(),
|
||||||
enableVoiceMessages = true,
|
enableVoiceMessages = true,
|
||||||
)
|
)
|
||||||
}))
|
}))
|
||||||
|
|
@ -604,9 +604,8 @@ internal fun TextComposerReplyPreview(@PreviewParameter(InReplyToDetailsProvider
|
||||||
ATextComposer(
|
ATextComposer(
|
||||||
state = TextEditorState.Rich(aRichTextEditorState()),
|
state = TextEditorState.Rich(aRichTextEditorState()),
|
||||||
voiceMessageState = VoiceMessageState.Idle,
|
voiceMessageState = VoiceMessageState.Idle,
|
||||||
composerMode = MessageComposerMode.Reply(
|
composerMode = aMessageComposerModeReply(
|
||||||
replyToDetails = inReplyToDetails,
|
replyToDetails = inReplyToDetails,
|
||||||
hideImage = false,
|
|
||||||
),
|
),
|
||||||
enableVoiceMessages = true,
|
enableVoiceMessages = true,
|
||||||
)
|
)
|
||||||
|
|
@ -718,3 +717,21 @@ fun aRichTextEditorState(
|
||||||
initialMarkdown = initialMarkdown,
|
initialMarkdown = initialMarkdown,
|
||||||
initialFocus = initialFocus,
|
initialFocus = initialFocus,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fun aMessageComposerModeEdit(
|
||||||
|
eventId: EventId? = EventId("$1234"),
|
||||||
|
transactionId: TransactionId? = TransactionId("1234"),
|
||||||
|
content: String = "Some text",
|
||||||
|
) = MessageComposerMode.Edit(
|
||||||
|
eventId = eventId,
|
||||||
|
transactionId = transactionId,
|
||||||
|
content = content
|
||||||
|
)
|
||||||
|
|
||||||
|
fun aMessageComposerModeReply(
|
||||||
|
replyToDetails: InReplyToDetails,
|
||||||
|
hideImage: Boolean = false,
|
||||||
|
) = MessageComposerMode.Reply(
|
||||||
|
replyToDetails = replyToDetails,
|
||||||
|
hideImage = hideImage,
|
||||||
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue