-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename/move: HomeView 파일 내부 컴포넌트 파일 분리및 홈 뷰 폴더 구조 변경
- Loading branch information
1 parent
f8b4585
commit 9d064ca
Showing
11 changed files
with
284 additions
and
146 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
Pickle/Pickle/Global/Common/Modifier/ClearBackgroundViewModifier.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// ClearBackground.swift | ||
// Pickle | ||
// | ||
// Created by 박형환 on 11/6/23. | ||
// | ||
|
||
import Foundation |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
54 changes: 54 additions & 0 deletions
54
Pickle/Pickle/Screen/Home/HomeView/Util/HomeView-extension.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// HomeView-extension.swift | ||
// Pickle | ||
// | ||
// Created by 박형환 on 11/7/23. | ||
// | ||
|
||
import SwiftUI | ||
|
||
|
||
extension HomeView { | ||
|
||
struct SheetModifier: ViewModifier { | ||
@Binding var selection: PizzaSelectedView.Selection | ||
/*@Binding var updateSignal: Bool*/ // TODO: 피자 업데이트 신호,,,추후 변경 | ||
|
||
@GestureState private var offset = CGSize.zero | ||
@EnvironmentObject var pizzaStore: PizzaStore | ||
@EnvironmentObject var userStore: UserStore | ||
|
||
func body(content: Content) -> some View { | ||
|
||
content | ||
.overlay { | ||
if selection.isPizzaSelected { | ||
// For getting frame for image | ||
GeometryReader { proxy in | ||
let frame = proxy.frame(in: .global) | ||
Color.black | ||
.opacity(0.3) | ||
.frame(width: frame.width, height: frame.height) | ||
} | ||
.ignoresSafeArea() | ||
|
||
CustomSheetView(isPresented: $selection.isPizzaSelected) { | ||
PizzaSelectedView(selection: $selection) | ||
}.transition(.move(edge: .bottom).combined(with: .opacity)) | ||
} | ||
} | ||
.toolbar(selection.isPizzaSelected ? .hidden : .visible, for: .tabBar) | ||
} | ||
} | ||
|
||
struct FullScreenCoverModifier: ViewModifier { | ||
@Binding var isPresented: Bool | ||
@Binding var seletedTodo: Todo | ||
func body(content: Content) -> some View { | ||
content.fullScreenCover(isPresented: $isPresented) { | ||
UpdateTodoView(isShowingEditTodo: $isPresented, | ||
todo: $seletedTodo) | ||
} | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
Pickle/Pickle/Screen/Home/HomeView/Util/NavigationModifier.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// NavigationModifier.swift | ||
// Pickle | ||
// | ||
// Created by 박형환 on 11/7/23. | ||
// | ||
|
||
import Foundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// PreferenceKey.swift | ||
// Pickle | ||
// | ||
// Created by 박형환 on 11/7/23. | ||
// | ||
|
||
import Foundation |
57 changes: 57 additions & 0 deletions
57
Pickle/Pickle/Screen/Home/HomeView/Util/View-extension.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// View.swift | ||
// Pickle | ||
// | ||
// Created by 박형환 on 11/7/23. | ||
// | ||
|
||
import SwiftUI | ||
|
||
|
||
// MARK: HomeView Modifier | ||
extension View { | ||
|
||
@ViewBuilder | ||
func routing(routing: Binding<HomeView.Routing>) -> some View { | ||
|
||
} | ||
|
||
func navigationSetting(tabBarvisibility: Binding<Visibility>) -> some View { | ||
modifier(NavigationModifier(tabBarvisibility: tabBarvisibility)) | ||
} | ||
|
||
// func mutilpleModifier(selection: Binding<PizzaSelectedView.Selection>, | ||
// isPresented: Binding<Bool>, | ||
// seletedTodo item: Binding<Todo>, | ||
// value: PZAContent) { | ||
// modifier(<#T##modifier: T##T#>) | ||
// } | ||
|
||
func sheetModifier(selection: Binding<PizzaSelectedView.Selection>) -> some View { | ||
|
||
modifier(HomeView.SheetModifier(selection: selection)) | ||
} | ||
|
||
func fullScreenCover(isPresented: Binding<Bool>, | ||
seletedTodo item: Binding<Todo>) -> some View { | ||
|
||
modifier(HomeView.FullScreenCoverModifier(isPresented: isPresented, | ||
seletedTodo: item)) | ||
} | ||
|
||
func showPizzaPurchaseAlert(_ pizza: Pizza, | ||
_ isPizzaPuchasePresented: Binding<Bool>, | ||
_ purchaseAction: @escaping () -> Void, | ||
_ navAction: (() -> Void)? = nil) -> some View { | ||
modifier(PizzaAlertModifier(isPresented: isPizzaPuchasePresented, | ||
title: "\(pizza.name)", | ||
price: "", | ||
descripation: "피자 2판을 완성하면 얻을수 있어요", | ||
image: "\(pizza.image)", | ||
lock: pizza.lock, | ||
puchaseButtonTitle: "피자 구매하기 (₩1,200)", | ||
primaryButtonTitle: "피자 완성하러 가기", | ||
primaryAction: purchaseAction, | ||
pizzaMakeNavAction: navAction)) | ||
} | ||
} |
Oops, something went wrong.