Skip to content

Commit

Permalink
[Chore] #33 - 마켓 및 탐색 상품 아이템 동적으로 너비 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
joho2022 committed Jan 18, 2025
1 parent 675b51c commit b5bda07
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Napzakmarket-iOS/Napzakmarket-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"Napzakmarket-iOS/Application/Preview Content\"";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 9H57LB393L;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Napzakmarket-iOS/Info.plist";
Expand Down Expand Up @@ -956,7 +956,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"Napzakmarket-iOS/Application/Preview Content\"";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 9H57LB393L;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Napzakmarket-iOS/Info.plist";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ struct MarketView: View {
@State private var selectedIndex = 0
@State private var sellProducts = ProductModel.sellDummyList()
@State private var buyProducts = ProductModel.buyDummyList()

let width = (UIScreen.main.bounds.width - 55) / 2

private let columns = [
GridItem(.flexible(), spacing: 15),
GridItem(.flexible(), spacing: 15)
GridItem(.flexible())
]

var body: some View {
Expand Down Expand Up @@ -77,20 +79,19 @@ struct MarketView: View {
ProductItemView(
product: product,
isLikeButtonExist: false,
width: 160
width: width
)
}
} else {
ForEach(buyProducts) { product in
ProductItemView(
product: product,
isLikeButtonExist: false,
width: 160
width: width
)
}
}
}
.frame(height: 254)
}
.padding(.horizontal, 20)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ struct SearchView: View {
@State var sellProducts = ProductModel.sellDummyList()
@State var buyProducts = ProductModel.buyDummyList()

let width = (UIScreen.main.bounds.width - 55) / 2

//MARK: - Properties

private let columns = [
GridItem(.flexible(), spacing: 15),
GridItem(.flexible(), spacing: 15)
GridItem(.flexible())
]

//MARK: - Main Body
Expand Down Expand Up @@ -134,20 +136,19 @@ extension SearchView {
ProductItemView(
product: product,
isLikeButtonExist: true,
width: 160
width: width
)
}
} else if selectedIndex == 1 {
ForEach(buyProducts) { product in
ProductItemView(
product: product,
isLikeButtonExist: true,
width: 160
width: width
)
}
}
}
.frame(height: 254)
}
}
.padding(.horizontal, 20)
Expand Down

0 comments on commit b5bda07

Please sign in to comment.