Skip to content

Commit

Permalink
use 4 spacing, common protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
ry-itto committed Aug 2, 2023
1 parent 499b2b9 commit bb1d08e
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "error.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
1 change: 1 addition & 0 deletions app-ios/Modules/Sources/Model/ViewModelState.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public protocol ViewModelState: Equatable {}
2 changes: 1 addition & 1 deletion app-ios/Modules/Sources/Timetable/SessionTimeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct SessionTimeView: View {
var endsAt: Date

var body: some View {
VStack {
VStack(spacing: 4) {
Text(formatter.string(from: startsAt))
.foregroundStyle(AssetColors.Surface.onSurface.swiftUIColor)
.font(Font(UIFont.systemFont(ofSize: 16, weight: .bold)))
Expand Down
8 changes: 5 additions & 3 deletions app-ios/Modules/Sources/Timetable/TimetableListItemView.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Assets
import shared
import SwiftUI
import Theme
Expand Down Expand Up @@ -33,7 +34,8 @@ struct TimetableListItemView: View {
if let message = session.message {
Spacer().frame(height: 8)
HStack(spacing: 4) {
Image(systemName: "exclamationmark.circle.fill")
Assets.Icons.error.swiftUIImage
.renderingMode(.template)
Text(message.currentLangTitle)
.font(Font.system(size: 12, weight: .regular, design: .default))
}
Expand All @@ -55,9 +57,9 @@ struct TimetableListItemView: View {
},
label: {
if timetableItemWithFavorite.isFavorited {
Image(systemName: "bookmark.fill")
Assets.Icons.bookmark.swiftUIImage
} else {
Image(systemName: "bookmark")
Assets.Icons.bookmarkBorder.swiftUIImage
}
}
)
Expand Down
4 changes: 2 additions & 2 deletions app-ios/Modules/Sources/Timetable/TimetableViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import Foundation
import Model
import shared

struct TimetableState: Equatable {
struct TimetableState: ViewModelState {
var selectedDay: DroidKaigi2023Day = .day1
var timeGroupTimetableItems: LoadingState<[TimetableTimeGroupItems]> = .initial
}

@MainActor
final class TimetableViewModel: ObservableObject {
@Published var state: TimetableState = .init()
@Published private(set) var state: TimetableState = .init()
private var cachedTimeGroupTimetableItems: [TimetableTimeGroupItems]?

func load() async {
Expand Down

0 comments on commit bb1d08e

Please sign in to comment.