Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Feat/present the offer in offer view #130

Merged
merged 3 commits into from
May 24, 2024
Merged
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
6 changes: 3 additions & 3 deletions Example/TikiClient.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = JC63RM5U2M;
DevelopmentTeam = LT25K3QV5V;
LastSwiftMigration = 0900;
};
88E1B7C42B926458005429F1 = {
Expand Down Expand Up @@ -513,7 +513,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = "$(inherited)";
DEVELOPMENT_TEAM = JC63RM5U2M;
DEVELOPMENT_TEAM = LT25K3QV5V;
INFOPLIST_FILE = TikiClient/Info.plist;
INFOPLIST_KEY_NSCameraUsageDescription = "The app need the camera permision";
INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "";
Expand All @@ -534,7 +534,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = "$(inherited)";
DEVELOPMENT_TEAM = JC63RM5U2M;
DEVELOPMENT_TEAM = LT25K3QV5V;
INFOPLIST_FILE = TikiClient/Info.plist;
INFOPLIST_KEY_NSCameraUsageDescription = "The app need the camera permision";
INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "";
Expand Down
Binary file added TikiClient/Assets/ballons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added TikiClient/Assets/tikilogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions TikiClient/Classes/UI/Screens/OfferAllowTraking.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
//
// OfferView.swift
// TikiClient
//
// Created by Jesse Monteiro Ferreira on 21/05/24.
//

import SwiftUI

public struct OfferAllowTrackView: View {
public init() {}
public var body: some View {
LinearGradient(gradient: Gradient(colors: [Color(hex: "#01CB82"), Color(hex: "#00B272"), Color(hex: "#026A44")]), startPoint: .top, endPoint: .bottom)
.ignoresSafeArea() // Ignore just for the color
.background()
.overlay(
VStack(alignment: .leading) {
Spacer()
Text("Allow tracking on the next screen for:")
.font(.system(size: 30))
.fontWeight(.semibold)
.foregroundColor(.white)
.padding(.horizontal, 40)
.padding(.top, -35)

VStack(alignment: .leading, spacing: 45){
HStack(){
Image(systemName: "gift.circle.fill")
.resizable()
.frame(width: 40, height: 40)
.padding(.trailing, 10)
.foregroundColor(.white)
Text("Data offers and promotions just for you")
.fontWeight(.semibold)
.font(.system(size: 21))
.foregroundColor(.white)
}
HStack(){
Image(systemName: "hand.tap.fill")
.resizable()
.frame(width: 40, height: 40)
.padding(.trailing, 10)
.foregroundColor(.white)

Text("Advertisements that match your interests")
.fontWeight(.semibold)
.font(.system(size: 21))
.foregroundColor(.white)
}
HStack() {
Image(systemName: "person.badge.shield.checkmark.fill")
.resizable()
.frame(width: 40, height: 40)
.padding(.trailing, 10)
.foregroundColor(.white)
Text("An improved personalized experience over time")
.fontWeight(.semibold)
.font(.system(size: 21))
.foregroundColor(.white) }
Text("You can change this option later in the Settings app.")
.fontWeight(.semibold)
.font(.system(size: 22))
.foregroundColor(.white)
}.padding(.horizontal, 40).padding(.vertical, 30)

VStack(){
Button() {
print("Continue")
} label: {
Text("Continue")
.font(.system(size: 23))
.fontWeight(.regular)
.frame(maxWidth: .infinity)
.foregroundColor(Color(hex: "#026A44"))
.padding()
.background(Color(.secondarySystemBackground))
.cornerRadius(50)
}.buttonStyle(.plain).padding(.bottom, 10)
}.padding(.horizontal, 40)
Spacer()
}
)
}
}
150 changes: 150 additions & 0 deletions TikiClient/Classes/UI/Screens/OfferLinkCardView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
//
// OfferView.swift
// TikiClient
//
// Created by Jesse Monteiro Ferreira on 21/05/24.
//

import SwiftUI

public struct OfferLinkCardView: View {
public init() {}
let a = Image("tikilogo.png")
public var body: some View {
LinearGradient(gradient: Gradient(colors: [Color(hex: "#01CB82"), Color(hex: "#00B272"), Color(hex: "#026A44")]), startPoint: .top, endPoint: .bottom)
.ignoresSafeArea() // Ignore just for the color
.background()
.overlay(
VStack(alignment: .leading) {
image("tikilogo")
Text("Share your purchase")
.font(.title)
.fontWeight(.medium)
.foregroundColor(.white)
.padding(.horizontal, 40)
Text("history:")
.font(.title)
.fontWeight(.medium)
.foregroundColor(.white)
.padding(.horizontal, 40)
.padding(.top, -30)

HStack(){
Spacer()
ZStack(){
Circle()
.fill(Color.white.opacity(0))
.frame(width: 150, height: 150)
.overlay(
RoundedRectangle(cornerRadius: 100)
.stroke(Color.white, lineWidth: 7)
)
VStack(alignment: .center){
HStack(alignment: .bottom) {
Spacer()
Text("100")
.fontWeight(.medium)
.font(.system(size: 50))
.foregroundColor(.white)
.padding(.trailing, -8)
.padding(.top, 10)
Text("pts")
.fontWeight(.medium)
.font(.system(size: 22))
.foregroundColor(.white)
.padding(.top, -35)
Spacer()
}
HStack(){
Text("each month")
.fontWeight(.medium)
.font(.system(size: 16))
.foregroundColor(.white)
}
}
}

Spacer()
}.padding(.top, 5)

VStack(alignment: .leading, spacing: 10){
Text("We use your data for:")
.font(.system(size: 20))
.fontWeight(.medium)
.foregroundColor(.white)
.padding(.top, 35)
HStack(){
Image(systemName: "slider.vertical.3")
.foregroundColor(.white)
Text("Aggregate market insights")
.fontWeight(.medium)
.font(.system(size: 21))
.foregroundColor(.white)
}
HStack(){
Image(systemName: "percent")
.foregroundColor(.white)
Text("Exclusive offers just for you")
.fontWeight(.medium)
.font(.system(size: 21))
.foregroundColor(.white)
}
HStack() {
Image(systemName: "pencil.circle")
.foregroundColor(.white)
Text("Improving systems like AI")
.fontWeight(.medium)
.font(.system(size: 21))
.foregroundColor(.white) }
Text("Learn more or change your mind any time in settings.")
.fontWeight(.medium)
.font(.system(size: 21))
.foregroundColor(.white)
}.padding(.horizontal, 40).padding(.bottom, 40)

VStack(){
Button() {
print("Linked card")
} label: {
Text("Link Card")
.font(.system(size: 21))
.fontWeight(.medium)
.frame(maxWidth: .infinity)
.foregroundColor(Color(hex: "#026A44"))
.padding()
.background(Color(.secondarySystemBackground))
.cornerRadius(50)
}.buttonStyle(.plain).padding(.bottom, 10)
Button() {
print("No Thanks")
} label: {
Text("No Thanks")
.font(.system(size: 21))
.fontWeight(.medium)
.frame(maxWidth: .infinity)
.foregroundColor(Color.white)
.padding()
.background(Color(.green).opacity(0))
.overlay(
RoundedRectangle(cornerRadius: 50)
.stroke(Color.white, lineWidth: 4)
)


}.buttonStyle(.plain)
}.padding(.horizontal, 40)
}
)
}
}

func image(_ name: String) -> Image? {
let bundle = Bundle(for: TikiClient.self)
guard let path = bundle.path(forResource: "Assets/\(name)", ofType: "png") else {
print("image not found")
return nil
}
let image = Image("tikilogo.png", bundle: bundle)
return Image(path)

}
8 changes: 0 additions & 8 deletions TikiClient/Classes/UI/Screens/OfferPrompt.swift

This file was deleted.

36 changes: 36 additions & 0 deletions TikiClient/Classes/Util/Color.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// Color.swift
// TikiClient
//
// Created by Jesse Monteiro Ferreira on 22/05/24.
//

import Foundation
import SwiftUI

extension Color {
init(hex: String) {
let hex = hex.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
var int: UInt64 = 0
Scanner(string: hex).scanHexInt64(&int)
let a, r, g, b: UInt64
switch hex.count {
case 3: // RGB (12-bit)
(a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17)
case 6: // RGB (24-bit)
(a, r, g, b) = (255, int >> 16, int >> 8 & 0xFF, int & 0xFF)
case 8: // ARGB (32-bit)
(a, r, g, b) = (int >> 24, int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF)
default:
(a, r, g, b) = (1, 1, 1, 0)
}

self.init(
.sRGB,
red: Double(r) / 255,
green: Double(g) / 255,
blue: Double(b) / 255,
opacity: Double(a) / 255
)
}
}
Loading