-
Notifications
You must be signed in to change notification settings - Fork 36
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
IOS-7874 make fix space for title header #3970
Changes from 6 commits
df353c8
02070ce
5eacc60
a763f83
b6ceef4
41741aa
75d052b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,55 +13,66 @@ struct MarketsTokenDetailsPricePerformanceView: View { | |
@ObservedObject var viewModel: MarketsTokenDetailsPricePerformanceViewModel | ||
|
||
var body: some View { | ||
VStack(spacing: 18) { | ||
HStack(content: { | ||
Text(Localization.marketsTokenDetailsPricePerformance) | ||
.style(Fonts.Bold.footnote, color: Colors.Text.tertiary) | ||
VStack(spacing: .zero) { | ||
header | ||
|
||
Spacer(minLength: 8) | ||
content | ||
} | ||
.defaultRoundedBackground(with: Colors.Background.action, verticalPadding: .zero) | ||
} | ||
|
||
MarketsPickerView( | ||
marketPriceIntervalType: $viewModel.selectedInterval, | ||
options: viewModel.intervalOptions, | ||
shouldStretchToFill: false, | ||
style: .init(textVerticalPadding: 2), | ||
titleFactory: { $0.tokenDetailsNameLocalized } | ||
) | ||
}) | ||
private var header: some View { | ||
HStack(content: { | ||
Text(Localization.marketsTokenDetailsPricePerformance) | ||
.style(Fonts.Bold.footnote, color: Colors.Text.tertiary) | ||
|
||
VStack(spacing: 12) { | ||
HStack { | ||
Text(Localization.marketsTokenDetailsLow) | ||
.style(Fonts.Regular.footnote, color: Colors.Text.tertiary) | ||
Spacer(minLength: 8) | ||
|
||
Spacer(minLength: 8) | ||
MarketsPickerView( | ||
marketPriceIntervalType: $viewModel.selectedInterval, | ||
options: viewModel.intervalOptions, | ||
shouldStretchToFill: false, | ||
style: .init(textVerticalPadding: 2), | ||
titleFactory: { $0.tokenDetailsNameLocalized } | ||
) | ||
}) | ||
.padding(.top, 12) | ||
.padding(.bottom, 6) | ||
} | ||
|
||
Text(Localization.marketsTokenDetailsHigh) | ||
.style(Fonts.Regular.footnote, color: Colors.Text.tertiary) | ||
} | ||
private var content: some View { | ||
VStack(spacing: 12) { | ||
HStack { | ||
Text(Localization.marketsTokenDetailsLow) | ||
.style(Fonts.Regular.footnote, color: Colors.Text.tertiary) | ||
|
||
ProgressView(value: viewModel.pricePerformanceProgress) | ||
.progressViewStyle(TangemProgressViewStyle( | ||
height: 6, | ||
backgroundColor: Colors.Background.tertiary, | ||
progressColor: Colors.Text.accent | ||
)) | ||
.animation(.default, value: viewModel.pricePerformanceProgress) | ||
Spacer(minLength: 8) | ||
|
||
HStack { | ||
Text(viewModel.lowValue) | ||
.style(Fonts.Regular.callout, color: Colors.Text.primary1) | ||
.animation(.default, value: viewModel.lowValue) | ||
Text(Localization.marketsTokenDetailsHigh) | ||
.style(Fonts.Regular.footnote, color: Colors.Text.tertiary) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. если делать компонент и отдельно в него выносить, то посмотри как сделан There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Да окей посмотрю, попробую переделать, просто вьюха с количеством настроек как у костюма астронавта тоже на мой взгляд странное решение, в DS явно обрисовали 3 вида компонента схожего по смыслу, зачем нам стараться объединить в один, чтобы избежать копиписасты в Text("") чтобы не смущала только копипаста, на мой взгляд тоже так себе, потому как, чтобы внести изменения , надо весь дизайн где юзается вьюха перетестировать, пример как раз шторка с описанием для маркетсов и стейкинга |
||
|
||
ProgressView(value: viewModel.pricePerformanceProgress) | ||
.progressViewStyle(TangemProgressViewStyle( | ||
height: 6, | ||
backgroundColor: Colors.Background.tertiary, | ||
progressColor: Colors.Text.accent | ||
)) | ||
.animation(.default, value: viewModel.pricePerformanceProgress) | ||
|
||
Spacer(minLength: 8) | ||
HStack { | ||
Text(viewModel.lowValue) | ||
.style(Fonts.Regular.callout, color: Colors.Text.primary1) | ||
.animation(.default, value: viewModel.lowValue) | ||
|
||
Spacer(minLength: 8) | ||
|
||
Text(viewModel.highValue) | ||
.style(Fonts.Regular.callout, color: Colors.Text.primary1) | ||
.animation(.default, value: viewModel.highValue) | ||
} | ||
Text(viewModel.highValue) | ||
.style(Fonts.Regular.callout, color: Colors.Text.primary1) | ||
.animation(.default, value: viewModel.highValue) | ||
} | ||
} | ||
.defaultRoundedBackground(with: Colors.Background.action) | ||
.padding(.vertical, 12) | ||
} | ||
} | ||
|
||
|
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.
какой смысл этих правок?
vertiticalPadding = 12
, тут удаляется паддинг, добавляется в заголовок сверху отдельный паддинг, отдельный вLazyVGrid
... по коду не вижу вообще никакого смысла этих правок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.
Если посмотреть отступы в фигме, то сейчас они соответствуют отступам дизайна