-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(sdds-counter): added sdds-counter #137
feat(sdds-counter): added sdds-counter #137
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
} | ||
.background(currentColor(for: appearance.backgroundColor)) | ||
.cornerRadius(cornerRadius) | ||
.frame(maxWidth: data.value.count > 1 ? .infinity : appearance.size.width, minHeight: appearance.size.height) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VladimirDimitraki Давай вот эту штуку data.value.count > 1 ? .infinity : appearance.size.width
вынесем в отдельный computed property
if let typography = appearance.dataTypography.typography(with: appearance.size) { | ||
return typography | ||
} else { | ||
fatalError("Undefined Button Typography for size \(appearance.size.debugDescription). Using a default value.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Undefined Counter Typography for size \(appearance.size.debugDescription). Using a default value."
Можно кстати вынести всю эту строку в отдельную функцию в extension для View, вроде
extension View {
func undefinedTypographyErrorText(sizeDescription: String) -> String {
"Undefined \(Self.self) Typography for size \(sizeDescription). Using a default value."
}
}
и вызвать
fatalError(undefinedTypographyErrorText(sizeDescription: appearance.size.debugDescription))
public var body: some View { | ||
List { | ||
counterView | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VladimirDimitraki Давай уберем переход на новую строку
|
||
Section { | ||
dataTextField | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не нужен переход на новую строку
dataTextField | ||
|
||
appearance | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не нужен переход на новую строку
|
||
public var body: some View { | ||
ZStack { | ||
if data.value.count > 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VladimirDimitraki data.value.count > 1
вот эту штуку лучше вынести в computer property и назвать например var isAuto: Bool
} | ||
|
||
public var counterAutomationSize: some View { | ||
Text("\(data.value)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VladimirDimitraki "\(data.value)"
вот эту штуку можно вынести в computer property var text: String
и переиспользовать везде
b5ee157
to
4c90ff5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Выглядит хорошо 👍 Есть несколько минорных комментов
@@ -16,4 +16,8 @@ public extension View { | |||
func gradient(_ token: GradientToken, colorScheme: ColorScheme = .light) -> some View { | |||
modifier(GradientModifier(token: token, colorScheme: colorScheme)) | |||
} | |||
|
|||
func undefinedTypographyErrorText(sizeDescription: String) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VladimirDimitraki Давай лучше заведем extension именно в SDDSComponents, поскольку этот метод будет использоваться только там. Тем более – именно этот extension (SDDSThemeBuilder/SDDSThemeCore/Sources/SDDSThemeCore/Extensions/View+Tokens.swift) используется только модификаторов токенов, а не для функций-утилит
} | ||
|
||
var dynamicWidth: CGFloat { | ||
data.value.count > 1 ? .infinity : appearance.size.width |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VladimirDimitraki здесь можно использовать isAuto
e6e28e4
to
39fe2b1
Compare
Release/25 12 2024
9f364cb
to
6fef021
Compare
c7a39ff
to
8377aa6
Compare
8377aa6
to
85c6e7c
Compare
No description provided.