mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Add link button on iPad
This commit is contained in:
parent
ac38ca2e86
commit
2fd841775d
3 changed files with 27 additions and 14 deletions
|
|
@ -150,7 +150,7 @@ struct AnimatingCellHeight: AnimatableModifier {
|
|||
Label(LocalText.genericProfile, systemImage: "person.circle")
|
||||
})
|
||||
Button(action: { addLinkPresented = true }, label: {
|
||||
Label("Add Link", systemImage: "plus.square")
|
||||
Label("Add Link", systemImage: "plus.circle")
|
||||
})
|
||||
}, label: {
|
||||
Image.utilityMenu
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@
|
|||
Form {
|
||||
TextField("Add Link", text: $newLinkURL)
|
||||
.keyboardType(.URL)
|
||||
.autocorrectionDisabled(true)
|
||||
.textFieldStyle(StandardTextFieldStyle())
|
||||
.focused($focusedField, equals: .addLinkEditor)
|
||||
|
||||
|
|
|
|||
|
|
@ -56,27 +56,39 @@ import Views
|
|||
}
|
||||
|
||||
@MainActor struct PrimaryContentSidebar: View {
|
||||
@State private var addLinkPresented = false
|
||||
@State private var selectedCategory: PrimaryContentCategory?
|
||||
let categories: [PrimaryContentCategory]
|
||||
|
||||
var innerBody: some View {
|
||||
List(categories) { category in
|
||||
NavigationLink(
|
||||
destination: category.destinationView,
|
||||
tag: category,
|
||||
selection: $selectedCategory,
|
||||
label: { category.listLabel }
|
||||
)
|
||||
#if os(iOS)
|
||||
.listRowBackground(
|
||||
category == selectedCategory
|
||||
? Color.appGraySolid.opacity(0.4).cornerRadius(8)
|
||||
: Color.clear.cornerRadius(8)
|
||||
List {
|
||||
ForEach(categories, id: \.self) { category in
|
||||
NavigationLink(
|
||||
destination: category.destinationView,
|
||||
tag: category,
|
||||
selection: $selectedCategory,
|
||||
label: { category.listLabel }
|
||||
)
|
||||
#endif
|
||||
#if os(iOS)
|
||||
.listRowBackground(
|
||||
category == selectedCategory
|
||||
? Color.appGraySolid.opacity(0.4).cornerRadius(8)
|
||||
: Color.clear.cornerRadius(8)
|
||||
)
|
||||
#endif
|
||||
}
|
||||
|
||||
Button(action: { addLinkPresented = true }, label: {
|
||||
Label("Add Link", systemImage: "plus.circle")
|
||||
})
|
||||
}
|
||||
.dynamicTypeSize(.small ... .large)
|
||||
.listStyle(.sidebar)
|
||||
.sheet(isPresented: $addLinkPresented) {
|
||||
NavigationView {
|
||||
LibraryAddLinkView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
|
|
|
|||
Loading…
Reference in a new issue