Implemented the basic layout for the SettingsView view in the app target.
This commit is contained in:
parent
863f681078
commit
2a888ba469
@ -10,15 +10,63 @@ import SwiftUI
|
|||||||
|
|
||||||
struct SettingsView: View {
|
struct SettingsView: View {
|
||||||
|
|
||||||
|
// MARK: Properties
|
||||||
|
|
||||||
|
@State private var viewModel: SettingsViewModel = .init()
|
||||||
|
|
||||||
// MARK: Body
|
// MARK: Body
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Text("Hello, World!")
|
Group {
|
||||||
.padding()
|
if #available(macOS 15.0, *) {
|
||||||
|
TabView(selection: $viewModel.tabSelected) {
|
||||||
|
ForEach(viewModel.tabs) { tabItem in
|
||||||
|
Tab(
|
||||||
|
tabItem.title,
|
||||||
|
systemImage: tabItem.icon,
|
||||||
|
value: tabItem
|
||||||
|
) {
|
||||||
|
switch tabItem {
|
||||||
|
case .repositories:
|
||||||
|
Text(tabItem.title)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
TabView(selection: $viewModel.tabSelected) {
|
||||||
|
ForEach(viewModel.tabs) { tabItem in
|
||||||
|
Group {
|
||||||
|
switch tabItem {
|
||||||
|
case .repositories:
|
||||||
|
Text(tabItem.title)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tabItem {
|
||||||
|
Text(tabItem.title)
|
||||||
|
}
|
||||||
|
.tag(tabItem)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.scenePadding()
|
||||||
|
.frame(
|
||||||
|
width: Layout.sizeView.width,
|
||||||
|
height: Layout.sizeView.height
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: - Layout
|
||||||
|
|
||||||
|
private extension SettingsView {
|
||||||
|
enum Layout {
|
||||||
|
static let sizeView = CGSize(width: 350, height: 250)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - Previews
|
// MARK: - Previews
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user