Skip to content

Commit

Permalink
[Feat] #4 - 컴포넌트 extension으로 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
yurim830 committed Jan 9, 2025
1 parent 8eb73ad commit 34473a1
Showing 1 changed file with 29 additions and 17 deletions.
46 changes: 29 additions & 17 deletions Staccato-iOS/Staccato-iOS/Presentation/View/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,46 @@ import SwiftUI

struct HomeView: View {

// MARK: - Body
var body: some View {
NavigationView {
ZStack(alignment: .topLeading) {
MapViewControllerBridge()
.edgesIgnoringSafeArea(.all)

NavigationLink(destination: TempMyPageView()) {
Image(systemName: "person.circle.fill")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 40, height: 40)
.background(Color.white)
.foregroundStyle(.gray3)
.clipShape(Circle())
.overlay {
Circle().stroke(Color.white, lineWidth: 2)
}
}
.padding(20)
myPageNavigationLink()
.padding(20)
}
}
}
}


// MARK: - Components
extension HomeView {
func myPageNavigationLink() -> some View {
NavigationLink(destination: TempMyPageView()) {
Image(systemName: "person.circle.fill")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 40, height: 40)
.background(Color.white)
.foregroundStyle(.gray3)
.clipShape(Circle())
.overlay {
Circle().stroke(Color.white, lineWidth: 2)
}
}
}
}

#Preview {
HomeView()
}



// 임시 뷰 - 추후 삭제 예정
struct TempMyPageView: View {
var body: some View {
Text("My Page")
Expand All @@ -43,7 +59,3 @@ struct TempMyPageView: View {
.padding()
}
}

#Preview {
HomeView()
}

0 comments on commit 34473a1

Please sign in to comment.