diff --git a/WorldBuilder/Components/CreateWorldButtonView.swift b/WorldBuilder/Components/CreateWorldButton.swift similarity index 92% rename from WorldBuilder/Components/CreateWorldButtonView.swift rename to WorldBuilder/Components/CreateWorldButton.swift index 1a67e40..47c3992 100644 --- a/WorldBuilder/Components/CreateWorldButtonView.swift +++ b/WorldBuilder/Components/CreateWorldButton.swift @@ -7,7 +7,7 @@ import SwiftUI -struct CreateWorldButtonView : View { +struct CreateWorldButton : View { var body: some View { NavigationLink{ CreateWorldView() diff --git a/WorldBuilder/Components/WorldCardView.swift b/WorldBuilder/Components/WorldCard.swift similarity index 98% rename from WorldBuilder/Components/WorldCardView.swift rename to WorldBuilder/Components/WorldCard.swift index ff9cd81..136fee8 100644 --- a/WorldBuilder/Components/WorldCardView.swift +++ b/WorldBuilder/Components/WorldCard.swift @@ -7,7 +7,7 @@ import SwiftUI -struct WorldCardView : View { +struct WorldCard : View { var world : World var isSelected = false diff --git a/WorldBuilder/Views/Home/HomeView.swift b/WorldBuilder/Views/Home/HomeView.swift index 21a486e..38a8e0a 100644 --- a/WorldBuilder/Views/Home/HomeView.swift +++ b/WorldBuilder/Views/Home/HomeView.swift @@ -9,6 +9,6 @@ import SwiftUI struct HomeView : View { var body: some View { - CreateWorldButtonView() + CreateWorldButton() } } diff --git a/WorldBuilder/Views/WorldList/Components/EmptyWorld.swift b/WorldBuilder/Views/WorldList/Components/EmptyWorld.swift new file mode 100644 index 0000000..d7a2cad --- /dev/null +++ b/WorldBuilder/Views/WorldList/Components/EmptyWorld.swift @@ -0,0 +1,40 @@ +// +// EmptyWorldView.swift +// WorldBuilder +// +// Created by Giovanni Josserand on 02/09/2026. +// + +import SwiftUI + +struct EmptyWorld : View { + var body : some View { + VStack(spacing: 20) { + ZStack { + Circle() + .fill(.indigo.opacity(0.12)) + .frame(width: 100, height: 100) + + Image(systemName: "globe.europe.africa") + .font(.system(size: 42)) + .foregroundStyle(.indigo) + } + + VStack { + Text("Ton univers commence ici.") + .font(.title3.bold()) + Text("Crée ton premier monde et commence à construire ton univers.") + .font(.subheadline) + .foregroundStyle(.secondary) + .multilineTextAlignment(.center) + } + .frame(maxWidth: 300) + + + CreateWorldButton() + } + .frame(maxWidth: .infinity) + .padding(.vertical, 50) + } +} + diff --git a/WorldBuilder/Views/WorldList/Modifiers/WorldListToolbarModifier.swift b/WorldBuilder/Views/WorldList/Modifiers/WorldListToolbar.swift similarity index 98% rename from WorldBuilder/Views/WorldList/Modifiers/WorldListToolbarModifier.swift rename to WorldBuilder/Views/WorldList/Modifiers/WorldListToolbar.swift index 7a7e34a..84b08d6 100644 --- a/WorldBuilder/Views/WorldList/Modifiers/WorldListToolbarModifier.swift +++ b/WorldBuilder/Views/WorldList/Modifiers/WorldListToolbar.swift @@ -8,7 +8,7 @@ import SwiftUI import SwiftData -struct WorldListToolbarModifier : ViewModifier { +struct WorldListToolbar : ViewModifier { @Binding var isSelecting : Bool @Binding var selectedWorlds : Set diff --git a/WorldBuilder/Views/WorldList/WorldListView.swift b/WorldBuilder/Views/WorldList/WorldListView.swift index 7cff455..90a502e 100644 --- a/WorldBuilder/Views/WorldList/WorldListView.swift +++ b/WorldBuilder/Views/WorldList/WorldListView.swift @@ -22,14 +22,14 @@ VStack(alignment: .leading, spacing: 24){ if worlds.isEmpty { - EmptyWorldView() + EmptyWorld() }else{ ScrollView { LazyVGrid(columns: columns){ ForEach(worlds) {world in Group { if isSelecting { - WorldCardView( + WorldCard( world: world, isSelected: selectedWorlds.contains(world.id) ) @@ -44,7 +44,7 @@ NavigationLink{ WorldOverviewView() } label: { - WorldCardView(world: world) + WorldCard(world: world) } } } @@ -78,7 +78,7 @@ .padding(.horizontal, 8) .frame(maxHeight: .infinity, alignment: .topLeading) .modifier( - WorldListToolbarModifier( + WorldListToolbar( isSelecting: $isSelecting, selectedWorlds: $selectedWorlds, worldsIsEmpty: worlds.isEmpty,