Skip to content

Commit

Permalink
[#131] 프로필 뷰 수정 및 보낸 제안 연결
Browse files Browse the repository at this point in the history
  • Loading branch information
ubeeni committed Feb 18, 2024
1 parent 0d88cfe commit 3db6c9a
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 32 deletions.
63 changes: 48 additions & 15 deletions Spon-us/View/ProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,69 @@ import SwiftUI
struct ProfileView: View {
@Binding var rootIsActive: Bool
var organizationId: Int
@ObservedObject var organizationViewModel: OrganizationViewModel = OrganizationViewModel()

@StateObject var organizationViewModel: OrganizationViewModel = OrganizationViewModel()

var body: some View {
VStack(spacing: 0) {

ScrollView {

Image("TestImage")
.resizable()
ZStack(alignment: .bottomLeading) {
AsyncImageView(url: URL(string: organizationViewModel.organization?.imageUrl ?? "profile_test"))
.aspectRatio(contentMode: .fill)
.frame(maxWidth: .infinity, maxHeight: 540)
.clipped()
.padding(.bottom, 40)

Rectangle()
.foregroundColor(.clear)
.frame(maxWidth: .infinity).frame(height: 178)
.background(
LinearGradient(
stops: [
Gradient.Stop(color: Color(red: 0.13, green: 0.13, blue: 0.13).opacity(0), location: 0.00),
Gradient.Stop(color: Color(red: 0.13, green: 0.13, blue: 0.13).opacity(0.45), location: 0.55),
Gradient.Stop(color: Color(red: 0.13, green: 0.13, blue: 0.13).opacity(0.9), location: 1.00),
],
startPoint: UnitPoint(x: 0.5, y: 0),
endPoint: UnitPoint(x: 0.5, y: 1)
)
)

VStack(alignment:.leading, spacing: 8) {
Text(organizationViewModel.organization?.suborganizationType ?? "")
.font(.English15)
.foregroundColor(Color.sponusPrimary)
.padding(.horizontal, 10)
.padding(.vertical, 4)
.background(
RoundedRectangle(cornerRadius: 99)
.foregroundColor(Color.sponusSecondary)
)

Text(organizationViewModel.organization?.name ?? "")
.font(.Heading01)
.foregroundColor(Color.sponusWhite)
.padding(.bottom, 25)
}
.padding(.leading, 40)
}

VStack(alignment: .leading, spacing: 16){

Text(organizationViewModel.organization?.name ?? "안불러와짐.")
Text("단체 소개")
.font(.Heading09)
.padding(.top, 40)

SponUsDivider()
.padding(.bottom, 8)

Text(organizationViewModel.organization?.description ?? "안불러와짐.")
Text(organizationViewModel.organization?.description ?? "")
.multilineTextAlignment(.leading)
.font(.Body10)
.foregroundColor(Color.sponusGrey800)
.padding(.trailing, 20)
.padding(.bottom, 24)

Text("기업 정보")
Text("단체 정보")
.font(.Heading09)

SponUsDivider()
Expand All @@ -46,6 +81,7 @@ struct ProfileView: View {
ProfileSNSView()
.padding(.bottom, 24)

/*
Text("활동 기록")
.font(.Heading09)

Expand All @@ -59,7 +95,7 @@ struct ProfileView: View {
.padding(.bottom, 4)

ProfileHistoryCell(stateMessage: "완료된 공고")

*/

}
.foregroundColor(Color.sponusBlack)
Expand All @@ -80,9 +116,6 @@ struct ProfileView: View {
.foregroundStyle(.black)
}))
}



}

struct ProfileSNSView: View {
Expand Down Expand Up @@ -131,12 +164,12 @@ struct ProfileSNSView: View {


func openInstagram() {
let instagramUrl = URL(string: "instagram://user?username=inseong53")!
let instagramUrl = URL(string: "instagram://user?username=sponus_official")!
if UIApplication.shared.canOpenURL(instagramUrl) {
UIApplication.shared.open(instagramUrl, options: [:], completionHandler: nil)
} else {
// Instagram 앱이 설치되어 있지 않을 경우, 웹사이트를 열 수 있습니다.
let webUrl = URL(string: "https://www.instagram.com/inseong53/")!
let webUrl = URL(string: "https://www.instagram.com/sponus_official/")!
UIApplication.shared.open(webUrl, options: [:], completionHandler: nil)
}
}
Expand Down
33 changes: 17 additions & 16 deletions Spon-us/View/SendOffer/SendOfferPostView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,21 @@ struct SendOfferPostView: View {
.frame(height: 335)
.clipped()


NavigationLink {
// ProfileView(rootIsActive: $rootIsActive)
Text("더미 채우기")
} label: {
HStack {
Text(proposalDetailViewModel.proposalDetail?.proposedOrganizationName ?? "")
.font(.Body10)
.foregroundColor(Color.sponusPrimary)

Image("ic_go_blue")
.frame(width: 16, height: 16)
NavigationLink(
destination: ProfileView(rootIsActive: .constant(false), organizationId: proposalDetailViewModel.proposalDetail?.proposingOrganizationId ?? 1),
//isActive: .constant(selectedProposeId == proposalDetailViewModel.proposalDetail?.proposingOrganizationId),
label: {
HStack {
Text(proposalDetailViewModel.proposalDetail?.proposingOrganizationName ?? "")
.font(.Body10)
.foregroundColor(Color.sponusPrimary)

Image("ic_go_blue")
.frame(width: 16, height: 16)
}
.padding(.top, 23)
}
}.padding(.top, 23)
)

Text(proposalDetailViewModel.proposalDetail?.title ?? "")
.font(.Heading05)
Expand Down Expand Up @@ -99,6 +100,9 @@ struct SendOfferPostView: View {
}
.background(Color.sponusBlack)
}
.onAppear(){
proposalDetailViewModel.fetchProposalDetail(proposeId: proposeId)
}
.gesture(
DragGesture().onEnded { value in
if value.translation.width > 100 {
Expand All @@ -114,9 +118,6 @@ struct SendOfferPostView: View {
.renderingMode(.template)
.foregroundStyle(.black)
}))
.onAppear(){
proposalDetailViewModel.fetchProposalDetail(proposeId: proposeId)
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion Spon-us/View/SendOffer/SendOfferView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ struct SendOfferCell: View {

NavigationLink(
destination: SendOfferPostView(proposeId: propose.proposeId, rootIsActive: $rootIsActive),
isActive: .constant(selectedProposeId == propose.proposeId),
//isActive: .constant(selectedProposeId == propose.proposeId),
label: {
HStack {
Text("보낸 제안서")
Expand Down

0 comments on commit 3db6c9a

Please sign in to comment.