Skip to content
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
4 changes: 4 additions & 0 deletions All In.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
D0EB53232DA4A97E00F988EB /* SellContractView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0EB53222DA4A94000F988EB /* SellContractView.swift */; };
D0EB53262DA4AF3E00F988EB /* SellSelectedContractView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0EB53252DA4AF3E00F988EB /* SellSelectedContractView.swift */; };
D0F6A9F62BD887F100D75BAD /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = D0F6A9F52BD887F100D75BAD /* SnapKit */; };
D8DFE21D2D9097B600A441F6 /* BetCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8DFE21C2D9097B600A441F6 /* BetCard.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -167,6 +168,7 @@
D0B4A2532DA6EA3300A1722C /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
D0B4A25B2DA6F45200A1722C /* Keys.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Keys.xcconfig; sourceTree = "<group>"; };
D0CD31812BD5A2F500E7136C /* NetworkManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkManager.swift; sourceTree = "<group>"; };
D8DFE21C2D9097B600A441F6 /* BetCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BetCard.swift; sourceTree = "<group>"; };
D0EB53222DA4A94000F988EB /* SellContractView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SellContractView.swift; sourceTree = "<group>"; };
D0EB53252DA4AF3E00F988EB /* SellSelectedContractView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SellSelectedContractView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -349,6 +351,7 @@
897DFBD82CCED80600246B0D /* ContractCard.swift */,
897DFBD92CCED80600246B0D /* PlayerContractSheetView.swift */,
897DFBDA2CCED80600246B0D /* TabBar.swift */,
D8DFE21C2D9097B600A441F6 /* BetCard.swift */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -686,6 +689,7 @@
29C9CBE02D9DCB2F00E38F7A /* SportPill.swift in Sources */,
D0EB53262DA4AF3E00F988EB /* SellSelectedContractView.swift in Sources */,
897DFBFC2CCED80C00246B0D /* Color+Extension.swift in Sources */,
D8DFE21D2D9097B600A441F6 /* BetCard.swift in Sources */,
29C9CBE22D9DDE5A00E38F7A /* RarityPackSheetView.swift in Sources */,
897DFBFD2CCED80C00246B0D /* Date+Extension.swift in Sources */,
897DFBFE2CCED80C00246B0D /* NSNumberFormatter.swift in Sources */,
Expand Down
71 changes: 71 additions & 0 deletions All In/Features/Shared/Views/BetCard.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
//
// BetCard.swift
// All In
//
// Created by Hsia Lu wu on 3/23/25.
//

import SwiftUI

struct BetCard: View {

@State private var contract: Contract
@State private var player: Player

init(contract: Contract) {
_contract = State(initialValue: contract)
_player = State(initialValue: Contract.getPlayer(contract))
}

var body: some View {
// info
HStack(alignment: .center) {
// player image
Image("Player\(player.number)")
.resizable()
.frame(width: 37, height: 37)

// info
VStack(alignment: .leading) {
Text("\(Contract.getPlayer(contract).firstName) \(Contract.getPlayer(contract).lastName) v. \(contract.opposingTeam)")
.font(.system(size: 16))
.foregroundStyle(Constants.Colors.white)

// TODO: missing date and sport field for contracts
Text("\(Date().monthDayFormat) | Men's Ice Hockey")
.font(.system(size: 12))
.foregroundStyle(Constants.Colors.white)

// TODO: event
Text("\(contract.event)")
.font(.system(size: 12))
.foregroundStyle(Constants.Colors.white)
}

VStack {
Text("Cost: \(contract.buyPrice)")
.font(.system(size: 12, weight: .regular))
.foregroundStyle(Constants.Colors.orange)

Text("Gain: \(contract.value)")
.font(.system(size: 12, weight: .regular))
.foregroundStyle(Constants.Colors.lightGreen)
}
}
.padding(.horizontal, 16)
.padding(.vertical, 16)
.frame(maxWidth: .infinity)
.background(Constants.Colors.blackBlue)
.cornerRadius(16)
// Card border
.overlay(
RoundedRectangle(cornerRadius: 16)
.stroke(LinearGradient(gradient: Constants.Colors.gradient, startPoint: .topLeading, endPoint: .bottomTrailing), lineWidth: 2)
)
.padding(.horizontal, 24)
}
}

#Preview {
BetCard(contract: Contract.dummyData[0])
}
8 changes: 0 additions & 8 deletions All In/Features/Shared/Views/ContractCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ struct ContractCard: View {
showSheet = true
} label: {
ZStack(alignment: .bottom) {
RoundedRectangle(cornerRadius: 16)
.inset(by: 0.5)
.stroke(Constants.Colors.grey00, lineWidth: 2)
.frame(width: 150, height: 150)
.background(.white)
.cornerRadius(16)
.shadow(color: Constants.Colors.grey00, radius: 5, x: 0, y: 4)

VStack(alignment: .center, spacing: 26) {
VStack {
ZStack {
Expand Down
6 changes: 2 additions & 4 deletions All In/Utils/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ struct Constants {
static let gradientLavender = Color(hex: 0x7D97FE)
static let blackBlue = Color(hex: 0x201E2D)
static let backgroundBlack = Color(hex: 0x15141B)
// System
static let background = Color(hex: 0x15141B)

// Charts
static let greenChart = Color(hex: 0x47CD89)
static let redChart = Color(hex: 0xF97066)
static let moneyGreen = Color(hex: 0x47CD89)

// System
static let background = Color(hex: 0x15141B)

// Gradient
static let gradient = Gradient(
colors: [
Expand All @@ -53,7 +52,6 @@ struct Constants {
Constants.Colors.gradientLavender
]
)

}

enum Fonts {
Expand Down