|
|
@@ -19,7 +19,13 @@ struct JournalFinderView: View {
|
|
|
let dynamicBottomPadding = min(max(proxy.size.height * 0.04, 20), 40)
|
|
|
|
|
|
Group {
|
|
|
- if viewModel.hasResults, let result = viewModel.result {
|
|
|
+ if viewModel.isSearching {
|
|
|
+ loadingLayout(
|
|
|
+ horizontalPadding: dynamicHorizontalPadding,
|
|
|
+ topPadding: AppTheme.brandLabelTopInset,
|
|
|
+ bottomPadding: dynamicBottomPadding
|
|
|
+ )
|
|
|
+ } else if viewModel.hasResults, let result = viewModel.result {
|
|
|
resultsLayout(
|
|
|
result: result,
|
|
|
horizontalPadding: dynamicHorizontalPadding,
|
|
|
@@ -102,6 +108,30 @@ struct JournalFinderView: View {
|
|
|
.padding(.bottom, bottomPadding)
|
|
|
}
|
|
|
|
|
|
+ private func loadingLayout(
|
|
|
+ horizontalPadding: CGFloat,
|
|
|
+ topPadding: CGFloat,
|
|
|
+ bottomPadding: CGFloat
|
|
|
+ ) -> some View {
|
|
|
+ VStack(spacing: 14) {
|
|
|
+ ProgressView()
|
|
|
+ .controlSize(.regular)
|
|
|
+
|
|
|
+ Text("Loading...")
|
|
|
+ .font(.system(size: 16, weight: .semibold))
|
|
|
+ .foregroundStyle(AppTheme.textPrimary)
|
|
|
+
|
|
|
+ Text("Searching journals for the best matches")
|
|
|
+ .font(.system(size: 14))
|
|
|
+ .foregroundStyle(AppTheme.textSecondary)
|
|
|
+ }
|
|
|
+ .frame(maxWidth: 1200, maxHeight: .infinity, alignment: .center)
|
|
|
+ .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
|
|
|
+ .padding(.horizontal, horizontalPadding)
|
|
|
+ .padding(.top, topPadding)
|
|
|
+ .padding(.bottom, bottomPadding)
|
|
|
+ }
|
|
|
+
|
|
|
// MARK: - Results Layout
|
|
|
|
|
|
private func resultsLayout(
|