Skip to content

Commit

Permalink
fix(CreateCategoryPopup): move the delete button into footer
Browse files Browse the repository at this point in the history
Adjust according to Figma design
- the asset size should be 40x40
- fix the listview's horizontal alignment
- fix the confirmation dialog(s!) title

Fixes #9887
  • Loading branch information
caybro committed Apr 4, 2023
1 parent 6768f62 commit cde9f81
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 27 deletions.
39 changes: 14 additions & 25 deletions ui/app/AppLayouts/Chat/popups/community/CreateCategoryPopup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,11 @@ StatusModal {
readonly property bool checked: channelItemCheckbox.checked
objectName: "category_item_name_" + model.name
anchors.horizontalCenter: parent.horizontalCenter
anchors.horizontalCenterOffset: 16
height: visible ? implicitHeight : 0
title: "#" + model.name
asset.width: 30
asset.height: 30
asset.width: 40
asset.height: 40
asset.emoji: model.emoji
asset.color: model.color
asset.imgIsIdenticon: false
Expand Down Expand Up @@ -159,29 +160,6 @@ StatusModal {
}
}

StatusModalDivider {
visible: deleteCategoryButton.visible
topPadding: 8
bottomPadding: 8
}

StatusListItem {
id: deleteCategoryButton
anchors.horizontalCenter: parent.horizontalCenter
visible: isEdit

title: qsTr("Delete category")
asset.name: "delete"
type: StatusListItem.Type.Danger
onClicked: {
Global.openPopup(deleteCategoryConfirmationDialogComponent, {
title: qsTr("Delete %1 category").arg(root.contentItem.categoryName.input.text),
confirmationText: qsTr("Are you sure you want to delete %1 category? Channels inside the category won’t be deleted.").arg(root.contentItem.categoryName.input.text)

})
}
}

Item {
height: 8
width: parent.width
Expand Down Expand Up @@ -212,6 +190,17 @@ StatusModal {
}

rightButtons: [
StatusButton {
visible: isEdit
type: StatusBaseButton.Type.Danger
text: qsTr("Delete Category")
onClicked: {
Global.openPopup(deleteCategoryConfirmationDialogComponent, {
"header.title": qsTr("Delete '%1' category").arg(nameInput.text),
confirmationText: qsTr("Are you sure you want to delete '%1' category? Channels inside the category won’t be deleted.").arg(nameInput.text)
})
}
},
StatusButton {
objectName: "createOrEditCommunityCategoryBtn"
enabled: isFormValid()
Expand Down
4 changes: 2 additions & 2 deletions ui/app/AppLayouts/Chat/views/CommunityColumnView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ Item {
type: StatusAction.Type.Danger
onTriggered: {
Global.openPopup(deleteCategoryConfirmationDialogComponent, {
title: qsTr("Delete %1 category").arg(categoryItem.name),
confirmationText: qsTr("Are you sure you want to delete %1 category? Channels inside the category won't be deleted.")
"header.title": qsTr("Delete '%1' category").arg(categoryItem.name),
confirmationText: qsTr("Are you sure you want to delete '%1' category? Channels inside the category won't be deleted.")
.arg(categoryItem.name),
categoryId: categoryItem.itemId
})
Expand Down

0 comments on commit cde9f81

Please sign in to comment.