-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dtzer0/UI/main #20
base: dev
Are you sure you want to change the base?
Dtzer0/UI/main #20
Changes from 1 commit
f434e3e
dde99a0
6e48f8d
cbfb626
c97ce31
19fdff3
be19dde
63181c6
66d9a22
21f0274
09568e2
edf6e55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// | ||
// CommunityView.swift | ||
// MarketApp | ||
// | ||
// Created by 홍태희 on 2023/03/02. | ||
// | ||
|
||
import SwiftUI | ||
import ExytePopupView | ||
|
||
//MARK : 커뮤니티 | ||
let dateformat: DateFormatter = { | ||
let formatter = DateFormatter() | ||
formatter.dateFormat = "YYYY.MM.dd HH:MM:SS" | ||
return formatter | ||
}() | ||
|
||
struct CommunityBlock : View { | ||
var nickName : String | ||
var time = Date() | ||
var comment : String | ||
|
||
var body: some View { | ||
ZStack { | ||
Rectangle() | ||
.fill(.white) | ||
.frame(maxWidth: 360, minHeight: 70) | ||
.overlay { | ||
RoundedRectangle(cornerRadius: 20) | ||
.stroke(Color.black, lineWidth: 1) | ||
} | ||
|
||
VStack(alignment: .leading) { | ||
HStack { | ||
Text("\(nickName)님") | ||
.nanumSquareNeo(family: .cBd, size: 18, color: .black) | ||
Text("\(time, formatter: dateformat)") | ||
.nanumSquareNeo(family: .cBd, size: 15, color: .gray) | ||
} | ||
Text("\(comment)") | ||
.nanumSquareNeo(family: .cBd, size: 15, color: .black) | ||
} | ||
}.padding(.top, 10) | ||
} | ||
} | ||
|
||
struct WriteComments : View { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Dtzer0 한파일에 뷰가 두개가 있네요 파일 을 분해해서 각각 사용 하는 거 어떨까요 ?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 둘 다 커뮤니티 뷰에 속하는 뷰라서 하나에 다 넣은거에요! 하나는 댓글목록UI고 하나는 댓글textfield에요. |
||
@State private var comments = "" | ||
@State var backPop = false | ||
|
||
var body: some View { | ||
ZStack { | ||
HStack { | ||
TextField("댓글을 입력해주세요.", text: $comments) | ||
.padding() | ||
.background(Color(uiColor: .secondarySystemBackground)) | ||
.cornerRadius(20) | ||
|
||
Button(action: { | ||
//TODO : 문장 입력 후 완료 버튼을 누르면 CommunityBlock 뷰에 해당 문장이 올라가게끔 설계 | ||
}, label: { | ||
Text("올리기") | ||
.frame(width: 50) | ||
.nanumSquareNeo(family: .cBd, size: 15, color: .black) | ||
}) | ||
} | ||
}//동작안함. ( bp해두고 돌려봤을때는 잘찍힘 ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Dtzer0 button에서 액션을 해줘야 팝업이 나올거 같아요! |
||
.popup(isPresented: $backPop, type: .default, position: .top, animation: .spring(), dragToDismiss: true, closeOnTap: false, closeOnTapOutside: true) { | ||
Text("서비스 준비중이에요!") | ||
.frame(width: 300, height: 50) | ||
.backgroundStyle(.black) | ||
.cornerRadius(20) | ||
.nanumSquareNeo(family: .cBd, size: 20, color: .white) | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,84 +13,50 @@ struct ProductView: View { | |
@State private var buyThis = false | ||
|
||
var body: some View { | ||
VStack { | ||
ScrollView(.vertical, showsIndicators: true) { | ||
Image("shoes") | ||
.resizable() | ||
.frame(height: 350) | ||
|
||
HStack { | ||
VStack { | ||
Text("Maison Kitsune") | ||
.font(.system(size: 15, weight: .bold, design: .monospaced)) | ||
.frame(width: 250, height: 20, alignment: .leading) | ||
Text("더블 폭스 패치 스니커즈") | ||
.font(.system(size: 18, weight: .medium, design: .default)) | ||
.frame(width: 250, height: 20, alignment: .leading) | ||
Text("281,000원") | ||
.font(.system(size: 15, weight: .bold, design: .monospaced)) | ||
.frame(width: 250, height: 20, alignment: .leading) | ||
} | ||
|
||
VStack { | ||
Image(systemName: "star.fill").resizable() | ||
.frame(width: 30, height: 30, alignment: .center) | ||
.foregroundColor(.yellow) | ||
Text("4.5") | ||
.font(.system(size: 18, weight: .medium, design: .default)) | ||
}.frame(width: 50) | ||
|
||
VStack(alignment: .center) { | ||
Button(action: { | ||
//좋아요 액션 ( 클릭시 heart.fill ) | ||
}) { | ||
Image(systemName: "heart") | ||
.resizable() | ||
.renderingMode(.original) | ||
.frame(width: 30, height: 30) | ||
} | ||
|
||
Text("LIKE") | ||
.font(.system(size: 18, weight: .medium, design: .default)) | ||
}.frame(width: 50) | ||
} | ||
.padding(.top, 10) | ||
.padding(.bottom, 10) | ||
|
||
ScrollView { | ||
VStack { | ||
DetailInfo() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Dtzer0 코드가 짧아졌네용 ㅎㅎ 역시 점점 느시는 군요 |
||
InfoView() | ||
} | ||
.bounce(false) | ||
} | ||
} | ||
|
||
@ViewBuilder | ||
private func DetailInfo() -> some View { | ||
VStack { | ||
Image("shoes") | ||
.resizable() | ||
.frame(height: 350) | ||
|
||
HStack { | ||
Button(action: { | ||
//좋아요 액션 ( 클릭시 heart.fill ) | ||
}) { | ||
Image(systemName: "heart") | ||
.resizable() | ||
.renderingMode(.original) | ||
.frame(width: 30, height: 30) | ||
.padding(.trailing, 10) | ||
VStack { | ||
Text("Maison Kitsune") | ||
.font(.system(size: 15, weight: .bold, design: .monospaced)) | ||
.frame(width: 280, height: 20, alignment: .leading) | ||
Text("더블 폭스 패치 스니커즈") | ||
.font(.system(size: 18, weight: .medium, design: .default)) | ||
.frame(width: 280, height: 20, alignment: .leading) | ||
Text("281,000원") | ||
.font(.system(size: 15, weight: .bold, design: .monospaced)) | ||
.frame(width: 280, height: 20, alignment: .leading) | ||
} | ||
|
||
Button(action: { | ||
buyThis.toggle() | ||
}) { | ||
Text("구매") | ||
.font(.system(size: 22, weight: .medium, design: .default)) | ||
.frame(width: 280, height: 50) | ||
.padding(.leading, 10) | ||
.background(.black) | ||
.foregroundColor(.white) | ||
.sheet(isPresented: self.$buyThis) { | ||
if #available(iOS 16.0, *) { | ||
PopView() | ||
.presentationDetents([.height(300)]) | ||
} else { | ||
PopView() | ||
} | ||
} | ||
} | ||
}.padding(.bottom, 20) | ||
VStack(alignment: .center) { | ||
Button(action: { | ||
//좋아요 액션 ( 클릭시 heart.fill ) | ||
}) { | ||
Image(systemName: "heart") | ||
.resizable() | ||
.renderingMode(.original) | ||
.frame(width: 30, height: 30) | ||
} | ||
|
||
Text("LIKE") | ||
.font(.system(size: 18, weight: .medium, design: .default)) | ||
}.frame(width: 50) | ||
} | ||
.padding(.top, 10) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Dtzer0 이런 경우는 padding을 vertical을 주는거 어떨까요 ?? |
||
.padding(.bottom, 10) | ||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Dtzer0 여기는 공용 파일을 만들어서 분해 하는거 어떨까요 ??