Skip to content

Feature/trash screen #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 49 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
c0ee890
Создал шаблон экрана корзины
GoncharovNG Feb 8, 2024
7cba181
Создан скелет корзины
GoncharovNG Feb 8, 2024
4079ada
Update .gitignore to exclude IDE files
shvetsovrsh Feb 9, 2024
6566bf1
Update .gitignore to exclude IDE files
shvetsovrsh Feb 10, 2024
d773d25
imageSet ProfileImage added
shvetsovrsh Feb 10, 2024
df4541e
Merge pull request #3 from maxzim121/common-images
shvetsovrsh Feb 10, 2024
7e5b568
profile decomposition added
shvetsovrsh Feb 11, 2024
044f04b
Merge pull request #6 from maxzim121/common-docs
shvetsovrsh Feb 11, 2024
61d3948
additional tabs for TabBarController added
shvetsovrsh Feb 11, 2024
f13c3f9
Merge pull request #31 from maxzim121/common-tabbar
shvetsovrsh Feb 11, 2024
db7ade8
Merge pull request #44 from maxzim121/common
AlexanderAMedvedev Feb 12, 2024
8ff1f58
DONE: added statisticsDecomposition.md file.
AlexanderAMedvedev Feb 13, 2024
0076fe2
Added the white background color for statistics screen.
AlexanderAMedvedev Feb 13, 2024
b304690
Merge pull request #45 from maxzim121/common-colors
AlexanderAMedvedev Feb 13, 2024
358880c
RequestConstants.swift and NetworkClient.swift updated
shvetsovrsh Feb 14, 2024
91241a7
Merge pull request #47 from maxzim121/common-network
shvetsovrsh Feb 14, 2024
c64b281
Added black color for text within the main table with statistics.
AlexanderAMedvedev Feb 14, 2024
d1483a1
Merge pull request #48 from maxzim121/common-colors
AlexanderAMedvedev Feb 15, 2024
065bc5c
added Universal Colors
shvetsovrsh Feb 15, 2024
7817e96
Merge pull request #51 from maxzim121/common-colors
shvetsovrsh Feb 15, 2024
34b373b
removed private modifier for Universal Colors
shvetsovrsh Feb 15, 2024
584783a
Merge pull request #52 from maxzim121/common-colors
shvetsovrsh Feb 15, 2024
7eff460
added "Error.cancel" = "Отмена"; into Localizable.strings and Profile…
shvetsovrsh Feb 16, 2024
099f7c2
Merge pull request #53 from maxzim121/common-localization
shvetsovrsh Feb 16, 2024
34e440f
Рефакторинг!
GoncharovNG Feb 19, 2024
0289bda
Доработка замечаний после ревью ( легкий рефакторинг)
GoncharovNG Mar 1, 2024
80e14d4
Доработка замечаний после ревью ( легкий рефакторинг)
GoncharovNG Mar 6, 2024
733a0a1
Мердж
GoncharovNG Mar 6, 2024
8bfebd5
Merge branch 'feature/trashScreen' into GNG/Cart-1-3
GoncharovNG Mar 6, 2024
70b4962
Коррекция
GoncharovNG Mar 6, 2024
5e2c994
проверка догрузки файлов
GoncharovNG Mar 9, 2024
d4ceda8
Исправлены замечания ревью
GoncharovNG Mar 10, 2024
61be0ea
Исправления декомпозиция
GoncharovNG Mar 10, 2024
0eefb1e
Рефакторинг
GoncharovNG Mar 10, 2024
aa8fbd4
Проверка загрузки материала!
GoncharovNG Mar 10, 2024
1df7d4e
Merge pull request #99 from maxzim121/GNG/Cart-1-3
GoncharovNG Mar 10, 2024
7f61198
PaymentScene
GoncharovNG Mar 10, 2024
86f8945
проведен рефакторинг!
GoncharovNG Mar 11, 2024
2a05f8b
Догрузка
GoncharovNG Mar 11, 2024
2fe846a
Рефакторинг
GoncharovNG Mar 11, 2024
6fa4826
Оплата Рефакторинг
GoncharovNG Mar 14, 2024
1a42765
Исправление замечание после ревью
GoncharovNG Mar 14, 2024
5ed5c0d
Рефакторинг
GoncharovNG Mar 14, 2024
e540e43
устранение замечания по экрану оплаты!
GoncharovNG Mar 21, 2024
71f0682
fix bag
GoncharovNG Apr 3, 2024
353805a
bag fix
GoncharovNG Apr 3, 2024
6d544b1
Устранение замечаний после ревью!
GoncharovNG Apr 19, 2024
5a1bd97
Устранены замечания ревью!
GoncharovNG Apr 27, 2024
f388f15
Merge pull request #104 from maxzim121/GNG/Cart-2-3
GoncharovNG Apr 28, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ fastlane/test_output
iOSInjectionProject/

.DS_Store
.idea/
328 changes: 314 additions & 14 deletions FakeNFT.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions FakeNFT/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
) -> Bool {
return true
}

// MARK: UISceneSession Lifecycle

func application(
_: UIApplication,
configurationForConnecting connectingSceneSession: UISceneSession,
Expand Down
37 changes: 27 additions & 10 deletions FakeNFT/DesignSystem/Colors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,41 +24,58 @@ extension UIColor {
alpha: CGFloat(alpha) / 255
)
}

// Ниже приведены примеры цветов, настоящие цвета надо взять из фигмы

// Primary Colors
static let primary = UIColor(red: 0 / 255, green: 122 / 255, blue: 255 / 255, alpha: 1.0)

// Secondary Colors
static let secondary = UIColor(red: 255 / 255, green: 193 / 255, blue: 7 / 255, alpha: 1.0)

// Background Colors
static let background = UIColor.white

static let figmaWhite = UIColor(hexString: "FFFFFF")

// Text Colors
static let textPrimary = UIColor.black
static let textSecondary = UIColor.gray
static let textOnPrimary = UIColor.white
static let textOnSecondary = UIColor.black

private static let yaBlackLight = UIColor(hexString: "1A1B22")
static let yaBlackLight = UIColor(hexString: "1A1B22")
private static let yaBlackDark = UIColor.white
private static let yaLightGrayLight = UIColor(hexString: "#F7F7F8")
private static let yaLightGrayDark = UIColor(hexString: "#2C2C2E")


// Universal Colors
static let yaGrayUniversal = UIColor(hexString: "#625C5C")
static let yaRedUniversal = UIColor(hexString: "#F56B6C")
static let yaBackgroundUniversal = UIColor(hexString: "#1A1B22")
static let yaGreenUniversal = UIColor(hexString: "#1C9F00")
static let yaBlueUniversal = UIColor(hexString: "#0A84FF")
static let yaBlackUniversal = UIColor(hexString: "#1A1B22")
static let yaWhiteUniversal = UIColor(hexString: "#FFFFFF")
static let yaYellowUniversal = UIColor(hexString: "#FEEF0D")
static let yaBlackDayNight = UIColor(hexString: "#FFFFFF")
static let yaWhiteDayNight = UIColor(hexString: "#1A1B22")
static let yaRedUni = UIColor(hexString: "#F56B6C")
static let yaYellowUni = UIColor(hexString: "#FEEF0D")
static let yaLightGreyDayNight = UIColor(hexString: "#F7F7F8")
static let yaGreenUni = UIColor(hexString: "#1C9F00")

static let segmentActive = UIColor { traits in
return traits.userInterfaceStyle == .dark
? .yaBlackDark
: .yaBlackLight
}

static let segmentInactive = UIColor { traits in
return traits.userInterfaceStyle == .dark
? .yaLightGrayDark
: .yaLightGrayLight
}

static let closeButton = UIColor { traits in
return traits.userInterfaceStyle == .dark
? .yaBlackDark
Expand Down
6 changes: 3 additions & 3 deletions FakeNFT/DesignSystem/Fonts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import UIKit

extension UIFont {
// Ниже приведены примеры шрифтов, настоящие шрифты надо взять из фигмы

// Headline Fonts
static var headline1 = UIFont.systemFont(ofSize: 34, weight: .bold)
static var headline2 = UIFont.systemFont(ofSize: 28, weight: .bold)
static var headline3 = UIFont.systemFont(ofSize: 22, weight: .bold)
static var headline4 = UIFont.systemFont(ofSize: 20, weight: .bold)

// Body Fonts
static var bodyRegular = UIFont.systemFont(ofSize: 17, weight: .regular)
static var bodyBold = UIFont.systemFont(ofSize: 17, weight: .bold)

// Caption Fonts
static var caption1 = UIFont.systemFont(ofSize: 15, weight: .regular)
static var caption2 = UIFont.systemFont(ofSize: 13, weight: .regular)
Expand Down
63 changes: 63 additions & 0 deletions FakeNFT/DesignSystem/ReusableViews/CustomButton.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
//
// CustomButton.swift
// FakeNFT
//
// Created by Никита Гончаров on 25.02.2024.
//

import UIKit

final class CustomButton: UIButton {
enum ButtonType {
case filled
case bordered
}

init(type: ButtonType, title: String, action: Selector) {
super.init(frame: .zero)
addTarget(nil, action: action, for: .touchUpInside)
configure(type: type, title: title)
translatesAutoresizingMaskIntoConstraints = false
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesBegan(touches, with: event)
isUserInteractionEnabled = false
UIView.animate(withDuration: 0.1) { [weak self] in
self?.transform = CGAffineTransform(scaleX: 0.95, y: 0.95)
}
isUserInteractionEnabled = true
}

override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesEnded(touches, with: event)
isUserInteractionEnabled = false
UIView.animate(withDuration: 0.1) { [weak self] in
self?.transform = .identity
}
isUserInteractionEnabled = true
}

private func configure(type: ButtonType, title: String) {
setTitle(title, for: .normal)
layer.cornerRadius = 16
layer.masksToBounds = true

switch type {
case .filled:
backgroundColor = .yaWhiteDayNight
setTitleColor(.yaBlackDayNight, for: .normal)
titleLabel?.font = UIFont.systemFont(ofSize: 17, weight: .bold)
case .bordered:
backgroundColor = .yaWhiteDayNight
setTitleColor(.yaBlackDayNight, for: .normal)
titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: .regular)
layer.borderColor = UIColor.yaBlackDayNight.cgColor
layer.borderWidth = 1
}
}
}
73 changes: 73 additions & 0 deletions FakeNFT/DesignSystem/ReusableViews/StarRatingView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
//
// StarRatingView.swift
// FakeNFT
//
// Created by Никита Гончаров on 25.02.2024.
//

import UIKit

final class StarRatingView: UIStackView {

private var starImageViews: [UIImageView] = []

override init(frame: CGRect) {
super.init(frame: frame)
axis = .horizontal
spacing = 0
distribution = .fillEqually
for _ in 1...5 {
let starView = makeStarView()
starImageViews.append(starView)
addArrangedSubview(starView)
}
}

required init(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

func configureRating(_ rating: Int) {
for (index, imageView) in starImageViews.enumerated() {
if index < rating {
imageView.tintColor = .yaYellowUni
} else {
imageView.tintColor = .yaLightGreyDayNight
}
}
}

private func makeStarView() -> UIImageView {
let star = UIImageView()
star.image = UIImage(systemName: "star.fill")
star.contentMode = .scaleAspectFit
star.translatesAutoresizingMaskIntoConstraints = false
return star
}
}

extension StarRatingView {
convenience init(height: CGFloat) {
self.init()
arrangedSubviews.forEach { $0.removeFromSuperview() }
starImageViews.removeAll()
axis = .horizontal
spacing = 0
distribution = .fillEqually
for _ in 1...5 {
let starView = makeStarView(with: height)
starImageViews.append(starView)
addArrangedSubview(starView)
}
}

private func makeStarView(with height: CGFloat) -> UIImageView {
let star = UIImageView()
let pointSize: CGFloat = 3 / 4 * height
let config = UIImage.SymbolConfiguration(pointSize: pointSize)
star.image = UIImage(systemName: "star.fill", withConfiguration: config)
star.contentMode = .scaleAspectFit
star.translatesAutoresizingMaskIntoConstraints = false
return star
}
}
13 changes: 13 additions & 0 deletions FakeNFT/DesignSystem/UIImage+Extension.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// UIImage+Extension.swift
// FakeNFT
//
// Created by Никита Гончаров on 25.02.2024.
//

import UIKit

extension UIImage {
static let cartDeleteIcon = UIImage(named: "cardDelete") ?? UIImage()
static let cardActiveIcon = UIImage(named: "cardActive") ?? UIImage()
}
42 changes: 42 additions & 0 deletions FakeNFT/Docs/StatisticsDecomposition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Декомпозиция

Медведев Александр Александрович

Когорта: 10

Группа: 1

Эпик: Статистика

Ссылка на доску: https://github.com/users/maxzim121/projects/1/views/1

Декомпозиция эпика "Статистика"

Часть 1
1) Реализовать экран с таблицей
- создать класс для ячейки (план: 0.5ч; факт: ч)
- загружать данные для таблицы с сервера (план: 2ч; факт: ч)

2) Реализовать сортировку данных для таблицы
- сортировка по рейтингу пользователя (по умолчанию)(план: 1ч; факт: ч)

Часть 2

1) Реализовать сортировку данных для таблицы
- сортировка по имени пользователя (план: 0.5ч; факт: ч)
- запоминать на устройстве выбранную сортировку (план: 0.5ч; факт: ч)

2) Реализовать экран информация о пользователе
- сверстать его в коде (план: 1ч; факт: ч)

Часть 3
1) Реализовать экран информация о пользователе
- реализовать переход на страницу пользователя (план: 1ч; факт: ч)

2) Реализовать экран с коллекцией NFT
- создать класс для ячейки (план: 1ч; факт: ч)
- загружать данные для таблицы с сервера (план: 2ч; факт: ч)

Общее время
- план: 2.5+2+2+3=9.5(ч)
- факт:
4 changes: 2 additions & 2 deletions FakeNFT/Foundation/CellsReusingUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extension UITableView {
func register<T: UITableViewCell>(_: T.Type) where T: ReuseIdentifying {
register(T.self, forCellReuseIdentifier: T.defaultReuseIdentifier)
}

func dequeueReusableCell<T: UITableViewCell>() -> T where T: ReuseIdentifying {
guard let cell = dequeueReusableCell(withIdentifier: T.defaultReuseIdentifier) as? T else {
assertionFailure("Could not dequeue cell with identifier: \(T.defaultReuseIdentifier)")
Expand All @@ -34,7 +34,7 @@ extension UICollectionView {
func register<T: UICollectionViewCell>(_: T.Type) where T: ReuseIdentifying {
register(T.self, forCellWithReuseIdentifier: T.defaultReuseIdentifier)
}

func dequeueReusableCell<T: UICollectionViewCell>(indexPath: IndexPath) -> T where T: ReuseIdentifying {
guard let cell = dequeueReusableCell(withReuseIdentifier: T.defaultReuseIdentifier, for: indexPath) as? T else {
assertionFailure("Could not dequeue cell with identifier: \(T.defaultReuseIdentifier) for: \(indexPath)")
Expand Down
31 changes: 31 additions & 0 deletions FakeNFT/Foundation/MemoryStorage/CartStorage.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// CartStorage.swift
// FakeNFT
//
// Created by Никита Гончаров on 23.04.2024.
//

import Foundation

protocol CartStorage: AnyObject {
func saveCart(_ currency: OrderResponse)
func getCart(with id: String) -> OrderResponse?
}

final class CartStorageImpl: CartStorage {
private var storage: [String: OrderResponse] = [:]

private let syncQueue = DispatchQueue(label: "sync-nft-queue")

func saveCart(_ cart: OrderResponse) {
syncQueue.async { [weak self] in
self?.storage[cart.id] = cart
}
}

func getCart(with id: String) -> OrderResponse? {
syncQueue.sync {
storage[id]
}
}
}
16 changes: 8 additions & 8 deletions FakeNFT/Foundation/MemoryStorage/NftStorage.swift
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import Foundation

protocol NftStorage: AnyObject {
func saveNft(_ nft: Nft)
func getNft(with id: String) -> Nft?
func saveNft(_ nft: NFT)
func getNft(with id: String) -> NFT?
}

// Пример простого класса, который сохраняет данные из сети
final class NftStorageImpl: NftStorage {
private var storage: [String: Nft] = [:]

private var storage: [String: NFT] = [:]
private let syncQueue = DispatchQueue(label: "sync-nft-queue")

func saveNft(_ nft: Nft) {
func saveNft(_ nft: NFT) {
syncQueue.async { [weak self] in
self?.storage[nft.id] = nft
}
}

func getNft(with id: String) -> Nft? {
func getNft(with id: String) -> NFT? {
syncQueue.sync {
storage[id]
}
Expand Down
Loading