-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathPlayerView.swift
66 lines (58 loc) · 1.91 KB
/
PlayerView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//
// PlayerView.swift
// MatchScoresTCA
//
// Created by emre.degirmenci on 6.08.2023.
//
import SwiftUI
import ComposableArchitecture
struct PlayerView: View {
let player: PlayerData
var body: some View {
VStack(spacing: .zero) {
VStack(alignment: .leading) {
Text("\(player.firstName) \(player.lastName)")
.foregroundColor(Theme.text)
.font(
.system(.largeTitle, design: .rounded)
)
}
.frame(maxWidth: .infinity, alignment: .leading)
.frame(height: 150.0)
.padding(.horizontal, 8)
.padding(.vertical, 5)
VStack {
PillView(id: player.id)
.padding(.leading, 10)
.padding(.top, 10)
}
}
.toolbarBackground(Color.blue._300, for: .navigationBar)
.toolbarBackground(Color.blue._300, for: .tabBar)
.clipShape(
RoundedRectangle(cornerRadius: 16,
style: .continuous)
)
.shadow(color: Theme.text.opacity(0.1),
radius: 2,
x: 0,
y: 1)
.edgesIgnoringSafeArea([.top, .leading, .trailing])
}
}
private extension PlayerView {
var refresh: some View {
Button {
Task {
// await vm.fetchTeams()
}
} label: {
Symbols.refresh
}
}
}
struct PlayerView_Previews: PreviewProvider {
static var previews: some View {
return PlayerView(player: PlayerData(id: 14, firstName: "Ike", heightFeet: nil, heightInches: nil, lastName: "Anigbogu", position: "C", team: TeamData(id: 12, abbreviation: "IND", city: "Indiana", conference: "East", division: "Central", fullName: "Indiana Pacers", name: "Pacers"), weightPounds: nil))
}
}