feat: update app workflows and permissions

This commit is contained in:
2026-07-09 17:34:00 +08:00
parent 43e6133c21
commit 8e356973bd
44 changed files with 2944 additions and 307 deletions

View File

@ -112,6 +112,8 @@ final class HomeMenuCell: UICollectionViewCell {
static let reuseIdentifier = "HomeMenuCell"
private let cardView = UIView()
private let contentStackView = UIStackView()
private let iconContainerView = UIView()
private let iconView = UIImageView()
private let titleLabel = UILabel()
@ -127,40 +129,54 @@ final class HomeMenuCell: UICollectionViewCell {
func apply(menu: HomeMenuItem) {
iconView.image = UIImage(named: menu.iconName) ?? UIImage(systemName: menu.iconName)
iconView.accessibilityIdentifier = menu.iconName
titleLabel.text = menu.title
}
private func setupUI() {
contentView.backgroundColor = .clear
cardView.backgroundColor = .white
cardView.layer.cornerRadius = AppRadius.md
cardView.backgroundColor = AppColor.cardBackground
cardView.layer.cornerRadius = AppRadius.lg
cardView.layer.borderWidth = 1
cardView.layer.borderColor = AppColor.cardOutline.cgColor
cardView.clipsToBounds = true
iconContainerView.backgroundColor = AppColor.iconBackground
iconContainerView.layer.cornerRadius = 20
iconView.tintColor = AppColor.primary
iconView.contentMode = .scaleAspectFit
contentStackView.axis = .vertical
contentStackView.alignment = .center
contentStackView.spacing = AppSpacing.xs
contentStackView.isUserInteractionEnabled = false
titleLabel.font = .app(.body)
titleLabel.textColor = AppColor.textSecondary
titleLabel.textAlignment = .center
titleLabel.numberOfLines = 2
contentView.addSubview(cardView)
cardView.addSubview(iconView)
cardView.addSubview(titleLabel)
cardView.addSubview(contentStackView)
iconContainerView.addSubview(iconView)
contentStackView.addArrangedSubview(iconContainerView)
contentStackView.addArrangedSubview(titleLabel)
cardView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
iconView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(AppSpacing.sm)
make.centerX.equalToSuperview()
make.width.height.equalTo(24)
contentStackView.snp.makeConstraints { make in
make.center.equalToSuperview()
make.leading.trailing.equalToSuperview().inset(AppSpacing.xs)
}
titleLabel.snp.makeConstraints { make in
make.top.equalTo(iconView.snp.bottom).offset(AppSpacing.sm)
make.leading.trailing.equalToSuperview().inset(AppSpacing.xxs)
make.bottom.lessThanOrEqualToSuperview().inset(AppSpacing.xs)
iconContainerView.snp.makeConstraints { make in
make.width.height.equalTo(40)
}
iconView.snp.makeConstraints { make in
make.center.equalToSuperview()
make.width.height.equalTo(24)
}
}
}