Skip to content

PacocaOficial/mac-os

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MacOS

import SwiftUI
import WebKit


import SwiftUI

struct ContentView: View {
    @ObservedObject var model: WebViewModel

    var body: some View {
        WebView(model: model)
            .frame(minWidth: 700, minHeight: 600)
    }
}

@main
struct PacocaApp: App {
    @StateObject private var webModel = WebViewModel()

    var body: some Scene {
        WindowGroup {
            ContentView(model: webModel)
        }
        .commands {
            CommandMenu("Configurações") {
                Button("Privacidade") {
                    webModel.currentURL = URL(string: "https://pacoca.net/privacidade")!
                }

                Button("Acessibilidade") {
                    webModel.currentURL = URL(string: "https://pacoca.net/acessibilidade")!
                }

                Button("Sessões ativas") {
                    webModel.currentURL = URL(string: "https://pacoca.net/sessoes-ativas")!
                }
                
                Button("Notificações") {
                    webModel.currentURL = URL(string: "https://pacoca.net/notificacoes")!
                }
                
                Button("Verificado") {
                    webModel.currentURL = URL(string: "https://pacoca.net/verificado")!
                }
                
                Button("Doação") {
                    webModel.currentURL = URL(string: "https://pacoca.net/doacao")!
                }
                
                Button("Termos de Uso") {
                    webModel.currentURL = URL(string: "https://pacoca.net/termos-uso")!
                }
                
                Button("Diretrizes") {
                    webModel.currentURL = URL(string: "https://pacoca.net/diretrizes")!
                }
                
                Button("Significado dos Selos") {
                    webModel.currentURL = URL(string: "https://pacoca.net/significado-selos")!
                }
            }
            
            CommandMenu("Contribuir") {
                Button("Doação") {
                    webModel.currentURL = URL(string: "https://pacoca.net/doacao")!
                }

                Button("Verificado") {
                    webModel.currentURL = URL(string: "https://pacoca.net/verificado")!
                }

                Button("Anúncios") {
                    webModel.currentURL = URL(string: "https://pacoca.net/anuncios")!
                }
            }

            CommandGroup(replacing: .help) {
                Button("Dashboard") {
                    webModel.currentURL = URL(string: "https://pacoca.net/dashboard")!
                }

                Button("Comunidade no Discord") {
                    if let url = URL(string: "https://discord.gg/vJjGNcjKpj") {
                        NSWorkspace.shared.open(url)
                    }
                }

                Button("Read Books") {
                    if let url = URL(string: "https://readbooks.site") {
                        NSWorkspace.shared.open(url)
                    }
                }
            }

            CommandGroup(replacing: .appInfo) {
                Button("Sobre Paçoca") {
                    let options: [NSApplication.AboutPanelOptionKey: Any] = [
                        .applicationName: "Paçoca" as NSString,
                        .applicationVersion: "1.0.0" as NSString,
                        .version: "Build 1" as NSString,
                        .credits: NSAttributedString(
                            string: "Feito por João Enrique\nObrigado por usar nosso app! ❤️"
                        )
                    ]
                    NSApplication.shared.orderFrontStandardAboutPanel(options: options)
                }
            }
        }
    }
}

About

Versão para MacOS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published