Beginning CreationBet Page

auth_manage
Emre KARTAL 2 years ago
parent 0b8d7039be
commit 04b27222fc

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xE6",
"green" : "0xE6",
"red" : "0xE6"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xE6",
"green" : "0xE6",
"red" : "0xE6"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "Unioncross.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "futbol.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "globe-solid-purple.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "globe-solid.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 804 B

@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "globe.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "lock-solid-purple.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 821 B

@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "lock-solid.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "Vector.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -34,6 +34,7 @@ struct AllinColor {
static let PurpleLight = Color("PurpleLight")
static let TitleCreationBetColor = Color("TitleCreationBetColor")
static let PlaceholderGrayColor = Color("PlaceholderGrayColor")
static let PlaceholderLightGrayColor = Color("PlaceholderLightGrayColor")
static let BorderColorMenu = Color("BorderColorMenu")
static let PrimaryTextColor = Color("PrimaryTextColor")
static let DelimiterGray = Color("DelimiterGray")

@ -9,6 +9,7 @@ import SwiftUI
struct CreationBet: View {
@State private var selectedTab = 0
@Binding var showMenu: Bool
@State var selectedConfidentiality = true
@State private var theme: String = ""
@ -22,11 +23,20 @@ struct CreationBet: View {
let endDate = calendar.date(byAdding: .year, value: 10, to: startDate)!
return startDate ... endDate
}()
@State private var response = ""
@State private var values: [String] = []
@State private var selectedOption = 0
let options: [(String, String)] = [
("globe", "image1"),
("futbol", "image2"),
("paintbrush", "image3")
]
var body: some View {
VStack(alignment: .center, spacing: 0) {
TopBarView(showMenu: self.$showMenu)
TabView {
TabView(selection: $selectedTab) {
ScrollView(showsIndicators: false) {
VStack(alignment: .leading, spacing: 5) {
VStack() {
@ -104,6 +114,7 @@ struct CreationBet: View {
.accentColor(AllinColor.PrimaryTextColor)
.labelsHidden()
.padding(.bottom, 10)
VStack(alignment: .leading, spacing: 5) {
VStack() {
HStack(spacing: 5) {
Text("Date de fin du BET")
@ -116,7 +127,7 @@ struct CreationBet: View {
Spacer()
}
.padding(.leading, 10)
HStack() {
}
DatePicker(
"",
selection: $endDate,
@ -125,10 +136,8 @@ struct CreationBet: View {
)
.accentColor(AllinColor.PrimaryTextColor)
.labelsHidden()
Spacer()
}
}
.padding(.bottom, 40)
}
VStack {
HStack(spacing: 5) {
Text("Confidentialité du BET")
@ -142,12 +151,12 @@ struct CreationBet: View {
}
.padding(.leading, 10)
HStack(spacing: 5) {
ConfidentialityView(image: "globe", text: "Public", selected: selectedConfidentiality)
ConfidentialityView(image: "globe-solid", text: "Public", selected: selectedConfidentiality)
.onTapGesture {
selectedConfidentiality = true
}
.padding(.trailing, 5)
ConfidentialityView(image: "lock", text: "Privé", selected: !selectedConfidentiality)
ConfidentialityView(image: "lock-solid", text: "Privé", selected: !selectedConfidentiality)
.onTapGesture {
selectedConfidentiality = false
}
@ -200,14 +209,126 @@ struct CreationBet: View {
Spacer()
}
}
.padding([.leading,.trailing, .top, .bottom], 30)
.padding([.leading, .trailing, .bottom], 30)
.padding(.top, 50)
}
.tag(0)
VStack(alignment: .leading, spacing: 5) {
Picker("Sélectionnez une option", selection: $selectedOption) {
ForEach(0..<options.count, id: \.self) { index in
let (imageName, text) = options[index]
HStack {
Image(imageName)
.resizable()
.scaledToFit()
.frame(width: 30, height: 30)
Text(text)
Text("Hello")
}
.background(Color.white)
}
}
.pickerStyle(MenuPickerStyle())
Text("Les utilisateurs devront répondre au pari avec OUI ou NON.")
.font(.system(size: 13))
.fontWeight(.bold)
.padding(.leading, 35)
.foregroundColor(AllinColor.PurpleLight)
Text("Aucune autre réponse ne sera acceptée.")
.font(.system(size: 13))
.fontWeight(.bold)
.padding(.leading, 35)
.foregroundColor(AllinColor.PurpleLight)
VStack {
HStack(spacing: 0) {
TextField("", text: $response, prompt: Text("Intitulé de réponse").foregroundColor(AllinColor.PlaceholderLightGrayColor).font(.system(size: 16)).fontWeight(.medium))
.padding()
.background(
Rectangle()
.fill(Color.white)
.cornerRadius(9, corners: [.topLeft, .bottomLeft])
.frame(height: 38)
)
.frame(width: 250, height: 38)
.foregroundColor(.black)
Button(action: {
if !response.isEmpty {
values.append(response)
response = ""
}
}) {
Text("Ajouter")
.foregroundColor(.white)
}
.frame(width: 95, height: 40)
.background(AllinColor.PrimaryTextColor)
.cornerRadius(10, corners: [.bottomRight, .topRight])
.cornerRadius(2, corners: [.bottomLeft, .topLeft])
}
HStack(spacing: 10) {
ForEach(values, id: \.self) { text in
HStack {
Text(text)
.foregroundColor(.white)
Button(action: {
if let index = values.firstIndex(of: text) {
values.remove(at: index)
}
}) {
Image("cross")
.resizable()
.frame(width: 10, height: 10)
.foregroundColor(.white)
}
}
.padding(5)
.padding([.leading, .trailing], 8)
.background(AllinColor.PrimaryTextColor)
.cornerRadius(16)
}
}
}
.padding()
Spacer()
}
.padding([.leading, .trailing, .bottom], 30)
.padding(.top, 50)
.tag(1)
}
.overlay(
HStack {
Button(action: {
selectedTab = 0
}) {
Text("Question")
.font(.system(size: 16))
.padding()
.fontWeight(selectedTab == 0 ? .bold : .semibold)
.foregroundColor(selectedTab == 0 ? AllinColor.TitleCreationBetColor : Color.gray)
.offset(y: 0)
}
Button(action: {
selectedTab = 1
}) {
Text("Réponses")
.font(.system(size: 16))
.padding()
.fontWeight(selectedTab == 1 ? .bold : .semibold)
.foregroundColor(selectedTab == 1 ? AllinColor.TitleCreationBetColor : Color.gray)
.offset(y: 0)
}
}
, alignment: .top)
.tabViewStyle(PageTabViewStyle())
Spacer()
}
.edgesIgnoringSafeArea(.bottom).background(AllinColor.backgroundWhite)
}
}

@ -15,10 +15,10 @@ struct ConfidentialityView: View {
var body: some View {
HStack() {
Image(systemName: image)
Image(selected ? image : image+"-purple")
.resizable()
.frame(width: 18, height: 18)
.foregroundColor(selected ? .white : AllinColor.PrimaryTextColor)
.scaledToFit()
.padding(.vertical, 12)
Text(text)
.font(.system(size: 17))

Loading…
Cancel
Save