|
| 1 | +/* |
| 2 | + * Copyright 2025 New Vector Ltd. |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial |
| 5 | + * Please see LICENSE files in the repository root for full details. |
| 6 | + */ |
| 7 | + |
| 8 | +package io.element.android.features.home.impl.components |
| 9 | + |
| 10 | +import androidx.compose.runtime.Composable |
| 11 | +import androidx.compose.ui.Modifier |
| 12 | +import androidx.compose.ui.res.stringResource |
| 13 | +import io.element.android.features.home.impl.R |
| 14 | +import io.element.android.libraries.designsystem.components.Announcement |
| 15 | +import io.element.android.libraries.designsystem.components.AnnouncementType |
| 16 | +import io.element.android.libraries.designsystem.preview.ElementPreview |
| 17 | +import io.element.android.libraries.designsystem.preview.PreviewsDayNight |
| 18 | +import io.element.android.libraries.ui.strings.CommonStrings |
| 19 | + |
| 20 | +@Composable |
| 21 | +internal fun NewNotificationSoundBanner( |
| 22 | + onDismissClick: () -> Unit, |
| 23 | + modifier: Modifier = Modifier, |
| 24 | +) { |
| 25 | + Announcement( |
| 26 | + modifier = modifier.roomListBannerPadding(), |
| 27 | + title = stringResource(R.string.banner_new_sound_title), |
| 28 | + description = stringResource(R.string.banner_new_sound_message), |
| 29 | + type = AnnouncementType.Actionable( |
| 30 | + actionText = stringResource(CommonStrings.action_ok), |
| 31 | + onActionClick = onDismissClick, |
| 32 | + onDismissClick = onDismissClick, |
| 33 | + ), |
| 34 | + ) |
| 35 | +} |
| 36 | + |
| 37 | +@PreviewsDayNight |
| 38 | +@Composable |
| 39 | +internal fun NewNotificationSoundBannerPreview() = ElementPreview { |
| 40 | + NewNotificationSoundBanner( |
| 41 | + onDismissClick = {}, |
| 42 | + ) |
| 43 | +} |
0 commit comments