Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composeApp/src/androidMain/kotlin/com/github/worn/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.github.worn.ui.components.Tab
import com.github.worn.ui.screen.GapsScreen
import com.github.worn.ui.screen.OutfitsScreen
import com.github.worn.ui.screen.SettingsScreen
import com.github.worn.ui.screen.TryItScreen
import com.github.worn.ui.screen.WardrobeScreen
import com.github.worn.ui.theme.WornTheme

Expand All @@ -21,8 +22,8 @@ fun App() {
Tab.WARDROBE -> WardrobeScreen(onTabSelected = { activeTab = it })
Tab.OUTFITS -> OutfitsScreen(onTabSelected = { activeTab = it })
Tab.GAPS -> GapsScreen(onTabSelected = { activeTab = it })
Tab.TRY_IT -> TryItScreen(onTabSelected = { activeTab = it })
Tab.SETTINGS -> SettingsScreen(onTabSelected = { activeTab = it })
else -> WardrobeScreen(onTabSelected = { activeTab = it })
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ import java.io.File
fun ItemDetailSheet(
item: ClothingItem,
isCompact: Boolean,
onEdit: (ClothingItem) -> Unit,
onDelete: (String) -> Unit,
onEdit: (ClothingItem) -> Unit = {},
onDelete: (String) -> Unit = {},
onDismiss: () -> Unit,
showActions: Boolean = true,
) {
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)

Expand All @@ -79,7 +80,13 @@ fun ItemDetailSheet(
shape = RoundedCornerShape(24.dp, 24.dp, 0.dp, 0.dp),
dragHandle = { DetailSheetDragHandle() },
) {
ItemDetailContent(item = item, isCompact = isCompact, onEdit = onEdit, onDelete = onDelete)
ItemDetailContent(
item = item,
isCompact = isCompact,
onEdit = onEdit,
onDelete = onDelete,
showActions = showActions,
)
}
}

Expand All @@ -105,6 +112,7 @@ internal fun ItemDetailContent(
isCompact: Boolean,
onEdit: (ClothingItem) -> Unit = {},
onDelete: (String) -> Unit = {},
showActions: Boolean = true,
) {
val dims = ItemDetailDimens(isCompact)
var showDeleteDialog by remember { mutableStateOf(false) }
Expand All @@ -121,14 +129,16 @@ internal fun ItemDetailContent(
ItemNameGroup(item = item, nameSize = dims.nameSize)
HorizontalDivider()
ItemProperties(item = item, fontSize = dims.propFontSize, gap = dims.propGap)
DetailActionButtons(
editLabel = "Edit Item",
deleteLabel = "Delete Item",
buttonHeight = dims.buttonHeight,
buttonFontSize = dims.buttonFontSize,
onEdit = { onEdit(item) },
onDelete = { showDeleteDialog = true },
)
if (showActions) {
DetailActionButtons(
editLabel = "Edit Item",
deleteLabel = "Delete Item",
buttonHeight = dims.buttonHeight,
buttonFontSize = dims.buttonFontSize,
onEdit = { onEdit(item) },
onDelete = { showDeleteDialog = true },
)
}
}

if (showDeleteDialog) {
Expand Down
Loading
Loading