1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 package org.mozilla.fenix.components.menu.compose
7 import androidx.compose.foundation.BorderStroke
8 import androidx.compose.foundation.background
9 import androidx.compose.foundation.border
10 import androidx.compose.foundation.layout.Column
11 import androidx.compose.foundation.layout.padding
12 import androidx.compose.foundation.shape.RoundedCornerShape
13 import androidx.compose.runtime.Composable
14 import androidx.compose.ui.Modifier
15 import androidx.compose.ui.res.painterResource
16 import androidx.compose.ui.res.stringResource
17 import androidx.compose.ui.unit.dp
18 import org.mozilla.fenix.R
19 import org.mozilla.fenix.compose.Divider
20 import org.mozilla.fenix.compose.annotation.LightDarkPreview
21 import org.mozilla.fenix.compose.list.IconListItem
22 import org.mozilla.fenix.theme.FirefoxTheme
24 private val ROUNDED_CORNER_SHAPE = RoundedCornerShape(12.dp)
27 * A menu group container.
29 * @param content The children composable to be laid out.
32 internal fun MenuGroup(content: @Composable () -> Unit) {
36 color = FirefoxTheme.colors.layer2,
37 shape = ROUNDED_CORNER_SHAPE,
40 border = BorderStroke(
42 color = FirefoxTheme.colors.borderPrimary,
44 shape = ROUNDED_CORNER_SHAPE,
53 private fun MenuGroupPreview() {
57 .background(color = FirefoxTheme.colors.layer3)
62 label = stringResource(id = R.string.browser_menu_add_to_homescreen),
63 beforeIconPainter = painterResource(id = R.drawable.mozac_ic_plus_24),
66 Divider(color = FirefoxTheme.colors.borderSecondary)
69 label = stringResource(id = R.string.browser_menu_add_to_homescreen),
70 beforeIconPainter = painterResource(id = R.drawable.mozac_ic_plus_24),