Skip to content

Commit

Permalink
Merge pull request #14 from mmmmmob/user-journal
Browse files Browse the repository at this point in the history
style: revise header summary with SF Symbols
  • Loading branch information
mmmmmob authored Jun 4, 2024
2 parents 38bf37e + 29535df commit 922abec
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions Lotto Journal/Views/MyLotteryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct MyLotteryView: View {
if date.lotteries.count > 0 {
Section {
ForEach(date.lotteries) { lottery in
HStack(alignment: .lastTextBaseline) {
HStack(alignment: .center) {
HStack {
Text(lottery.number)
.font(.system(.headline, design: .monospaced, weight: .semibold))
Expand All @@ -56,6 +56,10 @@ struct MyLotteryView: View {
.font(.system(.subheadline, weight: .light))
}
}
.listRowInsets(.init(top: 10,
leading: 25,
bottom: 10,
trailing: 25))
}
.onDelete(perform: { indexSet in
indexSet.forEach { index in
Expand All @@ -64,7 +68,7 @@ struct MyLotteryView: View {
}
})
} header: {
HStack(alignment: .firstTextBaseline) {
HStack(alignment: .lastTextBaseline) {
if let latestResultDate = firstAPICall.result.latestResultDate.toDate() {
let upcomingDate = latestResultDate.upcomingDrawDate
if date.date == upcomingDate {
Expand All @@ -78,12 +82,15 @@ struct MyLotteryView: View {
Text(date.date.fullStringDate) // display fullStringDate while determine date from API
}
Spacer()
HStack(alignment: .center) {
Text("฿\(date.totalInvestment.delimiter)")
Text(":")
HStack {
Text("฿\(date.totalWon.delimiter)")
Text("\(Image(systemName: "checkmark.seal"))")
Text("|")
.font(.system(.caption, design: .default, weight: .ultraLight))
Text("฿\(date.totalInvestment.delimiter)")
Text("\(Image(systemName: "basket"))")
}
.font(.system(.callout, design: .default, weight: .semibold))
.font(.system(.caption, design: .default, weight: .regular))
}
}
.headerProminence(.increased)
Expand All @@ -92,7 +99,7 @@ struct MyLotteryView: View {
}
}
}
.listStyle(.grouped)
.listStyle(.plain)
.navigationTitle("My Lotter\(lotteries.count > 1 ? "ies" : "y")")
.toolbar {
if !lotteries.isEmpty {
Expand Down

0 comments on commit 922abec

Please sign in to comment.