Skip to content

Commit

Permalink
Add scroll to deleted & import views
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyfreeman committed Nov 5, 2022
1 parent aa46696 commit 6720cae
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 36 deletions.
38 changes: 21 additions & 17 deletions Flipper/Packages/UI/Sources/Archive/Import/ImportView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,29 @@ struct ImportView: View {
}
}

CardView(
item: $viewModel.item,
isEditing: $viewModel.isEditing,
kind: .imported
)
.padding(.top, 6)
.padding(.horizontal, 24)
ScrollView {
VStack(alignment: .leading, spacing: 0) {
CardView(
item: $viewModel.item,
isEditing: $viewModel.isEditing,
kind: .imported
)
.padding(.top, 6)
.padding(.horizontal, 24)

Button {
viewModel.add()
} label: {
Text("Save to Archive")
.roundedButtonStyle(maxWidth: .infinity)
}
.padding(.top, 18)
.padding(.horizontal, 24)
.opacity(viewModel.isEditing ? 0 : 1)
Button {
viewModel.add()
} label: {
Text("Save to Archive")
.roundedButtonStyle(maxWidth: .infinity)
}
.padding(.top, 18)
.padding(.horizontal, 24)
.opacity(viewModel.isEditing ? 0 : 1)

Spacer()
Spacer()
}
}
}
.alert(isPresented: $viewModel.isError) {
Alert(title: Text(viewModel.error))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,38 @@ struct DeletedInfoView: View {
viewModel.dismiss()
}

CardView(
item: $viewModel.item,
isEditing: $viewModel.isEditing,
kind: .deleted
)
.padding(.top, 6)
.padding(.horizontal, 24)
ScrollView {
VStack(alignment: .leading, spacing: 0) {
CardView(
item: $viewModel.item,
isEditing: $viewModel.isEditing,
kind: .deleted
)
.padding(.top, 6)
.padding(.horizontal, 24)

VStack(alignment: .leading, spacing: 20) {
InfoButton(image: .init("Restore"), title: "Restore") {
viewModel.restore()
}
.foregroundColor(.primary)
InfoButton(image: .init("Delete"), title: "Delete Permanently") {
viewModel.delete()
VStack(alignment: .leading, spacing: 20) {
InfoButton(
image: .init("Restore"),
title: "Restore"
) {
viewModel.restore()
}
.foregroundColor(.primary)
InfoButton(
image: .init("Delete"),
title: "Delete Permanently"
) {
viewModel.delete()
}
.foregroundColor(.sRed)
}
.padding(.top, 24)
.padding(.horizontal, 24)

Spacer()
}
.foregroundColor(.sRed)
}
.padding(.top, 24)
.padding(.horizontal, 24)

Spacer()
}
.alert(isPresented: $viewModel.isError) {
Alert(title: Text(viewModel.error))
Expand Down

0 comments on commit 6720cae

Please sign in to comment.