mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Add preview for the new dialog
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2026 Element Creations Ltd.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||||
|
* Please see LICENSE files in the repository root for full details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.element.android.features.messages.impl.timeline.sendfailure
|
||||||
|
|
||||||
|
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
||||||
|
import io.element.android.features.messages.impl.timeline.aTimelineItemEvent
|
||||||
|
|
||||||
|
class SendFailureDialogStateProvider : PreviewParameterProvider<SendFailureDialogState> {
|
||||||
|
override val values: Sequence<SendFailureDialogState>
|
||||||
|
get() = sequenceOf(
|
||||||
|
SendFailureDialogState.Hidden,
|
||||||
|
SendFailureDialogState.Show(
|
||||||
|
event = aTimelineItemEvent(),
|
||||||
|
message = "Failed to send message",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
+15
@@ -10,8 +10,10 @@ package io.element.android.features.messages.impl.timeline.sendfailure
|
|||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.tooling.preview.PreviewParameter
|
||||||
import io.element.android.features.messages.impl.timeline.model.TimelineItem
|
import io.element.android.features.messages.impl.timeline.model.TimelineItem
|
||||||
import io.element.android.libraries.designsystem.components.dialogs.ConfirmationDialog
|
import io.element.android.libraries.designsystem.components.dialogs.ConfirmationDialog
|
||||||
|
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
|
||||||
import io.element.android.libraries.ui.strings.CommonStrings
|
import io.element.android.libraries.ui.strings.CommonStrings
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@@ -40,3 +42,16 @@ fun SendFailureDialogView(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreviewsDayNight
|
||||||
|
@Composable
|
||||||
|
fun SendFailureDialogViewPreview(
|
||||||
|
@PreviewParameter(SendFailureDialogStateProvider::class) sendFailureDialogState: SendFailureDialogState,
|
||||||
|
) {
|
||||||
|
SendFailureDialogView(
|
||||||
|
sendFailureDialogState = sendFailureDialogState,
|
||||||
|
onDismiss = {},
|
||||||
|
onRetry = {},
|
||||||
|
onRemoveMessage = {}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user