From 66e93cb3e1ce40792d521d17cb6f54e6c2ac21c3 Mon Sep 17 00:00:00 2001 From: YuBeen <87077859+dbqls200@users.noreply.github.com> Date: Sun, 30 Jun 2024 19:17:01 +0900 Subject: [PATCH] refactor: [#115] Correct inconsistent background color code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 배경색 입히는 코드를 두 가지 방식(ZStack / .overlay)으로 구현함. - 코드 통일성이 부족하다고 판단하여, 한 가지 방식(ZStack)으로 통일함. --- MinGenie/MinGenie/Home/HomeView.swift | 29 ++++++++++++++------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/MinGenie/MinGenie/Home/HomeView.swift b/MinGenie/MinGenie/Home/HomeView.swift index e28c7a1..c48ea31 100644 --- a/MinGenie/MinGenie/Home/HomeView.swift +++ b/MinGenie/MinGenie/Home/HomeView.swift @@ -27,22 +27,23 @@ struct HomeView: View { NavigationView { // 검색어 없을 때 if searchTerm.isEmpty { - Color.BG.main.ignoresSafeArea() - .overlay { - VStack(spacing: 0) { - if let tracks = selectedMusicDataModel.storedTracks { - MusicItemRowView(itemRowTitle: "지난 선곡", tracks: tracks) - .padding(.bottom, 30) - } - - if let tracks = musicPersonalRecommendationModel.personalRecommendationTracks { - MusicItemRowView(itemRowTitle: "맞춤 랜덤 선곡", tracks: tracks) - } - - Spacer() + ZStack { + Color.BG.main.ignoresSafeArea() + + VStack(spacing: 0) { + if let tracks = selectedMusicDataModel.storedTracks { + MusicItemRowView(itemRowTitle: "지난 선곡", tracks: tracks) + .padding(.bottom, 30) } - .navigationTitle("오늘의 첫곡 🎧") + + if let tracks = musicPersonalRecommendationModel.personalRecommendationTracks { + MusicItemRowView(itemRowTitle: "맞춤 랜덤 선곡", tracks: tracks) + } + + Spacer() } + .navigationTitle("오늘의 첫곡 🎧") + } } else { // 검색어 있을 때 MusicSearchView(searchTerm: $searchTerm)