change(design) : Announcement clean up.
This commit is contained in:
parent
d5e1331e2c
commit
91753514c5
1 changed files with 7 additions and 4 deletions
|
|
@ -35,6 +35,9 @@ import io.element.android.libraries.designsystem.theme.components.Surface
|
||||||
import io.element.android.libraries.designsystem.theme.components.Text
|
import io.element.android.libraries.designsystem.theme.components.Text
|
||||||
import io.element.android.libraries.ui.strings.CommonStrings
|
import io.element.android.libraries.ui.strings.CommonStrings
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Announcement component following design system https://www.figma.com/design/G1xy0HDZKJf5TCRFmKb5d5/Compound-Android-Components?node-id=2002-2154.
|
||||||
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun Announcement(
|
fun Announcement(
|
||||||
title: String,
|
title: String,
|
||||||
|
|
@ -46,7 +49,7 @@ fun Announcement(
|
||||||
is AnnouncementType.Informative -> InformativeAnnouncement(
|
is AnnouncementType.Informative -> InformativeAnnouncement(
|
||||||
title = title,
|
title = title,
|
||||||
description = description,
|
description = description,
|
||||||
isError = type.isError,
|
isError = type.isCritical,
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
)
|
)
|
||||||
is AnnouncementType.Actionable -> ActionableAnnouncement(
|
is AnnouncementType.Actionable -> ActionableAnnouncement(
|
||||||
|
|
@ -62,7 +65,7 @@ fun Announcement(
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
sealed interface AnnouncementType {
|
sealed interface AnnouncementType {
|
||||||
data class Informative(val isError: Boolean = false) : AnnouncementType
|
data class Informative(val isCritical: Boolean = false) : AnnouncementType
|
||||||
data class Actionable(
|
data class Actionable(
|
||||||
val actionText: String,
|
val actionText: String,
|
||||||
val onActionClick: () -> Unit,
|
val onActionClick: () -> Unit,
|
||||||
|
|
@ -188,12 +191,12 @@ internal fun AnnouncementPreview() = ElementPreview {
|
||||||
Announcement(
|
Announcement(
|
||||||
title = "Headline",
|
title = "Headline",
|
||||||
description = "Text description goes here.",
|
description = "Text description goes here.",
|
||||||
type = AnnouncementType.Informative(isError = false),
|
type = AnnouncementType.Informative(isCritical = false),
|
||||||
)
|
)
|
||||||
Announcement(
|
Announcement(
|
||||||
title = "Headline",
|
title = "Headline",
|
||||||
description = "Text description goes here.",
|
description = "Text description goes here.",
|
||||||
type = AnnouncementType.Informative(isError = true),
|
type = AnnouncementType.Informative(isCritical = true),
|
||||||
)
|
)
|
||||||
Announcement(
|
Announcement(
|
||||||
title = "Headline",
|
title = "Headline",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue