diff --git a/core/commonui/lemmyui/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/core/commonui/lemmyui/Options.kt b/core/commonui/lemmyui/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/core/commonui/lemmyui/Options.kt index 96278fa5b..fce6eb202 100644 --- a/core/commonui/lemmyui/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/core/commonui/lemmyui/Options.kt +++ b/core/commonui/lemmyui/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/core/commonui/lemmyui/Options.kt @@ -69,4 +69,6 @@ sealed class OptionId( data object PurgeCreator : OptionId(29) data object Restore : OptionId(30) + + data object ManageTags : OptionId(31) } diff --git a/feature/settings/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/feature/settings/ui/components/SettingsColorRow.kt b/core/commonui/lemmyui/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/core/commonui/lemmyui/SettingsColorRow.kt similarity index 95% rename from feature/settings/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/feature/settings/ui/components/SettingsColorRow.kt rename to core/commonui/lemmyui/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/core/commonui/lemmyui/SettingsColorRow.kt index 4ff82632d..0001878c9 100644 --- a/feature/settings/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/feature/settings/ui/components/SettingsColorRow.kt +++ b/core/commonui/lemmyui/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/core/commonui/lemmyui/SettingsColorRow.kt @@ -1,4 +1,4 @@ -package com.livefast.eattrash.raccoonforlemmy.feature.settings.ui.components +package com.livefast.eattrash.raccoonforlemmy.core.commonui.lemmyui import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box @@ -21,7 +21,7 @@ import com.livefast.eattrash.raccoonforlemmy.core.appearance.theme.Spacing import com.livefast.eattrash.raccoonforlemmy.core.utils.compose.onClick @Composable -internal fun SettingsColorRow( +fun SettingsColorRow( title: String, value: Color, modifier: Modifier = Modifier, diff --git a/feature/settings/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/feature/settings/ui/components/SettingsMultiColorRow.kt b/core/commonui/lemmyui/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/core/commonui/lemmyui/SettingsMultiColorRow.kt similarity index 94% rename from feature/settings/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/feature/settings/ui/components/SettingsMultiColorRow.kt rename to core/commonui/lemmyui/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/core/commonui/lemmyui/SettingsMultiColorRow.kt index d16cbb7a4..be7b9746a 100644 --- a/feature/settings/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/feature/settings/ui/components/SettingsMultiColorRow.kt +++ b/core/commonui/lemmyui/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/core/commonui/lemmyui/SettingsMultiColorRow.kt @@ -1,4 +1,4 @@ -package com.livefast.eattrash.raccoonforlemmy.feature.settings.ui.components +package com.livefast.eattrash.raccoonforlemmy.core.commonui.lemmyui import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -19,7 +19,7 @@ import com.livefast.eattrash.raccoonforlemmy.core.commonui.components.MultiColor import com.livefast.eattrash.raccoonforlemmy.core.utils.compose.onClick @Composable -internal fun SettingsMultiColorRow( +fun SettingsMultiColorRow( title: String, values: List, modifier: Modifier = Modifier, diff --git a/core/commonui/lemmyui/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/core/commonui/lemmyui/UserTagItem.kt b/core/commonui/lemmyui/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/core/commonui/lemmyui/UserTagItem.kt new file mode 100644 index 000000000..962326d5d --- /dev/null +++ b/core/commonui/lemmyui/src/commonMain/kotlin/com/livefast/eattrash/raccoonforlemmy/core/commonui/lemmyui/UserTagItem.kt @@ -0,0 +1,135 @@ +package com.livefast.eattrash.raccoonforlemmy.core.commonui.lemmyui + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.MoreVert +import androidx.compose.material3.Checkbox +import androidx.compose.material3.DropdownMenuItem +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.layout.onGloballyPositioned +import androidx.compose.ui.layout.positionInParent +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.DpOffset +import com.livefast.eattrash.raccoonforlemmy.core.appearance.theme.IconSize +import com.livefast.eattrash.raccoonforlemmy.core.appearance.theme.Spacing +import com.livefast.eattrash.raccoonforlemmy.core.appearance.theme.ancillaryTextAlpha +import com.livefast.eattrash.raccoonforlemmy.core.commonui.components.CustomDropDown +import com.livefast.eattrash.raccoonforlemmy.core.persistence.data.UserTagModel +import com.livefast.eattrash.raccoonforlemmy.core.utils.toLocalDp + +@Composable +fun UserTagItem( + tag: UserTagModel, + modifier: Modifier = Modifier, + checked: Boolean? = null, + onCheckedChange: ((Boolean) -> Unit)? = null, + options: List