From 74f9d011e4540973eef353e05ce5ec714c19b7ea Mon Sep 17 00:00:00 2001 From: "remi.regnault" Date: Tue, 21 May 2024 17:50:16 +0200 Subject: [PATCH] :construction: adding GameResumeFrame --- .../DouShouQi_App.xcodeproj/project.pbxproj | 12 +++++ .../Components/Game/GameResumeFrame.swift | 51 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 DouShouQi_App/DouShouQi_App/Components/Game/GameResumeFrame.swift diff --git a/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj b/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj index 908f76b..b7a4e25 100644 --- a/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj +++ b/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 643AB6932BFCEFD00018DA73 /* GameResumeFrame.swift in Sources */ = {isa = PBXBuildFile; fileRef = 643AB6922BFCEFD00018DA73 /* GameResumeFrame.swift */; }; 6458345C2BF5F92300E18321 /* DouShouQi_AppApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6458345B2BF5F92300E18321 /* DouShouQi_AppApp.swift */; }; 6458345E2BF5F92300E18321 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6458345D2BF5F92300E18321 /* ContentView.swift */; }; 645834602BF5F92500E18321 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6458345F2BF5F92500E18321 /* Assets.xcassets */; }; @@ -61,6 +62,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 643AB6922BFCEFD00018DA73 /* GameResumeFrame.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameResumeFrame.swift; sourceTree = ""; }; 645834582BF5F92300E18321 /* DouShouQi_App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DouShouQi_App.app; sourceTree = BUILT_PRODUCTS_DIR; }; 6458345B2BF5F92300E18321 /* DouShouQi_AppApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DouShouQi_AppApp.swift; sourceTree = ""; }; 6458345D2BF5F92300E18321 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; @@ -112,6 +114,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 643AB6912BFCEFB70018DA73 /* Game */ = { + isa = PBXGroup; + children = ( + 643AB6922BFCEFD00018DA73 /* GameResumeFrame.swift */, + ); + path = Game; + sourceTree = ""; + }; 6458344F2BF5F92300E18321 = { isa = PBXGroup; children = ( @@ -209,6 +219,7 @@ 649ABF5E2BF60ED5002E8894 /* Components */ = { isa = PBXGroup; children = ( + 643AB6912BFCEFB70018DA73 /* Game */, 645B4C1C2BFCC95000FD658A /* Player */, 649ABF5F2BF60F2D002E8894 /* MainMenuButton.swift */, 649B59A32BF64574002BAE38 /* TitlePageFrame.swift */, @@ -392,6 +403,7 @@ 645B4C252BFCD3C600FD658A /* ScoreBoardView.swift in Sources */, 649B59AE2BF64EAB002BAE38 /* AppImages.swift in Sources */, 649ABF602BF60F2D002E8894 /* MainMenuButton.swift in Sources */, + 643AB6932BFCEFD00018DA73 /* GameResumeFrame.swift in Sources */, 649B59B22BF65392002BAE38 /* TextStyles.swift in Sources */, 6458345C2BF5F92300E18321 /* DouShouQi_AppApp.swift in Sources */, 645B4C202BFCCA0500FD658A /* PlayerResumeFrame.swift in Sources */, diff --git a/DouShouQi_App/DouShouQi_App/Components/Game/GameResumeFrame.swift b/DouShouQi_App/DouShouQi_App/Components/Game/GameResumeFrame.swift new file mode 100644 index 0000000..d294e72 --- /dev/null +++ b/DouShouQi_App/DouShouQi_App/Components/Game/GameResumeFrame.swift @@ -0,0 +1,51 @@ +// +// GameResumeFrame.swift +// DouShouQi_App +// +// Created by Rémi REGNAULT on 21/05/2024. +// + +import SwiftUI + +struct GameResumeFrame: View { + + // Players Params + let Player1Name: String + let Player2Name: String + + // Game Params + let Status: String + + var body: some View { + ZStack { + HStack(alignment: .center) { + VStack(alignment: .leading) { + Text("\(Player1Name) vs \(Player2Name)") + .font(.headline) + + Text(Status) + .font(.subheadline) + .foregroundColor(.gray) + } + + Spacer() + + Text("Detail >") + .frame(width: 100) + .foregroundColor(.gray) + } + + .padding(10) + .overlay( + RoundedRectangle(cornerRadius: 3) + .stroke(.gray, lineWidth: 2) + ) + }.padding(10) + } +} + +struct GameResumeFrame_Previews: PreviewProvider { + static var previews: some View { + GameResumeFrame(Player1Name: "Rayhan", Player2Name: "Remi", Status: "Winner: Remi") + } +}