Improve page indicators, adding items
This commit is contained in:
@ -8,15 +8,38 @@ struct FileToAddView: View {
|
||||
|
||||
let delete: (FileToAdd) -> Void
|
||||
|
||||
var symbol: SFSymbol {
|
||||
if file.idAlreadyExists {
|
||||
return .docOnDoc
|
||||
}
|
||||
if file.isSelected {
|
||||
return .checkmarkCircleFill
|
||||
}
|
||||
return .circle
|
||||
}
|
||||
|
||||
var color: Color {
|
||||
if file.idAlreadyExists {
|
||||
return .red
|
||||
}
|
||||
if file.isSelected {
|
||||
return .blue
|
||||
}
|
||||
return .gray
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading) {
|
||||
HStack {
|
||||
Image(systemSymbol: file.isSelected ? .checkmarkCircleFill : .circle)
|
||||
Image(systemSymbol: symbol)
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: 20, height: 20)
|
||||
.foregroundStyle(.blue)
|
||||
.foregroundStyle(color)
|
||||
.onTapGesture {
|
||||
file.isSelected.toggle()
|
||||
if !file.idAlreadyExists {
|
||||
file.isSelected.toggle()
|
||||
}
|
||||
}
|
||||
Image(systemSymbol: .trashCircleFill)
|
||||
.resizable()
|
||||
|
Reference in New Issue
Block a user