50 lines
863 B
Swift
50 lines
863 B
Swift
//
|
|
// ContentView.swift
|
|
// BeReal
|
|
//
|
|
// Created by Javier Cicchelli on 29/11/2022.
|
|
// Copyright © 2022 Röck+Cöde. All rights reserved.
|
|
//
|
|
|
|
import Browse
|
|
import DataModels
|
|
import Login
|
|
import KeychainStorage
|
|
import Profile
|
|
import SwiftUI
|
|
|
|
struct ContentView: View {
|
|
|
|
// MARK: Storages
|
|
|
|
@KeychainStorage(key: .KeychainStorage.account) private var account: Account?
|
|
|
|
// MARK: Body
|
|
|
|
var body: some View {
|
|
NavigationView {
|
|
BrowseView()
|
|
}
|
|
.sheet(isPresented: showLogin) {
|
|
LoginView()
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
// MARK: - Helpers
|
|
|
|
private extension ContentView {
|
|
var showLogin: Binding<Bool> {
|
|
.init { account == nil } set: { _ in }
|
|
}
|
|
}
|
|
|
|
// MARK: - Previews
|
|
|
|
struct ContentView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
ContentView()
|
|
}
|
|
}
|