Skip to content
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] 🔧 The numerical value where spacing is currently assigned is replaced by the defined Spacing value. #1204

Merged
merged 1 commit into from
Sep 12, 2023
Merged
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
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
.font(Font.custom(FontAssets.Montserrat.medium, size: 16))
.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 @@ -22,7 +22,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)
.font(Font.custom(FontAssets.Montserrat.semiBold, size: 14))
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")
.font(Font.custom(FontAssets.Montserrat.medium, size: 24))
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")
.font(Font.custom(FontAssets.Montserrat.medium, size: 24))
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
10 changes: 5 additions & 5 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 @@ -27,7 +27,7 @@ struct SideEventRow: View {
.font(Font.custom(FontAssets.Montserrat.medium, size: 14))
}
// Date
HStack(alignment: .center, spacing: 4) {
HStack(alignment: .center, spacing: SpacingTokens.xxs) {
Assets.Icons.accessTime.swiftUIImage
.frame(width: 16, height: 16)

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)
.font(Font.custom(FontAssets.Montserrat.semiBold, size: 14))
.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)
.font(Font.custom(FontAssets.Montserrat.semiBold, size: 14))
.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)
.font(Font.custom(FontAssets.Montserrat.medium, size: 22))
.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
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
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)
.foregroundStyle(AssetColors.Surface.onSurface.swiftUIColor)
.font(Font.custom(FontAssets.Montserrat.medium, size: 16))
Expand Down
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
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
Loading