Skip to content

Commit

Permalink
refactor: [#115] Correct inconsistent background color code
Browse files Browse the repository at this point in the history
- 배경색 입히는 코드를 두 가지 방식(ZStack / .overlay)으로 구현함.
- 코드 통일성이 부족하다고 판단하여, 한 가지 방식(ZStack)으로 통일함.
  • Loading branch information
dbqls200 authored and zaehorang committed Sep 6, 2024
1 parent c9e0bec commit 66e93cb
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions MinGenie/MinGenie/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 66e93cb

Please sign in to comment.