diff --git a/AnimeGen.xcodeproj/project.xcworkspace/xcuserdata/Francesco.xcuserdatad/UserInterfaceState.xcuserstate b/AnimeGen.xcodeproj/project.xcworkspace/xcuserdata/Francesco.xcuserdatad/UserInterfaceState.xcuserstate index aa2444f5..0e4654d6 100644 Binary files a/AnimeGen.xcodeproj/project.xcworkspace/xcuserdata/Francesco.xcuserdatad/UserInterfaceState.xcuserstate and b/AnimeGen.xcodeproj/project.xcworkspace/xcuserdata/Francesco.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/AnimeGen/Settings/APIsValid.swift b/AnimeGen/Settings/APIsValid.swift index e3d35513..fe17c545 100644 --- a/AnimeGen/Settings/APIsValid.swift +++ b/AnimeGen/Settings/APIsValid.swift @@ -8,7 +8,7 @@ import SwiftUI struct APIData: Codable { - var supported: [String: String] + var supported: [String: Bool] } struct APIsSuppport: View { @@ -20,35 +20,25 @@ struct APIsSuppport: View { ForEach(apiData?.supported.sorted(by: { $0.key < $1.key }) ?? [], id: \.key) { (key, value) in HStack { Text(key) - .font(.headline) Spacer() - if value == "true" { + if value { Image(systemName: "checkmark.circle.fill") .foregroundColor(.green) - } else if value == "false" { + } else { Image(systemName: "xmark.circle.fill") .foregroundColor(.red) - } else if value == "kinda" { - Image(systemName: "exclamationmark.triangle.fill") - .foregroundColor(.yellow) } } } } .overlay( - VStack { - Text("Support status will not be updated instantly, but rather promptly after the APIs resume operation.") - .font(.footnote) - .foregroundColor(.gray) - .multilineTextAlignment(.center) - .padding(.horizontal) - Spacer() - } - .frame(maxWidth: .infinity, alignment: .center) - .background(Color(UIColor.systemBackground).opacity(0.95)) - .cornerRadius(12) - .shadow(radius: 10) - .padding(), + Text("Support status will not be updated instantly, but rather promptly after the APIs resume operation.") + .font(.footnote) + .foregroundColor(.gray) + .multilineTextAlignment(.center) + .padding(.all, 18) + .frame(maxWidth: .infinity, alignment: .center) + .background(Color.secondary.opacity(0.1)), alignment: .bottom ) Button(action: { @@ -65,7 +55,7 @@ struct APIsSuppport: View { .font(.headline) } .padding() - .background(Color.blue) + .background(Color("AccentColor")) .cornerRadius(10) } .padding() @@ -73,7 +63,7 @@ struct APIsSuppport: View { .onAppear { fetchData() } - .navigationBarTitle("APIs Status", displayMode: .inline) + .navigationBarTitle("APIs Status") } private func fetchData() { @@ -95,8 +85,8 @@ struct APIsSuppport: View { let iosVersion = UIDevice.current.systemVersion if iosVersion.starts(with: "13") { - decodedData.supported["pic.re"] = "false" - decodedData.supported["Nekos api"] = "false" + decodedData.supported["pic.re"] = false + decodedData.supported["Nekos api"] = false } DispatchQueue.main.async { @@ -109,7 +99,7 @@ struct APIsSuppport: View { } } -struct APIsSuppport_Previews: PreviewProvider { +struct ContentView_Previews: PreviewProvider { static var previews: some View { APIsSuppport() }