chore: minor style chages
e606590c
2 file(s) · +24 −8
| 25 | 25 | ||
| 26 | 26 | var body: some View { |
|
| 27 | 27 | VStack(spacing: 12) { |
|
| 28 | - | ScrollView { |
|
| 29 | - | TitanContentView(content: responseText, baseURL: urlText, onLinkTap: { url in |
|
| 30 | - | navigateTo(url) |
|
| 31 | - | }) |
|
| 32 | - | .frame(maxWidth: .infinity, alignment: .leading) |
|
| 28 | + | ScrollViewReader { proxy in |
|
| 29 | + | ScrollView { |
|
| 30 | + | TitanContentView(content: responseText, baseURL: urlText, onLinkTap: { url in |
|
| 31 | + | navigateTo(url) |
|
| 32 | + | }) |
|
| 33 | + | .frame(maxWidth: .infinity, alignment: .leading) |
|
| 34 | + | .padding(.horizontal, 4) |
|
| 35 | + | .id("top") |
|
| 36 | + | } |
|
| 37 | + | .onChange(of: responseText) { |
|
| 38 | + | withAnimation { |
|
| 39 | + | proxy.scrollTo("top", anchor: .top) |
|
| 40 | + | } |
|
| 41 | + | } |
|
| 42 | + | .ignoresSafeArea(edges: .top) |
|
| 43 | + | .contentMargins(.top, 60, for: .scrollContent) |
|
| 33 | 44 | } |
|
| 34 | 45 | ||
| 35 | - | HStack(spacing: 8) { |
|
| 46 | + | HStack(spacing: 20) { |
|
| 36 | 47 | // Back button |
|
| 37 | 48 | Button(action: goBack) { |
|
| 38 | 49 | Image(systemName: "chevron.left") |
|
| 39 | 50 | .font(.title2) |
|
| 51 | + | .padding(.leading, 6) |
|
| 40 | 52 | } |
|
| 41 | 53 | .disabled(!canGoBack || isLoading) |
|
| 42 | 54 | ||
| 63 | 75 | } else { |
|
| 64 | 76 | Image(systemName: "arrow.right.circle.fill") |
|
| 65 | 77 | .font(.title2) |
|
| 78 | + | .foregroundColor(.orange) |
|
| 66 | 79 | } |
|
| 67 | 80 | } |
|
| 68 | 81 | .disabled(isLoading || urlText.isEmpty) |
|
| 69 | 82 | } |
|
| 83 | + | .padding(.horizontal) |
|
| 84 | + | .padding(.bottom, 8) |
|
| 70 | 85 | } |
|
| 71 | - | .padding() |
|
| 72 | 86 | .onAppear { |
|
| 73 | 87 | navigateTo(urlText) |
|
| 74 | 88 | } |
|
| 89 | + | .ignoresSafeArea(edges: .top) |
|
| 75 | 90 | .alert("Input Required", isPresented: $showInputPrompt) { |
|
| 76 | 91 | if inputIsSensitive { |
|
| 77 | 92 | SecureField("Enter input", text: $inputValue) |
|
| 87 | 102 | } message: { |
|
| 88 | 103 | Text(inputPromptText) |
|
| 89 | 104 | } |
|
| 105 | + | ||
| 90 | 106 | } |
|
| 91 | 107 | ||
| 92 | 108 | private func submitInput() { |
|
| 44 | 44 | .font(.system(size: 14, design: .monospaced)) |
|
| 45 | 45 | } |
|
| 46 | 46 | } |
|
| 47 | - | .foregroundColor(.blue) |
|
| 47 | + | .foregroundColor(.orange) |
|
| 48 | 48 | ||
| 49 | 49 | case .heading1(let text): |
|
| 50 | 50 | Text(text) |