|
@@ -18,7 +18,6 @@ struct JournalFinderView: View {
|
|
|
let dynamicHorizontalPadding = min(max(proxy.size.width * 0.045, AppTheme.contentPadding), 52)
|
|
let dynamicHorizontalPadding = min(max(proxy.size.width * 0.045, AppTheme.contentPadding), 52)
|
|
|
let dynamicTopPadding = min(max(proxy.size.height * 0.015, 8), 16)
|
|
let dynamicTopPadding = min(max(proxy.size.height * 0.015, 8), 16)
|
|
|
let dynamicBottomPadding = min(max(proxy.size.height * 0.04, 20), 40)
|
|
let dynamicBottomPadding = min(max(proxy.size.height * 0.04, 20), 40)
|
|
|
- let dynamicEditorHeight = min(max(proxy.size.height * 0.28, 180), 320)
|
|
|
|
|
|
|
|
|
|
Group {
|
|
Group {
|
|
|
if viewModel.hasResults, let result = viewModel.result {
|
|
if viewModel.hasResults, let result = viewModel.result {
|
|
@@ -30,7 +29,7 @@ struct JournalFinderView: View {
|
|
|
)
|
|
)
|
|
|
} else {
|
|
} else {
|
|
|
searchLayout(
|
|
searchLayout(
|
|
|
- editorHeight: dynamicEditorHeight,
|
|
|
|
|
|
|
+ abstractMinHeight: min(max(proxy.size.height * 0.28, 180), 320),
|
|
|
horizontalPadding: dynamicHorizontalPadding,
|
|
horizontalPadding: dynamicHorizontalPadding,
|
|
|
topPadding: dynamicTopPadding,
|
|
topPadding: dynamicTopPadding,
|
|
|
bottomPadding: dynamicBottomPadding
|
|
bottomPadding: dynamicBottomPadding
|
|
@@ -68,40 +67,43 @@ struct JournalFinderView: View {
|
|
|
// MARK: - Search Layout
|
|
// MARK: - Search Layout
|
|
|
|
|
|
|
|
private func searchLayout(
|
|
private func searchLayout(
|
|
|
- editorHeight: CGFloat,
|
|
|
|
|
|
|
+ abstractMinHeight: CGFloat,
|
|
|
horizontalPadding: CGFloat,
|
|
horizontalPadding: CGFloat,
|
|
|
topPadding: CGFloat,
|
|
topPadding: CGFloat,
|
|
|
bottomPadding: CGFloat
|
|
bottomPadding: CGFloat
|
|
|
) -> some View {
|
|
) -> some View {
|
|
|
- ScrollView(.vertical, showsIndicators: false) {
|
|
|
|
|
- VStack(alignment: .leading, spacing: 0) {
|
|
|
|
|
- header
|
|
|
|
|
- .padding(.bottom, 24)
|
|
|
|
|
|
|
+ VStack(alignment: .leading, spacing: 0) {
|
|
|
|
|
+ header
|
|
|
|
|
+ .padding(.bottom, 24)
|
|
|
|
|
|
|
|
- inputCard(editorHeight: editorHeight)
|
|
|
|
|
- .padding(.bottom, 20)
|
|
|
|
|
|
|
+ ScrollView(.vertical, showsIndicators: false) {
|
|
|
|
|
+ VStack(alignment: .leading, spacing: 0) {
|
|
|
|
|
+ inputCard(abstractMinHeight: abstractMinHeight)
|
|
|
|
|
+ .padding(.bottom, 16)
|
|
|
|
|
|
|
|
- filtersCard
|
|
|
|
|
- .padding(.bottom, 20)
|
|
|
|
|
|
|
+ filtersCard
|
|
|
|
|
|
|
|
- if let errorMessage = viewModel.errorMessage {
|
|
|
|
|
- errorBanner(errorMessage)
|
|
|
|
|
- .padding(.bottom, 16)
|
|
|
|
|
|
|
+ if let errorMessage = viewModel.errorMessage {
|
|
|
|
|
+ errorBanner(errorMessage)
|
|
|
|
|
+ .padding(.top, 12)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+ .frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
|
|
|
|
|
|
- GradientButton(
|
|
|
|
|
- title: viewModel.isSearching ? "Finding Journals..." : "Find Journals"
|
|
|
|
|
- ) {
|
|
|
|
|
- viewModel.findJournals()
|
|
|
|
|
- }
|
|
|
|
|
- .disabled(!viewModel.canSearch)
|
|
|
|
|
|
|
+ GradientButton(
|
|
|
|
|
+ title: viewModel.isSearching ? "Finding Journals..." : "Find Journals"
|
|
|
|
|
+ ) {
|
|
|
|
|
+ viewModel.findJournals()
|
|
|
}
|
|
}
|
|
|
- .frame(maxWidth: 1200, alignment: .topLeading)
|
|
|
|
|
- .frame(maxWidth: .infinity, alignment: .topLeading)
|
|
|
|
|
- .padding(.horizontal, horizontalPadding)
|
|
|
|
|
- .padding(.top, topPadding)
|
|
|
|
|
- .padding(.bottom, bottomPadding)
|
|
|
|
|
|
|
+ .disabled(!viewModel.canSearch)
|
|
|
|
|
+ .padding(.top, 16)
|
|
|
}
|
|
}
|
|
|
|
|
+ .frame(maxWidth: 1200, maxHeight: .infinity, alignment: .topLeading)
|
|
|
|
|
+ .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
|
|
|
|
|
+ .padding(.horizontal, horizontalPadding)
|
|
|
|
|
+ .padding(.top, topPadding)
|
|
|
|
|
+ .padding(.bottom, bottomPadding)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// MARK: - Results Layout
|
|
// MARK: - Results Layout
|
|
@@ -194,7 +196,7 @@ struct JournalFinderView: View {
|
|
|
|
|
|
|
|
// MARK: - Input Card
|
|
// MARK: - Input Card
|
|
|
|
|
|
|
|
- private func inputCard(editorHeight: CGFloat) -> some View {
|
|
|
|
|
|
|
+ private func inputCard(abstractMinHeight: CGFloat) -> some View {
|
|
|
VStack(alignment: .leading, spacing: 18) {
|
|
VStack(alignment: .leading, spacing: 18) {
|
|
|
Image("YourContentLogo")
|
|
Image("YourContentLogo")
|
|
|
.resizable()
|
|
.resizable()
|
|
@@ -205,7 +207,7 @@ struct JournalFinderView: View {
|
|
|
.accessibilityLabel("Your Content")
|
|
.accessibilityLabel("Your Content")
|
|
|
|
|
|
|
|
titleField
|
|
titleField
|
|
|
- abstractEditor(height: editorHeight)
|
|
|
|
|
|
|
+ abstractEditor(minHeight: abstractMinHeight)
|
|
|
keywordsField
|
|
keywordsField
|
|
|
|
|
|
|
|
HStack(spacing: 8) {
|
|
HStack(spacing: 8) {
|
|
@@ -221,6 +223,7 @@ struct JournalFinderView: View {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.padding(22)
|
|
.padding(22)
|
|
|
|
|
+ .frame(maxWidth: .infinity, alignment: .topLeading)
|
|
|
.background(AppTheme.cardBackground)
|
|
.background(AppTheme.cardBackground)
|
|
|
.clipShape(RoundedRectangle(cornerRadius: AppTheme.cardCornerRadius))
|
|
.clipShape(RoundedRectangle(cornerRadius: AppTheme.cardCornerRadius))
|
|
|
.overlay(
|
|
.overlay(
|
|
@@ -249,7 +252,7 @@ struct JournalFinderView: View {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private func abstractEditor(height: CGFloat) -> some View {
|
|
|
|
|
|
|
+ private func abstractEditor(minHeight: CGFloat) -> some View {
|
|
|
VStack(alignment: .leading, spacing: 8) {
|
|
VStack(alignment: .leading, spacing: 8) {
|
|
|
fieldLabel("Abstract or Summary", optional: false)
|
|
fieldLabel("Abstract or Summary", optional: false)
|
|
|
|
|
|
|
@@ -258,9 +261,9 @@ struct JournalFinderView: View {
|
|
|
text: $viewModel.abstractText,
|
|
text: $viewModel.abstractText,
|
|
|
placeholder: "Paste your abstract, introduction, or manuscript summary here..."
|
|
placeholder: "Paste your abstract, introduction, or manuscript summary here..."
|
|
|
)
|
|
)
|
|
|
- .frame(height: height)
|
|
|
|
|
-
|
|
|
|
|
|
|
+ .frame(maxWidth: .infinity, minHeight: minHeight)
|
|
|
}
|
|
}
|
|
|
|
|
+ .frame(maxWidth: .infinity, minHeight: minHeight)
|
|
|
.background(Color.white)
|
|
.background(Color.white)
|
|
|
.clipShape(RoundedRectangle(cornerRadius: AppTheme.inputCornerRadius))
|
|
.clipShape(RoundedRectangle(cornerRadius: AppTheme.inputCornerRadius))
|
|
|
.overlay(
|
|
.overlay(
|