From 0d5bae8cec32a76b669228bb112370eaca47c151 Mon Sep 17 00:00:00 2001 From: Nick Savage Date: Mon, 7 Oct 2024 06:19:26 -0400 Subject: [PATCH] ios-app: styling improvements to CardDisplayView --- .../Views/cards/CardDisplayView.swift | 101 ++++++++++-------- 1 file changed, 57 insertions(+), 44 deletions(-) diff --git a/ios-app/Zettelgarden/Views/cards/CardDisplayView.swift b/ios-app/Zettelgarden/Views/cards/CardDisplayView.swift index 19de6aa..0959ac3 100644 --- a/ios-app/Zettelgarden/Views/cards/CardDisplayView.swift +++ b/ios-app/Zettelgarden/Views/cards/CardDisplayView.swift @@ -28,52 +28,13 @@ struct CardDisplayView: View { VStack(alignment: .leading) { if let card = cardViewModel.card { - HStack { - Text(card.card_id).foregroundColor(.blue) - Text(" - ") - Text(card.title) - Spacer() - Menu { - Button(action: { - isBacklinkInputPresented.toggle() - - }) { - Text("Add Backlink") - } - Button(action: { - showAddTagsSheet.toggle() - }) { - Text("Add Tags") - } - Button(action: { - showingAddCardView = true - }) { - Text("Add Child Card") - - } - Button(action: { - isPresentingEditView = true - }) { - Text("Edit Card") - } - Button(action: { - isPresentingUploadFileView = true - }) { - Text("Upload File To Card") - } - Button(action: { - isPresentingUploadPhotoView = true - }) { - Text("Upload Photo To Card") - } + ScrollView { - } label: { - Text("Actions") + HStack { + Text(card.card_id).foregroundColor(.blue) + Text(" - ") + Text(card.title).bold() } - } - .bold() - .padding() - ScrollView { VStack(alignment: .leading) { Text(card.body).padding() @@ -186,11 +147,63 @@ struct CardDisplayView: View { } } } + .background( + Color(UIColor(red: 241 / 255, green: 241 / 255, blue: 241 / 255, alpha: 1.0)) + ) .onAppear { if let card = cardViewModel.card { relatedCardsViewModel.loadRelatedCards(cardPK: card.id) } } + .toolbar { + ToolbarItem(placement: .navigationBarLeading) { + HStack { + Text(card.card_id).foregroundColor(.blue) + Text(" - ") + Text(card.title).bold() + } + } + ToolbarItem(placement: .navigationBarTrailing) { + Menu { + Button(action: { + isBacklinkInputPresented.toggle() + + }) { + Text("Add Backlink") + } + Button(action: { + showAddTagsSheet.toggle() + }) { + Text("Add Tags") + } + Button(action: { + showingAddCardView = true + }) { + Text("Add Child Card") + + } + Button(action: { + isPresentingEditView = true + }) { + Text("Edit Card") + } + Button(action: { + isPresentingUploadFileView = true + }) { + Text("Upload File To Card") + } + Button(action: { + isPresentingUploadPhotoView = true + }) { + Text("Upload Photo To Card") + } + + } label: { + Text("Actions") + } + + } + } .sheet(isPresented: $isBacklinkInputPresented) { if let unwrappedCard = cardViewModel.card { BacklinkInputView(