Skip to content

Commit

Permalink
Merge pull request #1130 from anyproto/ios-2596-remove-edit-buttons-i…
Browse files Browse the repository at this point in the history
…n-relations-list-when-object-is-locked

iOS-2596 Remove edit/+ buttons in Relations list when object is locked
  • Loading branch information
joe-pusya authored Apr 4, 2024
2 parents 8798cac + f86264e commit de636c5
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ struct RelationsListView: View {

private var navigationBar: some View {
HStack {
editButton
if !viewModel.navigationBarButtonsDisabled {
editButton
}

Spacer()
AnytypeText(Loc.relations, style: .uxTitle1Semibold, color: .Text.primary)
Spacer()
createNewRelationButton

if !viewModel.navigationBarButtonsDisabled {
createNewRelationButton
}
}
.frame(height: 48)
.padding(.horizontal, 16)
Expand All @@ -35,20 +41,18 @@ struct RelationsListView: View {
AnytypeText(
editingMode ? Loc.done : Loc.edit,
style: .uxBodyRegular,
color: viewModel.navigationBarButtonsDisabled ? .Button.inactive : .Text.secondary
color: .Text.secondary
)
}
.disabled(viewModel.navigationBarButtonsDisabled)
}

private var createNewRelationButton: some View {
Button {
viewModel.showAddNewRelationView()
} label: {
Image(asset: .X32.plus)
.foregroundColor(viewModel.navigationBarButtonsDisabled ? .Button.inactive : .Button.active)
.foregroundColor(.Button.active)
}
.disabled(viewModel.navigationBarButtonsDisabled)
}

private var relationsList: some View {
Expand Down

0 comments on commit de636c5

Please sign in to comment.