Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit e3b4b2c7 authored by Wolf-Martell Montwé's avatar Wolf-Martell Montwé
Browse files

Add DrawerContent with example NavigationDrawerItem

parent 422ebbf5
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
package app.k9mail.feature.navigation.drawer.ui

import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.designsystem.PreviewWithTheme

@Composable
@Preview(showBackground = true)
internal fun DrawerContentPreview() {
    PreviewWithTheme {
        DrawerContent()
    }
}
+52 −0
Original line number Diff line number Diff line
package app.k9mail.feature.navigation.drawer.ui

import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import app.k9mail.core.ui.compose.designsystem.atom.Surface
import app.k9mail.core.ui.compose.designsystem.organism.drawer.NavigationDrawerItem
import app.k9mail.core.ui.compose.theme2.MainTheme

@Composable
fun DrawerContent(
    modifier: Modifier = Modifier,
) {
    Surface(
        modifier = modifier
            .fillMaxSize()
            .testTag("DrawerContent"),
    ) {
        LazyColumn(
            modifier = Modifier
                .fillMaxSize()
                .padding(
                    vertical = MainTheme.spacings.oneHalf,
                ),
        ) {
            item {
                NavigationDrawerItem(
                    label = "Folder1",
                    selected = true,
                    onClick = {},
                )
            }
            item {
                NavigationDrawerItem(
                    label = "Folder2",
                    selected = false,
                    onClick = {},
                )
            }
            item {
                NavigationDrawerItem(
                    label = "Folder3",
                    selected = false,
                    onClick = {},
                )
            }
        }
    }
}