review cards

feature/in-progress-card
Lucas DELANIER 11 months ago
parent 209205c1bd
commit ce4e858cc1

@ -24,11 +24,10 @@ struct Menu: View {
var body: some View { var body: some View {
VStack(alignment: .leading, spacing: 10) { VStack(alignment: .leading, spacing: 10) {
HStack() { HStack() {
Spacer() Spacer()
VStack(){ VStack(){
UserPicture(username: (AppStateContainer.shared.user?.username)!, size: 100) UserPicture(picture: AppStateContainer.shared.user?.image, username: (AppStateContainer.shared.user?.username)!,size: 100)
Text(AppStateContainer.shared.user?.username.capitalized ?? "") Text(AppStateContainer.shared.user?.username.capitalized ?? "")
.fontWeight(.medium) .fontWeight(.medium)
.font(.system(size: 17)) .font(.system(size: 17))

@ -44,19 +44,26 @@ struct ReviewCard: View {
VStack(alignment: .center,spacing:0){ VStack(alignment: .center,spacing:0){
HStack(){ HStack(){
Spacer() Spacer()
Text((betDetail.userParticipation?.stake.description) ?? "") if(betDetail.userParticipation != nil){
.foregroundColor(.white) Text((betDetail.userParticipation?.stake.description ?? ""))
.font(.system(size: 25)) .foregroundColor(.white)
.fontWeight(.bold) .font(.system(size: 25))
Image("allcoinWhiteIcon") .fontWeight(.bold)
.resizable() Image("allcoinWhiteIcon")
.frame(width: 18, height: 20) .resizable()
.frame(width: 18, height: 20)
}
switch betDetail.bet.status { switch betDetail.bet.status {
case .waiting, .inProgress, .closing: case .waiting, .inProgress:
Text("bet_status_stake") Text("bet_status_stake")
.foregroundColor(.white) .foregroundColor(.white)
.font(.system(size: 25)) .font(.system(size: 25))
.fontWeight(.bold) .fontWeight(.bold)
case .closing:
Text("bet_status_finished")
.foregroundColor(.white)
.font(.system(size: 25))
.fontWeight(.bold)
case .finished: case .finished:
Text(amountBetted.description) Text(amountBetted.description)
.foregroundColor(.white) .foregroundColor(.white)

@ -8,14 +8,14 @@
import SwiftUI import SwiftUI
struct UserPicture: View { struct UserPicture: View {
var picture: URL? var picture: String?
var username: String var username: String
var size: CGFloat var size: CGFloat
var body: some View { var body: some View {
ZStack { ZStack {
if picture != nil { if picture != nil {
AsyncImage( AsyncImage(
url: picture, url: URL(string:picture!),
content: { image in content: { image in
image image
.resizable() .resizable()

@ -7,5 +7,21 @@
<key>NSExtensionPointIdentifier</key> <key>NSExtensionPointIdentifier</key>
<string>com.apple.widgetkit-extension</string> <string>com.apple.widgetkit-extension</string>
</dict> </dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>codefirst.iut.uca.fr</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
</dict> </dict>
</plist> </plist>

Loading…
Cancel
Save