diff --git a/WorldBuilder/Views/CreateWorld/CreateWorldView.swift b/WorldBuilder/Views/CreateWorld/CreateWorldView.swift new file mode 100644 index 0000000..b6a5d2c --- /dev/null +++ b/WorldBuilder/Views/CreateWorld/CreateWorldView.swift @@ -0,0 +1,47 @@ +// +// CreateWorldView.swift +// WorldBuilder +// +// Created by Giovanni Josserand on 01/09/2026. +// + +import SwiftUI + +struct CreateWorldView: View { + @State private var worldName = "" + @State private var worldDescription = "" + + var body: some View { + Form { + Section("Informations") { + TextField("Nom du monde", text: $worldName) + + TextField( + "Description", + text: $worldDescription, + axis: .vertical + ) + } + + Section { + Button("Créer le monde") { + createWorld() + } + .disabled(worldName.isEmpty) + .padding(.horizontal, 24) + .padding(.vertical, 12) + .background(Color.blue) + .foregroundStyle(.white) + .clipShape(RoundedRectangle(cornerRadius: 10)) + .frame(maxWidth: .infinity, alignment: .center) + } + .listRowBackground(Color.clear) + } + .navigationTitle("Créer un monde") + .navigationBarTitleDisplayMode(.inline) + } + + private func createWorld() { + print("Création du monde : \(worldName)") + } +} diff --git a/WorldBuilder/Views/Home/HomeView.swift b/WorldBuilder/Views/Home/HomeView.swift index 7f6ca4f..3ff2648 100644 --- a/WorldBuilder/Views/Home/HomeView.swift +++ b/WorldBuilder/Views/Home/HomeView.swift @@ -9,6 +9,8 @@ import SwiftUI struct HomeView : View { var body: some View { - Text("Home") + NavigationLink("Créer un monde"){ + CreateWorldView() + }.buttonStyle(.glass) } }