|
4 | 4 |
|
5 | 5 | package org.mozilla.fenix.components.menu.compose
|
6 | 6 |
|
| 7 | +import androidx.compose.foundation.ScrollState |
7 | 8 | import androidx.compose.foundation.background
|
8 | 9 | import androidx.compose.foundation.layout.Column
|
9 | 10 | import androidx.compose.runtime.Composable
|
@@ -39,6 +40,7 @@ import org.mozilla.fenix.theme.Theme
|
39 | 40 | * @param isWebCompatReporterSupported Whether or not the report broken site feature is supported.
|
40 | 41 | * @param isExtensionsProcessDisabled Whether or not the extensions process is disabled due to extension errors.
|
41 | 42 | * @param extensionsMenuItemDescription The label of extensions menu item description.
|
| 43 | + * @param scrollState The [ScrollState] used for vertical scrolling. |
42 | 44 | * @param onMozillaAccountButtonClick Invoked when the user clicks on Mozilla account button.
|
43 | 45 | * @param onHelpButtonClick Invoked when the user clicks on the help button.
|
44 | 46 | * @param onSettingsButtonClick Invoked when the user clicks on the settings button.
|
@@ -73,6 +75,7 @@ fun MainMenu(
|
73 | 75 | isWebCompatReporterSupported: Boolean,
|
74 | 76 | isExtensionsProcessDisabled: Boolean,
|
75 | 77 | extensionsMenuItemDescription: String,
|
| 78 | + scrollState: ScrollState, |
76 | 79 | onMozillaAccountButtonClick: () -> Unit,
|
77 | 80 | onHelpButtonClick: () -> Unit,
|
78 | 81 | onSettingsButtonClick: () -> Unit,
|
@@ -101,6 +104,7 @@ fun MainMenu(
|
101 | 104 | onSettingsButtonClick = onSettingsButtonClick,
|
102 | 105 | )
|
103 | 106 | },
|
| 107 | + scrollState = scrollState, |
104 | 108 | ) {
|
105 | 109 | NewTabsMenuGroup(
|
106 | 110 | accessPoint = accessPoint,
|
@@ -396,6 +400,7 @@ private fun MenuDialogPreview() {
|
396 | 400 | showQuitMenu = true,
|
397 | 401 | isExtensionsProcessDisabled = true,
|
398 | 402 | extensionsMenuItemDescription = "No extensions enabled",
|
| 403 | + scrollState = ScrollState(0), |
399 | 404 | onMozillaAccountButtonClick = {},
|
400 | 405 | onHelpButtonClick = {},
|
401 | 406 | onSettingsButtonClick = {},
|
@@ -438,6 +443,7 @@ private fun MenuDialogPrivatePreview() {
|
438 | 443 | showQuitMenu = true,
|
439 | 444 | isExtensionsProcessDisabled = false,
|
440 | 445 | extensionsMenuItemDescription = "No extensions enabled",
|
| 446 | + scrollState = ScrollState(0), |
441 | 447 | onMozillaAccountButtonClick = {},
|
442 | 448 | onHelpButtonClick = {},
|
443 | 449 | onSettingsButtonClick = {},
|
|
0 commit comments