diff --git a/NativeAppTemplate/Constants.swift b/NativeAppTemplate/Constants.swift index 809e144..df8461f 100644 --- a/NativeAppTemplate/Constants.swift +++ b/NativeAppTemplate/Constants.swift @@ -3,6 +3,7 @@ // NativeAppTemplate // +import SwiftUI import typealias Foundation.TimeInterval extension Int { @@ -10,6 +11,87 @@ extension Int { static let invitationCodeLength: Int = 6 } +// MARK: - Design Constants + +enum NativeAppTemplateConstants { + // MARK: - Spacing + + enum Spacing { + /// 4pt - Micro spacing, tight padding + static let xxxs: CGFloat = 4 + + /// 8pt - Minimal spacing, compact layouts + static let xxs: CGFloat = 8 + + /// 12pt - Small spacing, close elements + static let xs: CGFloat = 12 + + /// 16pt - Base spacing unit, standard padding + static let sm: CGFloat = 16 + + /// 24pt - Medium spacing, section separation + static let md: CGFloat = 24 + + /// 32pt - Large spacing, major sections + static let lg: CGFloat = 32 + + /// 48pt - Extra large spacing, screen margins + static let xl: CGFloat = 48 + + /// 64pt - Very large spacing, major divisions + static let xxl: CGFloat = 64 + + /// 96pt - Dramatic spacing, large separations + static let xxxl: CGFloat = 96 + + /// 128pt - Massive spacing, hero sections + static let xxxxl: CGFloat = 128 + } + + // MARK: - Animation Durations + + enum Animation { + /// 0.15s - Fast animations, micro-interactions + static let fast: Double = 0.15 + + /// 0.3s - Standard animations, most UI transitions + static let standard: Double = 0.3 + } + + // MARK: - Glass + + enum Glass { + static let borderOpacity: Double = 0.2 + static let shadowOpacity: Double = 0.15 + } + + // MARK: - Layout + + enum Layout { + static let borderWidth: CGFloat = 1 + static let shadowRadius: CGFloat = 8 + } + + // MARK: - Corner Radius + + enum CornerRadius { + /// 4pt - Minimal rounding + static let xs: CGFloat = 4 + + /// 8pt - Small rounding, buttons + static let sm: CGFloat = 8 + + /// 12pt - Medium rounding, cards (default) + static let md: CGFloat = 12 + + /// 16pt - Large rounding, prominent cards + static let lg: CGFloat = 16 + + /// 24pt - Extra large rounding, hero elements + static let xl: CGFloat = 24 + } +} + extension String { #if DEBUG // static let scheme: String = "http" diff --git a/NativeAppTemplate/UI/App Root/AcceptPrivacyView.swift b/NativeAppTemplate/UI/App Root/AcceptPrivacyView.swift index f35e15d..e553299 100644 --- a/NativeAppTemplate/UI/App Root/AcceptPrivacyView.swift +++ b/NativeAppTemplate/UI/App Root/AcceptPrivacyView.swift @@ -44,12 +44,12 @@ private extension AcceptPrivacyView { VStack { let agreement = "Please accept updated [\(String.privacyPolicy)](\(String.privacyPolicyUrl))." Text(.init(agreement)) - .padding(.top, 48) + .padding(.top, NativeAppTemplateConstants.Spacing.xl) MainButtonView(title: String.accept, type: .primary(withArrow: false)) { viewModel.updateConfirmedPrivacyVersion() } - .padding(24) + .padding(NativeAppTemplateConstants.Spacing.md) Spacer() } diff --git a/NativeAppTemplate/UI/App Root/AcceptTermsView.swift b/NativeAppTemplate/UI/App Root/AcceptTermsView.swift index 4270a0a..a0abb06 100644 --- a/NativeAppTemplate/UI/App Root/AcceptTermsView.swift +++ b/NativeAppTemplate/UI/App Root/AcceptTermsView.swift @@ -44,12 +44,12 @@ private extension AcceptTermsView { VStack { let agreement = "Please accept updated [\(String.termsOfUse)](\(String.termsOfUseUrl))." Text(.init(agreement)) - .padding(.top, 48) + .padding(.top, NativeAppTemplateConstants.Spacing.xl) MainButtonView(title: String.accept, type: .primary(withArrow: false)) { viewModel.updateConfirmedTermsVersion() } - .padding(24) + .padding(NativeAppTemplateConstants.Spacing.md) Spacer() } diff --git a/NativeAppTemplate/UI/App Root/OnboardingView.swift b/NativeAppTemplate/UI/App Root/OnboardingView.swift index e1710e9..02cd4d9 100644 --- a/NativeAppTemplate/UI/App Root/OnboardingView.swift +++ b/NativeAppTemplate/UI/App Root/OnboardingView.swift @@ -71,7 +71,7 @@ private extension OnboardingView { Image(image) .resizable() .aspectRatio(contentMode: .fit) - .padding(.top, 24) + .padding(.top, NativeAppTemplateConstants.Spacing.md) .padding(.bottom, isPortraitImage ? 0 : 192) ZStack(alignment: .top) { diff --git a/NativeAppTemplate/UI/App Root/SignUpOrSignInView.swift b/NativeAppTemplate/UI/App Root/SignUpOrSignInView.swift index e4866c7..3d5dbe9 100644 --- a/NativeAppTemplate/UI/App Root/SignUpOrSignInView.swift +++ b/NativeAppTemplate/UI/App Root/SignUpOrSignInView.swift @@ -38,8 +38,8 @@ private extension SignUpOrSignInView { "[\(String.termsOfUse)](\(String.termsOfUseUrl)) " + "and [\(String.privacyPolicy)](\(String.privacyPolicyUrl))." Text(.init(agreement)) - .padding(.top, 16) - .padding(.horizontal, 24) + .padding(.top, NativeAppTemplateConstants.Spacing.sm) + .padding(.horizontal, NativeAppTemplateConstants.Spacing.md) VStack { NavigationLink(destination: SignUpView( @@ -49,12 +49,12 @@ private extension SignUpOrSignInView { ) )) { MainButtonImageView(title: String.signUpForAnAccount, type: .primary(withArrow: false)) - .padding(.top, 8) - .padding(.horizontal, 24) + .padding(.top, NativeAppTemplateConstants.Spacing.xxs) + .padding(.horizontal, NativeAppTemplateConstants.Spacing.md) } Text(verbatim: "or") - .padding(.top, 8) + .padding(.top, NativeAppTemplateConstants.Spacing.xxs) NavigationLink(destination: SignInEmailAndPasswordView( viewModel: SignInEmailAndPasswordViewModel( @@ -65,9 +65,9 @@ private extension SignUpOrSignInView { Text(String.signInToYourAccount) .font(.uiLabel) } - .padding(.top, 8) + .padding(.top, NativeAppTemplateConstants.Spacing.xxs) } - .padding(.top, 4) + .padding(.top, NativeAppTemplateConstants.Spacing.xxxs) Spacer() } diff --git a/NativeAppTemplate/UI/App Root/SnackbarView.swift b/NativeAppTemplate/UI/App Root/SnackbarView.swift index 39bd881..c3c780c 100644 --- a/NativeAppTemplate/UI/App Root/SnackbarView.swift +++ b/NativeAppTemplate/UI/App Root/SnackbarView.swift @@ -49,12 +49,12 @@ struct SnackbarView: View { } label: { Image(systemName: "xmark") .resizable() - .frame(width: 16, height: 16) + .frame(width: NativeAppTemplateConstants.Spacing.sm, height: NativeAppTemplateConstants.Spacing.sm) } .foregroundStyle(.snackText) } - .padding(.vertical, 16.0) - .padding(.horizontal, 24.0) + .padding(.vertical, NativeAppTemplateConstants.Spacing.sm) + .padding(.horizontal, NativeAppTemplateConstants.Spacing.md) .background(state.status.color) .overlay( Rectangle().frame(width: nil, height: 1, alignment: .top).foregroundColor(.lightestAccent), diff --git a/NativeAppTemplate/UI/Empty States/ErrorView.swift b/NativeAppTemplate/UI/Empty States/ErrorView.swift index 7c362ef..131b9af 100644 --- a/NativeAppTemplate/UI/Empty States/ErrorView.swift +++ b/NativeAppTemplate/UI/Empty States/ErrorView.swift @@ -35,7 +35,7 @@ extension ErrorView: View { Image(systemName: "exclamationmark.triangle") .resizable() .aspectRatio(contentMode: .fit) - .frame(width: 96) + .frame(width: NativeAppTemplateConstants.Spacing.xxxl) .padding() .foregroundStyle(.titleText) @@ -48,14 +48,14 @@ extension ErrorView: View { .font(.uiLabel) .foregroundStyle(.contentText) .multilineTextAlignment(.center) - .padding(.top, 4) + .padding(.top, NativeAppTemplateConstants.Spacing.xxxs) MainButtonView( title: buttonTitle, type: .primary(withArrow: false), callback: buttonAction ) - .padding(32) + .padding(NativeAppTemplateConstants.Spacing.lg) Spacer() } diff --git a/NativeAppTemplate/UI/Empty States/LoadingView.swift b/NativeAppTemplate/UI/Empty States/LoadingView.swift index a39a8b1..324eff9 100644 --- a/NativeAppTemplate/UI/Empty States/LoadingView.swift +++ b/NativeAppTemplate/UI/Empty States/LoadingView.swift @@ -9,7 +9,7 @@ struct LoadingView: View { var body: some View { VStack { ProgressView().scaleEffect(1.0, anchor: .center) - .padding([.bottom], 12) + .padding([.bottom], NativeAppTemplateConstants.Spacing.xs) Text(String.loading) .font(.uiHeadline) } diff --git a/NativeAppTemplate/UI/Empty States/NeedAppUpdatesView.swift b/NativeAppTemplate/UI/Empty States/NeedAppUpdatesView.swift index 0ac6a6a..fff7670 100644 --- a/NativeAppTemplate/UI/Empty States/NeedAppUpdatesView.swift +++ b/NativeAppTemplate/UI/Empty States/NeedAppUpdatesView.swift @@ -13,7 +13,7 @@ struct NeedAppUpdatesView: View { Image(systemName: "exclamationmark.arrow.circlepath") .resizable() .aspectRatio(contentMode: .fit) - .frame(width: 96) + .frame(width: NativeAppTemplateConstants.Spacing.xxxl) .foregroundStyle(.titleText) .padding() Text(String.updateApp) @@ -22,7 +22,7 @@ struct NeedAppUpdatesView: View { .padding(.top) Text(String.installNewVersionApp) .foregroundStyle(.contentText) - .padding(.top, 4) + .padding(.top, NativeAppTemplateConstants.Spacing.xxxs) Button { openURL(URL(string: String.appStoreUrl)!) } label: { diff --git a/NativeAppTemplate/UI/Empty States/OfflineView.swift b/NativeAppTemplate/UI/Empty States/OfflineView.swift index cf0cbe7..9afb6d1 100644 --- a/NativeAppTemplate/UI/Empty States/OfflineView.swift +++ b/NativeAppTemplate/UI/Empty States/OfflineView.swift @@ -11,7 +11,7 @@ struct OfflineView: View { Image(systemName: "wifi.slash") .resizable() .aspectRatio(contentMode: .fit) - .frame(width: 96) + .frame(width: NativeAppTemplateConstants.Spacing.xxxl) .padding() .foregroundStyle(.titleText) @@ -23,11 +23,11 @@ struct OfflineView: View { Text(String.checkInternetConnection) .font(.uiLabel) - .lineSpacing(8) + .lineSpacing(NativeAppTemplateConstants.Spacing.xxs) .foregroundStyle(.contentText) .multilineTextAlignment(.center) - .padding(.top, 4) - .padding(.horizontal, 32) + .padding(.top, NativeAppTemplateConstants.Spacing.xxxs) + .padding(.horizontal, NativeAppTemplateConstants.Spacing.lg) } .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color.backgroundColor) diff --git a/NativeAppTemplate/UI/Scan/CompleteScanResultView.swift b/NativeAppTemplate/UI/Scan/CompleteScanResultView.swift index e8c5840..70aacac 100644 --- a/NativeAppTemplate/UI/Scan/CompleteScanResultView.swift +++ b/NativeAppTemplate/UI/Scan/CompleteScanResultView.swift @@ -57,7 +57,7 @@ private extension CompleteScanResultView { .font(.uiFootnote) .foregroundStyle(.successSecondaryForeground) } - .padding(.top, 8) + .padding(.top, NativeAppTemplateConstants.Spacing.xxs) } .backgroundStyle(.successBackground) } diff --git a/NativeAppTemplate/UI/Scan/ScanView.swift b/NativeAppTemplate/UI/Scan/ScanView.swift index c310e46..5f0cd0d 100644 --- a/NativeAppTemplate/UI/Scan/ScanView.swift +++ b/NativeAppTemplate/UI/Scan/ScanView.swift @@ -85,7 +85,7 @@ private extension ScanView { var scanView: some View { ScrollView { - VStack(spacing: 64) { + VStack(spacing: NativeAppTemplateConstants.Spacing.xxl) { switch viewModel.scanType { case .completeScan: if !viewModel.isShowingResetConfirmationDialog { diff --git a/NativeAppTemplate/UI/Scan/ShowTagInfoScanResultView.swift b/NativeAppTemplate/UI/Scan/ShowTagInfoScanResultView.swift index 2fbbcbb..e917fc1 100644 --- a/NativeAppTemplate/UI/Scan/ShowTagInfoScanResultView.swift +++ b/NativeAppTemplate/UI/Scan/ShowTagInfoScanResultView.swift @@ -56,7 +56,11 @@ private extension ShowTagInfoScanResultView { .foregroundStyle(.coloredSecondaryFootnoteText) } - Grid(alignment: .leadingFirstTextBaseline, horizontalSpacing: 12, verticalSpacing: 8) { + Grid( + alignment: .leadingFirstTextBaseline, + horizontalSpacing: NativeAppTemplateConstants.Spacing.xs, + verticalSpacing: NativeAppTemplateConstants.Spacing.xxs + ) { GridRow { Image(systemName: "storefront") .frame(width: imageSize, height: imageSize) diff --git a/NativeAppTemplate/UI/Shared/MainButtonView.swift b/NativeAppTemplate/UI/Shared/MainButtonView.swift index 3a61651..8a633fe 100644 --- a/NativeAppTemplate/UI/Shared/MainButtonView.swift +++ b/NativeAppTemplate/UI/Shared/MainButtonView.swift @@ -72,7 +72,7 @@ struct MainButtonView: View { Text(title) .font(.uiButtonLabelLarge) .foregroundStyle(type.color) - .padding(16) + .padding(NativeAppTemplateConstants.Spacing.sm) // If commenting out below and select max large font size on settings accessibility, you will // not be enable to tap Scan button on Scan tab. // .background(GeometryReader { proxy in @@ -92,15 +92,15 @@ struct MainButtonView: View { .foregroundStyle(type.color) .background( Color.white - .cornerRadius(8) - .padding(12) + .cornerRadius(NativeAppTemplateConstants.CornerRadius.sm) + .padding(NativeAppTemplateConstants.Spacing.xs) ) } } } .frame(height: height) .background( - RoundedRectangle(cornerRadius: 8) + RoundedRectangle(cornerRadius: NativeAppTemplateConstants.CornerRadius.sm) .stroke(type.color, lineWidth: 2) ) .onPreferenceChange(SizeKey.self) { size in @@ -133,7 +133,7 @@ struct MainButtonImageView: View { Text(title) .font(.uiButtonLabelLarge) .foregroundStyle(type.color) - .padding(16) + .padding(NativeAppTemplateConstants.Spacing.sm) .background(GeometryReader { proxy in Color.clear.preference(key: SizeKey.self, value: proxy.size) }) @@ -151,15 +151,15 @@ struct MainButtonImageView: View { .foregroundStyle(type.color) .background( Color.white - .cornerRadius(8) - .padding(12) + .cornerRadius(NativeAppTemplateConstants.CornerRadius.sm) + .padding(NativeAppTemplateConstants.Spacing.xs) ) } } } .frame(height: height) .background( - RoundedRectangle(cornerRadius: 8) + RoundedRectangle(cornerRadius: NativeAppTemplateConstants.CornerRadius.sm) .stroke(type.color, lineWidth: 2) ) .onPreferenceChange(SizeKey.self) { size in @@ -174,7 +174,7 @@ struct MainButtonImageView: View { struct PrimaryButtonView_Previews: PreviewProvider { static var previews: some View { ScrollView { - VStack(spacing: 24) { + VStack(spacing: NativeAppTemplateConstants.Spacing.md) { MainButtonView(title: "Got It!", type: .primary(withArrow: false), callback: {}) MainButtonView(title: "Got It!", type: .primary(withArrow: true), callback: {}) MainButtonView(title: "Got It!", type: .secondary(withArrow: false), callback: {}) @@ -189,7 +189,7 @@ struct PrimaryButtonView_Previews: PreviewProvider { MainButtonImageView(title: "Got It!", type: .secondary(withArrow: false)) } } - .padding(24) + .padding(NativeAppTemplateConstants.Spacing.md) .background(Color.backgroundColor) .inAllColorSchemes } diff --git a/NativeAppTemplate/UI/Shared/Tags/CompletedTag.swift b/NativeAppTemplate/UI/Shared/Tags/CompletedTag.swift index 6c3fdee..dd49541 100644 --- a/NativeAppTemplate/UI/Shared/Tags/CompletedTag.swift +++ b/NativeAppTemplate/UI/Shared/Tags/CompletedTag.swift @@ -18,7 +18,7 @@ struct CompletedTag: View { struct CompletedTag_Previews: PreviewProvider { static var previews: some View { - VStack(spacing: 12) { + VStack(spacing: NativeAppTemplateConstants.Spacing.xs) { completedTag.colorScheme(.light) completedTag.colorScheme(.dark) } diff --git a/NativeAppTemplate/UI/Shared/Tags/CustomerScannedTag.swift b/NativeAppTemplate/UI/Shared/Tags/CustomerScannedTag.swift index cfd7926..0b3a146 100644 --- a/NativeAppTemplate/UI/Shared/Tags/CustomerScannedTag.swift +++ b/NativeAppTemplate/UI/Shared/Tags/CustomerScannedTag.swift @@ -18,7 +18,7 @@ struct CustomerScannedTag: View { struct CustomerScannedTag_Previews: PreviewProvider { static var previews: some View { - VStack(spacing: 12) { + VStack(spacing: NativeAppTemplateConstants.Spacing.xs) { customerScannedTag.colorScheme(.light) customerScannedTag.colorScheme(.dark) } diff --git a/NativeAppTemplate/UI/Shared/Tags/IdlingTagView.swift b/NativeAppTemplate/UI/Shared/Tags/IdlingTagView.swift index bd7e82f..a578b7c 100644 --- a/NativeAppTemplate/UI/Shared/Tags/IdlingTagView.swift +++ b/NativeAppTemplate/UI/Shared/Tags/IdlingTagView.swift @@ -18,7 +18,7 @@ struct IdlingTag: View { struct IdlingTag_Previews: PreviewProvider { static var previews: some View { - VStack(spacing: 12) { + VStack(spacing: NativeAppTemplateConstants.Spacing.xs) { idlingTag.colorScheme(.light) idlingTag.colorScheme(.dark) } diff --git a/NativeAppTemplate/UI/Shared/Tags/TagView.swift b/NativeAppTemplate/UI/Shared/Tags/TagView.swift index 65e9b32..b5a2128 100644 --- a/NativeAppTemplate/UI/Shared/Tags/TagView.swift +++ b/NativeAppTemplate/UI/Shared/Tags/TagView.swift @@ -23,7 +23,7 @@ struct TagView: View { var image: Image? var body: some View { - HStack(spacing: 4) { + HStack(spacing: NativeAppTemplateConstants.Spacing.xxxs) { image? .resizable() .aspectRatio(contentMode: .fit) @@ -40,10 +40,10 @@ struct TagView: View { } ) } - .padding([.vertical], 4) - .padding([.horizontal], 8) + .padding([.vertical], NativeAppTemplateConstants.Spacing.xxxs) + .padding([.horizontal], NativeAppTemplateConstants.Spacing.xxs) .background(backgroundColor) - .cornerRadius(4) // This is a bit hacky. + .cornerRadius(NativeAppTemplateConstants.CornerRadius.xs) // This is a bit hacky. .onPreferenceChange(SizeKey.self) { size in Task { @MainActor in height = size?.height diff --git a/NativeAppTemplate/UI/Shop Detail/ShopDetailCardView.swift b/NativeAppTemplate/UI/Shop Detail/ShopDetailCardView.swift index b46a7d2..4abbd36 100644 --- a/NativeAppTemplate/UI/Shop Detail/ShopDetailCardView.swift +++ b/NativeAppTemplate/UI/Shop Detail/ShopDetailCardView.swift @@ -48,6 +48,6 @@ struct ShopDetailCardView: View { } .frame(minWidth: 82, alignment: .trailing) } - .frame(minHeight: 48) + .frame(minHeight: NativeAppTemplateConstants.Spacing.xl) } } diff --git a/NativeAppTemplate/UI/Shop Detail/ShopDetailView.swift b/NativeAppTemplate/UI/Shop Detail/ShopDetailView.swift index 27c1c30..5cd132d 100644 --- a/NativeAppTemplate/UI/Shop Detail/ShopDetailView.swift +++ b/NativeAppTemplate/UI/Shop Detail/ShopDetailView.swift @@ -133,7 +133,7 @@ private extension ShopDetailView { VStack { header(shop: shop) .padding(.top) - .padding(.horizontal, 8) + .padding(.horizontal, NativeAppTemplateConstants.Spacing.xxs) List { Section { cardsView diff --git a/NativeAppTemplate/UI/Shop List/ShopListCardView.swift b/NativeAppTemplate/UI/Shop List/ShopListCardView.swift index edcb743..820b8d1 100644 --- a/NativeAppTemplate/UI/Shop List/ShopListCardView.swift +++ b/NativeAppTemplate/UI/Shop List/ShopListCardView.swift @@ -16,7 +16,11 @@ struct ShopListCardView: View { let statImageSize = 12.0 - Grid(alignment: .leadingFirstTextBaseline, horizontalSpacing: 12, verticalSpacing: 4) { + Grid( + alignment: .leadingFirstTextBaseline, + horizontalSpacing: NativeAppTemplateConstants.Spacing.xs, + verticalSpacing: NativeAppTemplateConstants.Spacing.xxxs + ) { GridRow { Image(systemName: "person.2") .frame(width: statImageSize, height: statImageSize) diff --git a/NativeAppTemplate/UI/Shop List/ShopListView.swift b/NativeAppTemplate/UI/Shop List/ShopListView.swift index efd141e..5f48c13 100644 --- a/NativeAppTemplate/UI/Shop List/ShopListView.swift +++ b/NativeAppTemplate/UI/Shop List/ShopListView.swift @@ -169,7 +169,7 @@ private extension ShopListView { Image(systemName: "storefront") .resizable() .aspectRatio(contentMode: .fit) - .frame(width: 96) + .frame(width: NativeAppTemplateConstants.Spacing.xxxl) .padding() Text(String.addShopDescription) @@ -186,7 +186,7 @@ private extension ShopListView { Image(systemName: "externaldrive.badge.exclamationmark") .resizable() .aspectRatio(contentMode: .fit) - .frame(width: 96) + .frame(width: NativeAppTemplateConstants.Spacing.xxxl) .padding() HStack(alignment: .firstTextBaseline) { diff --git a/NativeAppTemplate/UI/Shop Settings/ItemTag Detail/ItemTagDetailView.swift b/NativeAppTemplate/UI/Shop Settings/ItemTag Detail/ItemTagDetailView.swift index 036fb61..6d22444 100644 --- a/NativeAppTemplate/UI/Shop Settings/ItemTag Detail/ItemTagDetailView.swift +++ b/NativeAppTemplate/UI/Shop Settings/ItemTag Detail/ItemTagDetailView.swift @@ -49,17 +49,17 @@ private extension ItemTagDetailView { VStack(alignment: .center, spacing: 0) { Text(verbatim: "Write Info to Tag / Save Customer QR code") .font(.title2) - .padding(.top, 8) + .padding(.top, NativeAppTemplateConstants.Spacing.xxs) Text(viewModel.shop.name) .font(.title3) - .padding(.top, 16) + .padding(.top, NativeAppTemplateConstants.Spacing.sm) if let itemTag = viewModel.itemTag { Text(String(itemTag.queueNumber)) .font(.largeTitle) .bold() - .padding(.top, 8) + .padding(.top, NativeAppTemplateConstants.Spacing.xxs) .foregroundStyle(.lightestAccent) } } @@ -69,7 +69,7 @@ private extension ItemTagDetailView { Text(verbatim: "Lock") } .dynamicTypeSize(...DynamicTypeSize.large) - .frame(width: 96) + .frame(width: NativeAppTemplateConstants.Spacing.xxxl) .tint(.lockForeground) if viewModel.isLocked { @@ -99,7 +99,10 @@ private extension ItemTagDetailView { if let customerTagQrCodeImage = viewModel.customerTagQrCodeImage { Image(uiImage: customerTagQrCodeImage) .resizable() - .frame(width: 96, height: 96) + .frame( + width: NativeAppTemplateConstants.Spacing.xxxl, + height: NativeAppTemplateConstants.Spacing.xxxl + ) Button { viewModel.saveImageToPhotoAlbum() @@ -110,7 +113,7 @@ private extension ItemTagDetailView { generateCustomerQrCodeView } } - .padding(.top, 24) + .padding(.top, NativeAppTemplateConstants.Spacing.md) .foregroundStyle(.customerForeground) .backgroundStyle(.customerBackground) } diff --git a/NativeAppTemplate/UI/Shop Settings/ItemTag List/ItemTagListView.swift b/NativeAppTemplate/UI/Shop Settings/ItemTag List/ItemTagListView.swift index e84b13e..efe5e78 100644 --- a/NativeAppTemplate/UI/Shop Settings/ItemTag List/ItemTagListView.swift +++ b/NativeAppTemplate/UI/Shop Settings/ItemTag List/ItemTagListView.swift @@ -49,7 +49,7 @@ private extension ItemTagListView { Text(viewModel.shop.name) .font(.uiTitle1) .foregroundStyle(.titleText) - .padding(.top, 24) + .padding(.top, NativeAppTemplateConstants.Spacing.md) .multilineTextAlignment(.center) if viewModel.isEmpty { @@ -107,7 +107,7 @@ private extension ItemTagListView { Image(systemName: "01.square") .resizable() .aspectRatio(contentMode: .fit) - .frame(width: 96) + .frame(width: NativeAppTemplateConstants.Spacing.xxxl) .padding() Text(String.addTagDescription) diff --git a/NativeAppTemplate/UI/Shop Settings/NumberTagsWebpageListView.swift b/NativeAppTemplate/UI/Shop Settings/NumberTagsWebpageListView.swift index b77973c..69905e5 100644 --- a/NativeAppTemplate/UI/Shop Settings/NumberTagsWebpageListView.swift +++ b/NativeAppTemplate/UI/Shop Settings/NumberTagsWebpageListView.swift @@ -53,7 +53,7 @@ private extension NumberTagsWebpageListView { Text(viewModel.shop.name) .font(.uiTitle1) .foregroundStyle(.titleText) - .padding(.top, 24) + .padding(.top, NativeAppTemplateConstants.Spacing.md) List(NumberTagsWebpageListType.allCases) { numberTagsWebpageListType in switch numberTagsWebpageListType { case .server: diff --git a/NativeAppTemplate/UI/Shop Settings/ShopSettingsView.swift b/NativeAppTemplate/UI/Shop Settings/ShopSettingsView.swift index 954fa70..e77bb03 100644 --- a/NativeAppTemplate/UI/Shop Settings/ShopSettingsView.swift +++ b/NativeAppTemplate/UI/Shop Settings/ShopSettingsView.swift @@ -52,7 +52,7 @@ private extension ShopSettingsView { Text(shop.name) .font(.uiTitle1) .foregroundStyle(.titleText) - .padding(.top, 24) + .padding(.top, NativeAppTemplateConstants.Spacing.md) List { Section { @@ -102,7 +102,7 @@ private extension ShopSettingsView { .listRowBackground(Color.cardBackground) Section { - VStack(spacing: 8) { + VStack(spacing: NativeAppTemplateConstants.Spacing.xxs) { MainButtonView(title: String.resetNumberTags, type: .destructive(withArrow: false)) { viewModel.isShowingResetConfirmationDialog = true }