Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,19 @@ struct CurrencySelectionScreen: View {
var body: some View {
NavigationView {
Background(color: .backgroundMain) {
ScrollBox(color: .backgroundMain) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty much removing all of these

List {
Group {
if viewModel.isSearching {
searchingCurrencies()
} else {
recentCurrencies()
otherCurrencies()
}
List {
Group {
if viewModel.isSearching {
searchingCurrencies()
} else {
recentCurrencies()
otherCurrencies()
}
.listRowSeparatorTint(Color.rowSeparator)
}
.listStyle(.grouped)
.scrollContentBackground(.hidden)
.listRowSeparatorTint(Color.rowSeparator)
}
.listStyle(.grouped)
.scrollContentBackground(.hidden)
}
.navigationTitle("Select Currency")
.navigationBarTitleDisplayMode(.inline)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct CurrencySellConfirmationScreen: View {
}

HStack {
Text("1% Free")
Text("1% Fee")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by fix

Spacer()
Text(viewModel.fee.converted.formatted())
.font(.appTextMedium)
Expand Down
44 changes: 21 additions & 23 deletions Flipcash/Core/Screens/Onramp/RegionSelectionScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,29 @@ struct RegionSelectionScreen: View {
NavigationView {
Background(color: .backgroundMain) {
VStack {
ScrollBox(color: .backgroundMain) {
LazyTable(contentPadding: .scrollBox) {
ForEach(regions, id: \.region.rawValue) { regionDescription in
Button {
didSelectRegion(regionDescription.region)
} label: {
HStack(spacing: 15) {
Flag(style: .fiat(regionDescription.region))
Text(regionDescription.localizedName)
.foregroundColor(.textMain)
.lineLimit(1)
.layoutPriority(10)
Spacer()
Text("+\(regionDescription.countryCode)")
.foregroundColor(.textSecondary)
.lineLimit(1)
.layoutPriority(10)
}
.font(.appTextMedium)
LazyTable() {
ForEach(regions, id: \.region.rawValue) { regionDescription in
Button {
didSelectRegion(regionDescription.region)
} label: {
HStack(spacing: 15) {
Flag(style: .fiat(regionDescription.region))
Text(regionDescription.localizedName)
.foregroundColor(.textMain)
.lineLimit(1)
.layoutPriority(10)
Spacer()
Text("+\(regionDescription.countryCode)")
.foregroundColor(.textSecondary)
.lineLimit(1)
.layoutPriority(10)
}
.padding([.top, .bottom], 20)
.padding(.trailing, 20)
.vSeparator(color: .rowSeparator)
.padding(.leading, 20)
.font(.appTextMedium)
}
.padding([.top, .bottom], 20)
.padding(.trailing, 20)
.vSeparator(color: .rowSeparator)
.padding(.leading, 20)
}
}
}
Expand Down
36 changes: 17 additions & 19 deletions Flipcash/Core/Screens/Settings/BetaFlagsScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,26 @@ struct BetaFlagsScreen: View {

var body: some View {
Background(color: .backgroundMain) {
ScrollBox(color: .backgroundMain) {
LazyTable(spacing: 0) {
ForEach(BetaFlags.Option.allCases) { option in
HStack(spacing: 12) {
Toggle(isOn: betaFlags.bindingFor(option: option)) {
VStack(alignment: .leading, spacing: 5) {
Text(option.localizedTitle)
.foregroundColor(.textMain)
.font(.appTextMedium)
Text(option.localizedDescription)
.foregroundColor(.textSecondary)
.font(.appTextHeading)
.multilineTextAlignment(.leading)
}
.padding(.trailing, 20)
LazyTable(spacing: 0) {
ForEach(BetaFlags.Option.allCases) { option in
HStack(spacing: 12) {
Toggle(isOn: betaFlags.bindingFor(option: option)) {
VStack(alignment: .leading, spacing: 5) {
Text(option.localizedTitle)
.foregroundColor(.textMain)
.font(.appTextMedium)
Text(option.localizedDescription)
.foregroundColor(.textSecondary)
.font(.appTextHeading)
.multilineTextAlignment(.leading)
}
.tint(.textSuccess)
.padding([.top, .bottom], 10)
.padding(.trailing, 20)
}
.padding(20)
.vSeparator(color: .rowSeparator, position: .bottom)
.tint(.textSuccess)
.padding([.top, .bottom], 10)
}
.padding(20)
.vSeparator(color: .rowSeparator, position: .bottom)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public struct ChartRangePicker: View {
HStack(spacing: 0) {
ForEach(ChartRange.allCases) { range in
Button {
withAnimation(.snappy(duration: 0.25)) {
withAnimation(.snappy(duration: 0.15)) {
selectedRange = range
}
} label: {
Expand Down
18 changes: 7 additions & 11 deletions FlipcashUI/Sources/FlipcashUI/Views/Chart/StockChart.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public struct StockChart: View {
}
self.dateFormatter = dateFormatter ?? { date in
if Calendar.current.isDateInToday(date) {
return date.formatted(date: .omitted, time: .standard)
return date.formatted(date: .omitted, time: .shortened)
} else {
return date.formatted(date: .abbreviated, time: .omitted)
}
Expand All @@ -60,7 +60,7 @@ public struct StockChart: View {
selectedRange: Binding(
get: { viewModel.selectedRange },
set: { range in
withAnimation(.easeInOut(duration: 0.35)) {
withAnimation {
viewModel.selectRange(range)
}
}
Expand Down Expand Up @@ -93,6 +93,10 @@ public struct StockChart: View {
.opacity(0.2)
}
}
.mask {
RoundedRectangle(cornerRadius: 4)
.transition(.crossFade)
}
}
.frame(maxWidth: .infinity, alignment: .leading)
.animation(.snappy, value: viewModel.displayValue)
Expand Down Expand Up @@ -146,6 +150,7 @@ public struct StockChart: View {
selectedRange: .all,
)
.padding()
.preferredColorScheme(.dark)
}

#Preview("Negative Trend") {
Expand All @@ -155,14 +160,5 @@ public struct StockChart: View {
selectedRange: .month,
)
.padding()
}

#Preview("Dark Mode") {
StockChart(
startValue: 50,
endValue: 85,
selectedRange: .week,
)
.padding()
.preferredColorScheme(.dark)
}