Click on userId / room alias to copy value to clipboard. (#4549)
This commit is contained in:
parent
606910e625
commit
ad9997b8ba
17 changed files with 114 additions and 22 deletions
|
|
@ -8,7 +8,11 @@
|
|||
package io.element.android.libraries.designsystem.modifiers
|
||||
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
fun Modifier.clickableIfNotNull(onClick: (() -> Unit)? = null): Modifier = then(
|
||||
if (onClick != null) {
|
||||
|
|
@ -17,3 +21,11 @@ fun Modifier.clickableIfNotNull(onClick: (() -> Unit)? = null): Modifier = then(
|
|||
Modifier
|
||||
}
|
||||
)
|
||||
|
||||
fun Modifier.niceClickable(
|
||||
onClick: () -> Unit,
|
||||
): Modifier {
|
||||
return clip(RoundedCornerShape(4.dp))
|
||||
.clickable { onClick() }
|
||||
.padding(horizontal = 4.dp)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue