Skip to content

Commit a352039

Browse files
committed
refactor: 불필요 뷰빌더 요소 제거
1 parent 0edfd8a commit a352039

1 file changed

Lines changed: 16 additions & 19 deletions

File tree

DevLog/UI/Main/MainView.swift

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,23 @@ struct MainView: View {
2323
}
2424

2525
var body: some View {
26-
content
27-
.onAppear {
28-
coordinator.mainViewModel.send(.onAppear)
29-
}
30-
.alert(
31-
coordinator.mainViewModel.state.alertTitle,
32-
isPresented: mainAlertPresented
33-
) {
34-
Button(String(localized: "common_close"), role: .cancel) { }
35-
} message: {
36-
Text(coordinator.mainViewModel.state.alertMessage)
26+
Group {
27+
if isCompactLayout {
28+
tabView
29+
} else {
30+
sidebarView
3731
}
38-
}
39-
40-
@ViewBuilder
41-
private var content: some View {
42-
if isCompactLayout {
43-
tabView
44-
} else {
45-
sidebarView
32+
}
33+
.onAppear {
34+
coordinator.mainViewModel.send(.onAppear)
35+
}
36+
.alert(
37+
coordinator.mainViewModel.state.alertTitle,
38+
isPresented: mainAlertPresented
39+
) {
40+
Button(String(localized: "common_close"), role: .cancel) { }
41+
} message: {
42+
Text(coordinator.mainViewModel.state.alertMessage)
4643
}
4744
}
4845

0 commit comments

Comments
 (0)