mirror of
https://codeberg.org/secana/Forji.git
synced 2026-06-16 05:13:55 -07:00
chore: format code
This commit is contained in:
parent
5bfb5babe0
commit
003fbb9703
32 changed files with 304 additions and 303 deletions
|
|
@ -95,8 +95,8 @@ struct ContentView: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
ContentView()
|
||||
.modelContainer(for: ForgejoInstance.self, inMemory: true)
|
||||
}
|
||||
#Preview {
|
||||
ContentView()
|
||||
.modelContainer(for: ForgejoInstance.self, inMemory: true)
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ struct CommentSheet: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
CommentSheet(users: [.preview, .previewBot]) { _ in }
|
||||
}
|
||||
#Preview {
|
||||
CommentSheet(users: [.preview, .previewBot]) { _ in }
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -108,13 +108,13 @@ private struct CommentEditSheet: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
List {
|
||||
CommentView(
|
||||
comment: .preview
|
||||
currentUsername: "testuser",
|
||||
onSave: nil,
|
||||
)
|
||||
#Preview {
|
||||
List {
|
||||
CommentView(
|
||||
comment: .preview currentUsername: "testuser",
|
||||
|
||||
onSave: nil,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -94,13 +94,13 @@ struct CommitDetailView: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
CommitDetailView(
|
||||
commit: .preview,
|
||||
repository: .preview,
|
||||
authService: .previewDefault,
|
||||
)
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
CommitDetailView(
|
||||
commit: .preview,
|
||||
repository: .preview,
|
||||
authService: .previewDefault,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -210,13 +210,13 @@ struct CommitRow: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
CommitHistoryView(
|
||||
repository: .preview,
|
||||
branch: .constant("main"),
|
||||
authService: .previewDefault,
|
||||
)
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
CommitHistoryView(
|
||||
repository: .preview,
|
||||
branch: .constant("main"),
|
||||
authService: .previewDefault,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -144,10 +144,10 @@ private struct InlineCommentBubble: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
List {
|
||||
DiffView(diff: .preview)
|
||||
.listRowInsets(EdgeInsets())
|
||||
#Preview {
|
||||
List {
|
||||
DiffView(diff: .preview)
|
||||
.listRowInsets(EdgeInsets())
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -46,15 +46,15 @@ struct AssigneesDisplaySection: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview("Milestone") {
|
||||
List {
|
||||
MilestoneDisplaySection(milestone: .preview)
|
||||
#Preview("Milestone") {
|
||||
List {
|
||||
MilestoneDisplaySection(milestone: .preview)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview("Assignees") {
|
||||
List {
|
||||
AssigneesDisplaySection(assignees: [.preview, .previewBot])
|
||||
#Preview("Assignees") {
|
||||
List {
|
||||
AssigneesDisplaySection(assignees: [.preview, .previewBot])
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -283,57 +283,57 @@ struct CommitSheetView: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview("Markdown") {
|
||||
NavigationStack {
|
||||
FileViewerView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
filePath: "README.md",
|
||||
fileName: "README.md",
|
||||
authService: .previewDefault,
|
||||
fileContent: """
|
||||
# test-repo
|
||||
#Preview("Markdown") {
|
||||
NavigationStack {
|
||||
FileViewerView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
filePath: "README.md",
|
||||
fileName: "README.md",
|
||||
authService: .previewDefault,
|
||||
fileContent: """
|
||||
# test-repo
|
||||
|
||||
A sample repository for testing.
|
||||
A sample repository for testing.
|
||||
|
||||
## Getting Started
|
||||
## Getting Started
|
||||
|
||||
```bash
|
||||
git clone https://example.com/testadmin/test-repo.git
|
||||
cd test-repo
|
||||
```
|
||||
```bash
|
||||
git clone https://example.com/testadmin/test-repo.git
|
||||
cd test-repo
|
||||
```
|
||||
|
||||
## Features
|
||||
## Features
|
||||
|
||||
- Written in **Python**
|
||||
- Includes `hello.py` and `src/main.py`
|
||||
- Licensed under MIT
|
||||
""",
|
||||
fileSha: "abc123",
|
||||
)
|
||||
- Written in **Python**
|
||||
- Includes `hello.py` and `src/main.py`
|
||||
- Licensed under MIT
|
||||
""",
|
||||
fileSha: "abc123",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview("Code") {
|
||||
NavigationStack {
|
||||
FileViewerView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
filePath: "hello.py",
|
||||
fileName: "hello.py",
|
||||
authService: .previewDefault,
|
||||
fileContent: """
|
||||
#!/usr/bin/env python3
|
||||
#Preview("Code") {
|
||||
NavigationStack {
|
||||
FileViewerView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
filePath: "hello.py",
|
||||
fileName: "hello.py",
|
||||
authService: .previewDefault,
|
||||
fileContent: """
|
||||
#!/usr/bin/env python3
|
||||
|
||||
def greet(name: str) -> str:
|
||||
\"\"\"Return a greeting message.\"\"\"
|
||||
return f"Hello, {name}!"
|
||||
def greet(name: str) -> str:
|
||||
\"\"\"Return a greeting message.\"\"\"
|
||||
return f"Hello, {name}!"
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(greet("World"))
|
||||
""",
|
||||
fileSha: "def456",
|
||||
)
|
||||
if __name__ == "__main__":
|
||||
print(greet("World"))
|
||||
""",
|
||||
fileSha: "def456",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ struct SettingsTabView: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
HomeView(authService: .previewDefault)
|
||||
}
|
||||
#Preview {
|
||||
HomeView(authService: .previewDefault)
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import ForgejoKit
|
|||
import SwiftData
|
||||
import SwiftUI
|
||||
|
||||
// swiftlint:disable:next type_body_length
|
||||
struct InstanceFormView: View {
|
||||
enum Mode: Identifiable {
|
||||
case add
|
||||
|
|
@ -10,7 +11,7 @@ struct InstanceFormView: View {
|
|||
var id: String {
|
||||
switch self {
|
||||
case .add: "add"
|
||||
case .edit(let instance): instance.serverURL + instance.username
|
||||
case let .edit(instance): instance.serverURL + instance.username
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -118,7 +119,7 @@ struct InstanceFormView: View {
|
|||
• read/write:issue
|
||||
• read/write:notification
|
||||
• read:organization
|
||||
"""
|
||||
""",
|
||||
)
|
||||
} else if needsOTP {
|
||||
Text("Enter the 6-digit code from your authenticator app.")
|
||||
|
|
@ -196,7 +197,7 @@ struct InstanceFormView: View {
|
|||
if !devApiToken.isEmpty { apiToken = devApiToken }
|
||||
allowSelfSignedCertificates = devAllowSelfSigned
|
||||
#endif
|
||||
case .edit(let instance):
|
||||
case let .edit(instance):
|
||||
name = instance.name
|
||||
serverURL = instance.serverURL
|
||||
username = instance.username
|
||||
|
|
@ -270,7 +271,7 @@ struct InstanceFormView: View {
|
|||
}
|
||||
authService.currentInstance = instance
|
||||
|
||||
case .edit(let instance):
|
||||
case let .edit(instance):
|
||||
if authMode == .token, !apiToken.isEmpty {
|
||||
try await performLogin()
|
||||
instance.username = authService.currentUser?.login ?? username
|
||||
|
|
|
|||
|
|
@ -176,8 +176,8 @@ struct InstanceListView: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
InstanceListView(authService: .previewDefault)
|
||||
.modelContainer(for: ForgejoInstance.self, inMemory: true)
|
||||
}
|
||||
#Preview {
|
||||
InstanceListView(authService: .previewDefault)
|
||||
.modelContainer(for: ForgejoInstance.self, inMemory: true)
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -147,16 +147,16 @@ struct IssueCreateView: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
IssueCreateView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
authService: .previewDefault,
|
||||
availableLabels: IssueLabel.previewList,
|
||||
availableMilestones: [.preview],
|
||||
availableAssignees: [.preview, .previewBot],
|
||||
)
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
IssueCreateView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
authService: .previewDefault,
|
||||
availableLabels: IssueLabel.previewList,
|
||||
availableMilestones: [.preview],
|
||||
availableAssignees: [.preview, .previewBot],
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -287,16 +287,16 @@ struct IssueDetailView: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
IssueDetailView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
issueNumber: 1,
|
||||
authService: .previewDefault,
|
||||
issue: .preview,
|
||||
comments: [.preview],
|
||||
)
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
IssueDetailView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
issueNumber: 1,
|
||||
authService: .previewDefault,
|
||||
issue: .preview,
|
||||
comments: [.preview],
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -157,15 +157,15 @@ struct IssueEditView: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
IssueEditView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
issue: .preview,
|
||||
authService: .previewDefault,
|
||||
availableLabels: IssueLabel.previewList,
|
||||
availableMilestones: [.preview],
|
||||
availableAssignees: [.preview, .previewBot],
|
||||
)
|
||||
}
|
||||
#Preview {
|
||||
IssueEditView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
issue: .preview,
|
||||
authService: .previewDefault,
|
||||
availableLabels: IssueLabel.previewList,
|
||||
availableMilestones: [.preview],
|
||||
availableAssignees: [.preview, .previewBot],
|
||||
)
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -50,12 +50,12 @@ extension Color {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
HStack {
|
||||
ForEach(IssueLabel.previewList) { label in
|
||||
IssueLabelView(label: label)
|
||||
#Preview {
|
||||
HStack {
|
||||
ForEach(IssueLabel.previewList) { label in
|
||||
IssueLabelView(label: label)
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -144,16 +144,16 @@ struct IssueListView: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
IssueListView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
authService: .previewDefault,
|
||||
issues: [.preview],
|
||||
)
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
IssueListView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
authService: .previewDefault,
|
||||
issues: [.preview],
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
struct IssueRow: View {
|
||||
|
|
|
|||
|
|
@ -49,13 +49,13 @@ struct IssuesOverviewView: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
IssuesOverviewView(
|
||||
preview: (),
|
||||
authService: .previewDefault,
|
||||
issues: [.previewWithRepo],
|
||||
)
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
IssuesOverviewView(
|
||||
preview: (),
|
||||
authService: .previewDefault,
|
||||
issues: [.previewWithRepo],
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -206,15 +206,15 @@ struct MermaidDiagramView: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview("Editor") {
|
||||
@Previewable @State var text = "# Hello\n\nThis is **bold** and *italic* text.\n\n- Item 1\n- Item 2"
|
||||
@Previewable @State var tab: EditPreviewTab = .edit
|
||||
MarkdownEditorField(text: $text, selectedTab: $tab)
|
||||
.padding()
|
||||
}
|
||||
#Preview("Editor") {
|
||||
@Previewable @State var text = "# Hello\n\nThis is **bold** and *italic* text.\n\n- Item 1\n- Item 2"
|
||||
@Previewable @State var tab: EditPreviewTab = .edit
|
||||
MarkdownEditorField(text: $text, selectedTab: $tab)
|
||||
.padding()
|
||||
}
|
||||
|
||||
#Preview("Preview") {
|
||||
MarkdownPreview(text: "# Hello\n\nThis is **bold** and *italic* text.\n\n```swift\nlet x = 42\n```")
|
||||
.padding()
|
||||
}
|
||||
#Preview("Preview") {
|
||||
MarkdownPreview(text: "# Hello\n\nThis is **bold** and *italic* text.\n\n```swift\nlet x = 42\n```")
|
||||
.padding()
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -77,14 +77,14 @@ struct MentionableEditorField: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
@Previewable @State var text = "Hello @"
|
||||
@Previewable @State var tab: EditPreviewTab = .edit
|
||||
MentionableEditorField(
|
||||
text: $text,
|
||||
selectedTab: $tab,
|
||||
users: [.preview, .previewBot],
|
||||
)
|
||||
.padding()
|
||||
}
|
||||
#Preview {
|
||||
@Previewable @State var text = "Hello @"
|
||||
@Previewable @State var tab: EditPreviewTab = .edit
|
||||
MentionableEditorField(
|
||||
text: $text,
|
||||
selectedTab: $tab,
|
||||
users: [.preview, .previewBot],
|
||||
)
|
||||
.padding()
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -284,49 +284,49 @@ struct UserPickerSection: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview("Description") {
|
||||
@Previewable @State var text = "Some **markdown** description"
|
||||
NavigationStack {
|
||||
List {
|
||||
DescriptionEditorSection(text: $text)
|
||||
#Preview("Description") {
|
||||
@Previewable @State var text = "Some **markdown** description"
|
||||
NavigationStack {
|
||||
List {
|
||||
DescriptionEditorSection(text: $text)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview("Labels") {
|
||||
@Previewable @State var selected: Set<Int> = [1]
|
||||
NavigationStack {
|
||||
List {
|
||||
LabelPickerSection(
|
||||
availableLabels: IssueLabel.previewList,
|
||||
selectedLabelIDs: $selected,
|
||||
)
|
||||
#Preview("Labels") {
|
||||
@Previewable @State var selected: Set<Int> = [1]
|
||||
NavigationStack {
|
||||
List {
|
||||
LabelPickerSection(
|
||||
availableLabels: IssueLabel.previewList,
|
||||
selectedLabelIDs: $selected,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview("Milestones") {
|
||||
@Previewable @State var selected: Int?
|
||||
NavigationStack {
|
||||
List {
|
||||
MilestonePickerSection(
|
||||
availableMilestones: [.preview],
|
||||
selectedMilestoneID: $selected,
|
||||
)
|
||||
#Preview("Milestones") {
|
||||
@Previewable @State var selected: Int?
|
||||
NavigationStack {
|
||||
List {
|
||||
MilestonePickerSection(
|
||||
availableMilestones: [.preview],
|
||||
selectedMilestoneID: $selected,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview("Users") {
|
||||
@Previewable @State var selected: Set<String> = []
|
||||
NavigationStack {
|
||||
List {
|
||||
UserPickerSection(
|
||||
title: "Assignees",
|
||||
availableUsers: [.preview, .previewBot],
|
||||
selectedLogins: $selected,
|
||||
)
|
||||
#Preview("Users") {
|
||||
@Previewable @State var selected: Set<String> = []
|
||||
NavigationStack {
|
||||
List {
|
||||
UserPickerSection(
|
||||
title: "Assignees",
|
||||
availableUsers: [.preview, .previewBot],
|
||||
selectedLogins: $selected,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -262,13 +262,13 @@ private struct NotificationRow: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
NotificationsOverviewView(
|
||||
preview: (),
|
||||
authService: .previewDefault,
|
||||
notifications: NotificationThread.previewList,
|
||||
)
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
NotificationsOverviewView(
|
||||
preview: (),
|
||||
authService: .previewDefault,
|
||||
notifications: NotificationThread.previewList,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -235,18 +235,18 @@ struct PullRequestCreateView: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
PullRequestCreateView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
authService: .previewDefault,
|
||||
branches: Branch.previewList,
|
||||
baseBranch: "main",
|
||||
availableLabels: IssueLabel.previewList,
|
||||
availableMilestones: [.preview],
|
||||
availableAssignees: [.preview, .previewBot],
|
||||
)
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
PullRequestCreateView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
authService: .previewDefault,
|
||||
branches: Branch.previewList,
|
||||
baseBranch: "main",
|
||||
availableLabels: IssueLabel.previewList,
|
||||
availableMilestones: [.preview],
|
||||
availableAssignees: [.preview, .previewBot],
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -591,17 +591,17 @@ struct PullRequestDetailView: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
PullRequestDetailView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
prNumber: 4,
|
||||
authService: .previewDefault,
|
||||
pullRequest: .preview,
|
||||
comments: [.preview],
|
||||
reviews: [.preview],
|
||||
)
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
PullRequestDetailView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
prNumber: 4,
|
||||
authService: .previewDefault,
|
||||
pullRequest: .preview,
|
||||
comments: [.preview],
|
||||
reviews: [.preview],
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -204,15 +204,15 @@ struct PullRequestEditView: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
PullRequestEditView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
pullRequest: .preview,
|
||||
authService: .previewDefault,
|
||||
availableLabels: IssueLabel.previewList,
|
||||
availableMilestones: [.preview],
|
||||
availableAssignees: [.preview, .previewBot],
|
||||
)
|
||||
}
|
||||
#Preview {
|
||||
PullRequestEditView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
pullRequest: .preview,
|
||||
authService: .previewDefault,
|
||||
availableLabels: IssueLabel.previewList,
|
||||
availableMilestones: [.preview],
|
||||
availableAssignees: [.preview, .previewBot],
|
||||
)
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -144,16 +144,16 @@ struct PullRequestListView: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
PullRequestListView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
authService: .previewDefault,
|
||||
pullRequests: [.preview],
|
||||
)
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
PullRequestListView(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
authService: .previewDefault,
|
||||
pullRequests: [.preview],
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
struct PullRequestRow: View {
|
||||
|
|
|
|||
|
|
@ -103,11 +103,11 @@ struct PullRequestMergeView: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
PullRequestMergeView(
|
||||
repository: .preview,
|
||||
pullRequest: .preview,
|
||||
authService: .previewDefault,
|
||||
) {}
|
||||
}
|
||||
#Preview {
|
||||
PullRequestMergeView(
|
||||
repository: .preview,
|
||||
pullRequest: .preview,
|
||||
authService: .previewDefault,
|
||||
) {}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -236,13 +236,13 @@ private struct AddInlineCommentSheet: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
PullRequestReviewSheet(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
prNumber: 4,
|
||||
authService: .previewDefault,
|
||||
parsedDiff: .preview,
|
||||
)
|
||||
}
|
||||
#Preview {
|
||||
PullRequestReviewSheet(
|
||||
preview: (),
|
||||
repository: .preview,
|
||||
prNumber: 4,
|
||||
authService: .previewDefault,
|
||||
parsedDiff: .preview,
|
||||
)
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -97,13 +97,13 @@ struct PullRequestOverviewRow: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
PullRequestsOverviewView(
|
||||
preview: (),
|
||||
authService: .previewDefault,
|
||||
pullRequests: [.previewPullRequest],
|
||||
)
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
PullRequestsOverviewView(
|
||||
preview: (),
|
||||
authService: .previewDefault,
|
||||
pullRequests: [.previewPullRequest],
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -560,9 +560,9 @@ struct ContentRow: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
RepositoryDetailView(repository: .preview, authService: .previewDefault)
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
RepositoryDetailView(repository: .preview, authService: .previewDefault)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -330,7 +330,7 @@ struct RepositoryRow: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
RepositoryListView(authService: .previewDefault)
|
||||
}
|
||||
#Preview {
|
||||
RepositoryListView(authService: .previewDefault)
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -177,9 +177,9 @@ private struct RepositoryPickerRow: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
RepositoryPickerView(preview: (), authService: .previewDefault, repositories: [.preview]) { repo in
|
||||
Text(repo.fullName)
|
||||
#Preview {
|
||||
RepositoryPickerView(preview: (), authService: .previewDefault, repositories: [.preview]) { repo in
|
||||
Text(repo.fullName)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -76,12 +76,12 @@ struct ReviewSummaryView: View {
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
#Preview {
|
||||
List {
|
||||
ReviewSummaryView(
|
||||
review: .preview,
|
||||
comments: [.preview],
|
||||
)
|
||||
#Preview {
|
||||
List {
|
||||
ReviewSummaryView(
|
||||
review: .preview,
|
||||
comments: [.preview],
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue