Skip to content

Commit

Permalink
Removed delay when clicking on a branch in the side panel
Browse files Browse the repository at this point in the history
  • Loading branch information
JetpackDuba committed Nov 11, 2023
1 parent d7f69f6 commit 7ce7285
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

package com.jetpackduba.gitnuro.ui.components

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.*
import androidx.compose.foundation.layout.*
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
Expand All @@ -17,6 +15,7 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.jetpackduba.gitnuro.extensions.backgroundIf
import com.jetpackduba.gitnuro.extensions.onDoubleClick
import com.jetpackduba.gitnuro.theme.backgroundSelected


Expand All @@ -29,17 +28,18 @@ fun SideMenuSubentry(
iconResourcePath: String,
isSelected: Boolean,
extraPadding: Dp = 0.dp,
onClick: (() -> Unit)? = null,
onClick: () -> Unit,
onDoubleClick: (() -> Unit)? = null,
additionalInfo: @Composable () -> Unit = {}
) {
Row(
modifier = Modifier
.height(ENTRY_HEIGHT.dp)
.fillMaxWidth()
.clickable { onClick() }
.run {
if (onClick != null)
combinedClickable(onClick = onClick, onDoubleClick = onDoubleClick)
if (onDoubleClick != null)
this.onDoubleClick(onDoubleClick)
else
this
}
Expand Down

0 comments on commit 7ce7285

Please sign in to comment.