Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finished skeleton for pushing sheet #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions All In.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
2E656DA62CE1504600E7E6D1 /* BalanceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E656DA52CE1504600E7E6D1 /* BalanceView.swift */; };
2E656DA82CE1506000E7E6D1 /* BalanceSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E656DA72CE1506000E7E6D1 /* BalanceSheetView.swift */; };
897DFBDE2CCED80600246B0D /* PlayerChestViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897DFBB62CCED80600246B0D /* PlayerChestViewModel.swift */; };
897DFBDF2CCED80600246B0D /* RarityChestSheetViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897DFBB72CCED80600246B0D /* RarityChestSheetViewModel.swift */; };
897DFBE02CCED80600246B0D /* SheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897DFBB92CCED80600246B0D /* SheetView.swift */; };
Expand Down Expand Up @@ -69,6 +71,8 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
2E656DA52CE1504600E7E6D1 /* BalanceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BalanceView.swift; sourceTree = "<group>"; };
2E656DA72CE1506000E7E6D1 /* BalanceSheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BalanceSheetView.swift; sourceTree = "<group>"; };
897DFBB62CCED80600246B0D /* PlayerChestViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerChestViewModel.swift; sourceTree = "<group>"; };
897DFBB72CCED80600246B0D /* RarityChestSheetViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RarityChestSheetViewModel.swift; sourceTree = "<group>"; };
897DFBB92CCED80600246B0D /* SheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SheetView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -162,6 +166,8 @@
isa = PBXGroup;
children = (
897DFBBA2CCED80600246B0D /* Supporting */,
2E656DA72CE1506000E7E6D1 /* BalanceSheetView.swift */,
2E656DA52CE1504600E7E6D1 /* BalanceView.swift */,
897DFBBB2CCED80600246B0D /* PlayerChestSheetView.swift */,
897DFBBC2CCED80600246B0D /* PlayerChestView.swift */,
897DFBBD2CCED80600246B0D /* RarityChestSheetView.swift */,
Expand Down Expand Up @@ -544,6 +550,7 @@
897DFBDE2CCED80600246B0D /* PlayerChestViewModel.swift in Sources */,
897DFBDF2CCED80600246B0D /* RarityChestSheetViewModel.swift in Sources */,
897DFBE02CCED80600246B0D /* SheetView.swift in Sources */,
2E656DA62CE1504600E7E6D1 /* BalanceView.swift in Sources */,
897DFBE12CCED80600246B0D /* PlayerChestSheetView.swift in Sources */,
897DFBE22CCED80600246B0D /* PlayerChestView.swift in Sources */,
897DFBE32CCED80600246B0D /* RarityChestSheetView.swift in Sources */,
Expand All @@ -560,6 +567,7 @@
897DFBEB2CCED80600246B0D /* ProfileView.swift in Sources */,
897DFBEC2CCED80600246B0D /* PlayerAveragesModel.swift in Sources */,
897DFBED2CCED80600246B0D /* PlayerDataModel.swift in Sources */,
2E656DA82CE1506000E7E6D1 /* BalanceSheetView.swift in Sources */,
897DFBEE2CCED80600246B0D /* PlayerModel.swift in Sources */,
897DFBEF2CCED80600246B0D /* ChestModel.swift in Sources */,
897DFBF02CCED80600246B0D /* ContractModel.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"identity" : "alamofire",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Alamofire/Alamofire.git",
"location" : "https://github.com/Alamofire/Alamofire",
"state" : {
"revision" : "e16d3481f5ed35f0472cb93350085853d754913f",
"version" : "5.10.1"
Expand Down
9 changes: 3 additions & 6 deletions All In/Features/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ struct HomeView: View {
.font(Constants.Fonts.title)
.foregroundStyle(Constants.Colors.black)
Spacer()
HStack {
Image("RedMoney")
Text(viewModel.user.balance.withCommas())
.font(.system(size: 18, weight: .bold))
.foregroundStyle(.black)
}

BalanceView(balance: viewModel.user.balance.withCommas())

}
.padding()
}
Expand Down
28 changes: 28 additions & 0 deletions All In/Features/Home/Views/BalanceSheetView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// BalanceSheetView.swift
// All In
//
// Created by Charles Liggins on 11/10/24.
//

import SwiftUI

struct BalanceSheetView: View {

@Binding var showSheet: Bool
@State var balance: String

var body: some View {
SheetView(
title: balance,
subTitle: "",
description: "BALANCE",
buttonText: "Buy Now",
showSheet: $showSheet
) {
VStack {
Text("Hey")
}
}
}
}
29 changes: 29 additions & 0 deletions All In/Features/Home/Views/BalanceView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// BalanceView.swift
// All In
//
// Created by Charles Liggins on 11/10/24.
//

import SwiftUI

struct BalanceView: View {
@State var balance: String
@State var showSheet = false

var body: some View {
Button {
showSheet = true
} label: {
HStack {
Image("RedMoney")
Text(balance)
.font(.system(size: 18, weight: .bold))
.foregroundStyle(.black)
}
}.sheet(isPresented: $showSheet) {
BalanceSheetView(showSheet: $showSheet, balance: balance)
.presentationDetents([.fraction(0.9)])
}
}
}