Skip to content

Commit

Permalink
Merge branch 'main' into nfc-reader
Browse files Browse the repository at this point in the history
  • Loading branch information
treastrain authored Sep 12, 2023
2 parents 097adec + 45d39c5 commit b94b0f8
Show file tree
Hide file tree
Showing 20 changed files with 52 additions and 47 deletions.
4 changes: 2 additions & 2 deletions app-ios/Modules/Sources/About/AboutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public struct AboutView<ContributorView: View, StaffView: View, SponsorView: Vie
.textStyle(TypographyTokens.bodyLarge)
.frame(maxWidth: .infinity, alignment: .leading)
Spacer().frame(height: 12)
VStack(alignment: .leading, spacing: 12) {
VStack(alignment: .leading, spacing: SpacingTokens.s) {
InformationRow(
icon: Assets.Icons.schedule.swiftUIImage,
title: L10n.About.dateTitle,
Expand Down Expand Up @@ -111,7 +111,7 @@ public struct AboutView<ContributorView: View, StaffView: View, SponsorView: Vie
)
}
Divider()
HStack(spacing: 12) {
HStack(spacing: SpacingTokens.s) {
SafariLink(url: .youtube) {
Assets.Icons.youtube.swiftUIImage
}
Expand Down
2 changes: 1 addition & 1 deletion app-ios/Modules/Sources/About/ListTile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ struct ListTile: View {
let title: String

var body: some View {
HStack(spacing: 12) {
HStack(spacing: SpacingTokens.s) {
icon
.renderingMode(.template)
.foregroundStyle(AssetColors.Surface.onSurfaceVariant.swiftUIColor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public struct AchievementsView: View {
NavigationStack {
ScrollView {
ZStack {
VStack(spacing: 24) {
VStack(spacing: SpacingTokens.xl) {
Text(state.description)
.font(Font.system(size: 16))
.foregroundStyle(AssetColors.Surface.onSurfaceVariant.swiftUIColor)
Expand Down
2 changes: 1 addition & 1 deletion app-ios/Modules/Sources/Component/InformationRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public struct InformationRow: View {
public var body: some View {
HStack {
icon
HStack(spacing: 12) {
HStack(spacing: SpacingTokens.s) {
Text(title)
.textStyle(TypographyTokens.labelLarge)
HStack {
Expand Down
2 changes: 1 addition & 1 deletion app-ios/Modules/Sources/Component/PersonLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public struct PersonLabel: View {
}

public var body: some View {
HStack(alignment: .center, spacing: 24) {
HStack(alignment: .center, spacing: SpacingTokens.xl) {
HStack(spacing: -8) {
CacheAsyncImage(url: URL(string: iconUrlString)) { image in
image.resizable()
Expand Down
3 changes: 2 additions & 1 deletion app-ios/Modules/Sources/Contributor/ContributorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Dependencies
import Model
import shared
import SwiftUI
import Theme

public struct ContributorView: View {
@State var presentingURL: IdentifiableURL?
Expand Down Expand Up @@ -65,7 +66,7 @@ struct ContributorSwiftUIView: View {
EmptyView()
case .loaded(let contributors):
ScrollView {
LazyVStack(spacing: 20) {
LazyVStack(spacing: SpacingTokens.l) {
ForEach(contributors, id: \.id) { contributor in
Button {
if let profileUrl = contributor.profileUrl {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct FloorMapFooterSegmentedButton: View {
)
.rotationEffect(.degrees(180))
.overlay(alignment: .center) {
HStack(spacing: 8) {
HStack(spacing: SpacingTokens.xs) {
if floor == .ground {
Assets.Icons.checkmark.swiftUIImage
}
Expand All @@ -42,7 +42,7 @@ struct FloorMapFooterSegmentedButton: View {
foregroundColor: floor == .basement ? AssetColors.Secondary.secondaryContainer.swiftUIColor : AssetColors.floorButtonBg.swiftUIColor
)
.overlay(alignment: .center) {
HStack(spacing: 8) {
HStack(spacing: SpacingTokens.xs) {
if floor == .basement {
Assets.Icons.checkmark.swiftUIImage
}
Expand Down
10 changes: 5 additions & 5 deletions app-ios/Modules/Sources/FloorMap/FloorMapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public struct FloorMapView: View {

/// first floor map
private func groundMapView(sideEvents: [SideEvent]) -> some View {
VStack(alignment: .leading, spacing: 24) {
VStack(alignment: .leading, spacing: 8) {
VStack(alignment: .leading, spacing: SpacingTokens.xl) {
VStack(alignment: .leading, spacing: SpacingTokens.xs) {
Text("1F")
.textStyle(TypographyTokens.headlineSmall)
Assets.Images.floor1F.swiftUIImage
Expand All @@ -61,8 +61,8 @@ public struct FloorMapView: View {

/// basement first floor map
private func basementMapView(sideEvents: [SideEvent]) -> some View {
VStack(alignment: .leading, spacing: 24) {
VStack(alignment: .leading, spacing: 8) {
VStack(alignment: .leading, spacing: SpacingTokens.xl) {
VStack(alignment: .leading, spacing: SpacingTokens.xs) {
Text("B1F")
.textStyle(TypographyTokens.headlineSmall)
Assets.Images.floorB1F.swiftUIImage
Expand All @@ -77,7 +77,7 @@ public struct FloorMapView: View {

/// Side Events List
private func sideEventList(sideEvents: [SideEvent]) -> some View {
LazyVStack(spacing: 16) {
LazyVStack(spacing: SpacingTokens.m) {
ForEach(0..<sideEvents.count, id: \.self) { index in
SideEventRow(sideEvent: sideEvents[index])

Expand Down
30 changes: 14 additions & 16 deletions app-ios/Modules/Sources/FloorMap/SideEventRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ struct SideEventRow: View {
var sideEvent: SideEvent

var body: some View {
HStack(alignment: .top, spacing: 12) {
VStack(alignment: .leading, spacing: 8) {
VStack(alignment: .leading, spacing: 4) {
HStack(alignment: .top, spacing: SpacingTokens.s) {
VStack(alignment: .leading, spacing: SpacingTokens.xs) {
VStack(alignment: .leading, spacing: SpacingTokens.xxs) {
// Icon & Title
HStack(alignment: .top, spacing: 8) {
HStack(alignment: .top, spacing: SpacingTokens.xs) {
sideEvent.icon
.renderingMode(.template)
.frame(width: 16, height: 16)
Expand All @@ -26,7 +26,7 @@ struct SideEventRow: View {
.textStyle(TypographyTokens.bodyMedium)
}
// Date
HStack(alignment: .center, spacing: 4) {
HStack(alignment: .center, spacing: SpacingTokens.xxs) {
Assets.Icons.accessTime.swiftUIImage
.frame(width: 16, height: 16)

Expand All @@ -39,24 +39,22 @@ struct SideEventRow: View {
Spacer(minLength: 0)

// Image
Group {
if let imageLink = sideEvent.imageLink, let imageUrl = URL(string: imageLink) {
if let imageLink = sideEvent.imageLink, let imageUrl = URL(string: imageLink) {
Group {
CacheAsyncImage(url: imageUrl) { image in
image.resizable()
} placeholder: {
Color.gray
}
} else {
Color.gray
}
.frame(width: 88, height: 88)
.scaledToFill()
.clipShape(RoundedRectangle(cornerRadius: 12))
.overlay(
RoundedRectangle(cornerRadius: 12)
.stroke(AssetColors.Outline.outline.swiftUIColor, lineWidth: 1)
)
}
.frame(width: 88, height: 88)
.scaledToFill()
.clipShape(RoundedRectangle(cornerRadius: 12))
.overlay(
RoundedRectangle(cornerRadius: 12)
.stroke(AssetColors.Outline.outline.swiftUIColor, lineWidth: 1)
)
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions app-ios/Modules/Sources/Session/SessionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public struct SessionView: View {
.padding(.horizontal, 16)

if let session = viewModel.timetableItem as? TimetableItem.Session {
VStack(alignment: .leading, spacing: 16) {
VStack(alignment: .leading, spacing: SpacingTokens.m) {
Text(.init(session.description_.currentLangTitle))
.textSelection(.enabled)
.lineLimit(isDescriptionExpanded ? nil : 5)
Expand Down Expand Up @@ -96,7 +96,7 @@ public struct SessionView: View {
Divider()
}

VStack(alignment: .leading, spacing: 16) {
VStack(alignment: .leading, spacing: SpacingTokens.m) {
Text(L10n.Session.targetAudience)
.textStyle(TypographyTokens.titleLarge)
.foregroundStyle(AssetColors.Surface.onSurfaceVariant.swiftUIColor)
Expand All @@ -109,14 +109,14 @@ public struct SessionView: View {

Divider()

VStack(alignment: .leading, spacing: 16) {
VStack(alignment: .leading, spacing: SpacingTokens.m) {
Text(L10n.Session.speakers)
.textStyle(TypographyTokens.titleLarge)
.foregroundStyle(AssetColors.Surface.onSurfaceVariant.swiftUIColor)

VStack(alignment: .leading, spacing: 8) {
VStack(alignment: .leading, spacing: SpacingTokens.xs) {
ForEach(viewModel.timetableItem.speakers, id: \.id) { speaker in
HStack(spacing: 24) {
HStack(spacing: SpacingTokens.xl) {
CacheAsyncImage(url: URL(string: speaker.iconUrl)) { image in
image.resizable()
} placeholder: {
Expand Down
4 changes: 2 additions & 2 deletions app-ios/Modules/Sources/Sponsor/SponsorGridView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ struct SponsorGridView: View {
var action: (Sponsor) -> Void

var body: some View {
VStack(alignment: .leading, spacing: 16) {
VStack(alignment: .leading, spacing: SpacingTokens.m) {
Text(title)
.textStyle(TypographyTokens.titleMedium)
.foregroundStyle(AssetColors.Surface.onSurface.swiftUIColor)
LazyVGrid(columns: Array(repeating: GridItem(spacing: 16), count: columns), spacing: 16) {
LazyVGrid(columns: Array(repeating: GridItem(spacing: SpacingTokens.m), count: columns), spacing: SpacingTokens.m) {
ForEach(sponsors) { sponsor in
SponsorItemView(sponsor: sponsor) {
action(sponsor)
Expand Down
2 changes: 1 addition & 1 deletion app-ios/Modules/Sources/Sponsor/SponsorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public struct SponsorView: View {
}
case .loaded(let planGroupedSponsors):
ScrollView {
LazyVStack(spacing: 24) {
LazyVStack(spacing: SpacingTokens.xl) {
ForEach(planGroupedSponsors.keys.sorted(by: {
$0.ordinal < $1.ordinal
}), id: \.self) { plan in
Expand Down
3 changes: 2 additions & 1 deletion app-ios/Modules/Sources/Staff/StaffView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Component
import Model
import shared
import SwiftUI
import Theme

public struct StaffView: View {
@State var presentingURL: IdentifiableURL?
Expand All @@ -21,7 +22,7 @@ public struct StaffView: View {
EmptyView()
case .loaded(let staffs):
ScrollView {
LazyVStack(spacing: 20) {
LazyVStack(spacing: SpacingTokens.l) {
ForEach(staffs, id: \.id) { staff in
Button {
presentingURL = IdentifiableURL(string: staff.profileUrl)
Expand Down
2 changes: 1 addition & 1 deletion app-ios/Modules/Sources/Timetable/PersonLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ struct PersonLabel: View {
let speaker: TimetableSpeaker

var body: some View {
HStack(alignment: .center, spacing: 8) {
HStack(alignment: .center, spacing: SpacingTokens.xs) {
CacheAsyncImage(url: URL(string: speaker.iconUrl)) { image in
image.resizable()
} placeholder: {
Expand Down
2 changes: 1 addition & 1 deletion app-ios/Modules/Sources/Timetable/Search/SearchView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ private struct SearchEmptyView: View {
let inputText: String

var body: some View {
VStack(spacing: 20) {
VStack(spacing: SpacingTokens.l) {
Assets.Images.onsenBucket.swiftUIImage
.resizable()
.frame(width: 36, height: 36)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ final class SearchViewModel: ObservableObject {
return
}
let timetableContents = cachedTimetable.filtered(filters: state.filters).contents
let uniqueLanguages = {
var set: Set<String> = []
return cachedTimetable.languages.filter { set.insert($0.langOfSpeaker).inserted }
}()
let timetableTimeGroupItems = timetableContents
.map { content in
let items = timetableContents
Expand All @@ -92,7 +96,7 @@ final class SearchViewModel: ObservableObject {
categories: cachedTimetable.categories,
sessionTypes: cachedTimetable.sessionTypes,
rooms: cachedTimetable.rooms,
languages: cachedTimetable.languages,
languages: uniqueLanguages,
timeGroupTimetableItems: distinctedTimetableTimeGroupItems
)
)
Expand Down
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 @@ -7,7 +7,7 @@ struct SessionTimeView: View {
var endsTimeString: String

var body: some View {
VStack(spacing: 4) {
VStack(spacing: SpacingTokens.xxs) {
Text(startsTimeString)
.textStyle(TypographyTokens.titleMedium)
.foregroundStyle(AssetColors.Surface.onSurface.swiftUIColor)
Expand Down
2 changes: 1 addition & 1 deletion app-ios/Modules/Sources/Timetable/TimetableDayHeader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct TimetableDayHeader: View {
var body: some View {
ZStack {
AssetColors.Surface.surface.swiftUIColor
HStack(spacing: 8) {
HStack(spacing: SpacingTokens.xs) {
ForEach(
[DroidKaigi2023Day].fromKotlinArray(DroidKaigi2023Day.values()),
id: \.ordinal
Expand Down
4 changes: 2 additions & 2 deletions app-ios/Modules/Sources/Timetable/TimetableListItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct TimetableListItemView: View {
VStack(alignment: .leading, spacing: 0) {
Spacer().frame(height: 16)
// TODO apply like flexbox layout
HStack(spacing: 4) {
HStack(spacing: SpacingTokens.xxs) {
SessionTag(
timetableItem.room.name.currentLangTitle,
labelColor: AssetColors.Custom.hallText.swiftUIColor,
Expand All @@ -39,7 +39,7 @@ struct TimetableListItemView: View {
if let session = timetableItem as? TimetableItem.Session {
if let message = session.message {
Spacer().frame(height: 8)
HStack(spacing: 4) {
HStack(spacing: SpacingTokens.xxs) {
Assets.Icons.error.swiftUIImage
.renderingMode(.template)
Text(message.currentLangTitle)
Expand Down
3 changes: 2 additions & 1 deletion app-ios/Modules/Sources/Timetable/TimetableListView.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Model
import shared
import SwiftUI
import Theme

struct TimetableListView: View {
let timetableTimeGroupItems: [TimetableTimeGroupItems]
Expand All @@ -13,7 +14,7 @@ struct TimetableListView: View {
if timetableTimeGroupItem.items.isEmpty {
EmptyView()
} else {
HStack(alignment: .top, spacing: 16) {
HStack(alignment: .top, spacing: SpacingTokens.m) {
SessionTimeView(
startsTimeString: timetableTimeGroupItem.startsTimeString,
endsTimeString: timetableTimeGroupItem.endsTimeString
Expand Down

0 comments on commit b94b0f8

Please sign in to comment.