Skip to content
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

๐Ÿ”€ :: ๋””ํ…Œ์ผ ํŽ˜์ด์ง€ ์ˆ˜์ • #250

Merged
merged 14 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import SwiftUI
import ViewUtil
import FoundationUtil

public struct SMSIconTextField<Content: View>: View {
@Binding var text: String
Expand Down Expand Up @@ -43,7 +44,7 @@ public struct SMSIconTextField<Content: View>: View {
.buttonWrapper {
text = ""
}
.conditional(!text.isEmpty && isOnClear)
.conditional(text.isNotEmpty && isOnClear)
}
.padding(.horizontal, 12)
.frame(height: 48)
Expand All @@ -58,7 +59,7 @@ public struct SMSIconTextField<Content: View>: View {
isFocused = true
}

ConditionView(isError && !errorText.isEmpty) {
ConditionView(isError && errorText.isNotEmpty) {
Text(errorText)
.padding(.leading, 8)
.smsFont(.caption1, color: .error(.e2))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public struct SMSTextField: View {
.buttonWrapper {
text = ""
}
.conditional(!text.isEmpty && isOnClear)
.conditional(text.isNotEmpty && isOnClear)
}
.padding(.horizontal, 12)
.frame(height: 48)
Expand All @@ -53,7 +53,7 @@ public struct SMSTextField: View {
isFocused = true
}

ConditionView(isError && !errorText.isEmpty) {
ConditionView(isError && errorText.isNotEmpty) {
Text(errorText)
.padding(.leading, 8)
.smsFont(.caption1, color: .error(.e2))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extension AuthEndpoint: SMSEndpoint {

var jwtTokenType: JwtTokenType {
switch self {
case .withdrawal, .verifyIsExistUser:
case .withdrawal, .verifyIsExistUser, .logout:
return .accessToken

case .refresh:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import ViewUtil
struct InputProjectInfoView: View {
@FocusState var projectContentIsFocused: Bool
@StateObject var container: MVIContainer<InputProjectInfoIntentProtocol, InputProjectInfoStateProtocol>
@Environment(\.screenSize) var screenSize
var intent: any InputProjectInfoIntentProtocol { container.intent }
var state: any InputProjectInfoStateProtocol { container.model }
private let techStackAppendBuildable: any TechStackAppendBuildable
Expand Down Expand Up @@ -60,6 +61,7 @@ struct InputProjectInfoView: View {
}
.padding([.top, .horizontal], 20)
}
.frame(minHeight: screenSize.height)
}
}
.imagePicker(
Expand Down Expand Up @@ -149,6 +151,8 @@ struct InputProjectInfoView: View {

projectContentTextEditor(index: index)

projectMyActivityTextEditor(index: index)

projectTechStack(geometry: geometry, index: index)

projectDuration(index: index)
Expand Down Expand Up @@ -267,15 +271,47 @@ private extension InputProjectInfoView {
)
.overlay(alignment: .topLeading) {
ConditionView(projectContent.isEmpty) {
SMSText("ํ”„๋กœ์ ํŠธ ๋‚ด์šฉ ์ž…๋ ฅ", font: .body1)
SMSText("ํ”„๋กœ์ ํŠธ ๋‚ด์šฉ ์„œ์ˆ ", font: .body1)
.foregroundColor(.sms(.neutral(.n30)))
.padding([.top, .leading], 12)
.onTapGesture {
projectContentIsFocused = true
}
}
}
.titleWrapper("ํ”„๋กœ์ ํŠธ ์„ค๋ช…")
}

@ViewBuilder
func projectMyActivityTextEditor(index: Int) -> some View {
let projectMyActivity = state.projectList[safe: index]?.mainTask ?? ""
TextEditor(
text: Binding(
get: { projectMyActivity },
set: { intent.updateProjectMainTask(index: index, mainTask: $0) }
)
)
.smsFont(.body1, color: .system(.black))
.focused($projectContentIsFocused)
.colorMultiply(.sms(.neutral(.n10)))
.frame(minHeight: 48)
.cornerRadius(8)
.roundedStroke(
cornerRadius: 8,
color: projectContentIsFocused ? .sms(.primary(.p1)) : .clear,
lineWidth: projectContentIsFocused ? 1 : 0
)
.overlay(alignment: .topLeading) {
ConditionView(projectMyActivity.isEmpty) {
SMSText("์ฃผ์š” ์ž‘์—… ๋‚ด์šฉ ์„œ์ˆ ", font: .body1)
.foregroundColor(.sms(.neutral(.n30)))
.padding([.top, .leading], 12)
.onTapGesture {
projectContentIsFocused = true
}
}
}
.titleWrapper("๋‚ด์šฉ")
.titleWrapper("์ฃผ์š” ์ž‘์—… ์„œ์ˆ ")
}

@ViewBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class InputWorkInfoModel: ObservableObject, InputWorkInfoStateProtocol {
@Published var formOfEmployment: FormOfEmployment = .fullTime
@Published var isPresentedFormOfEmployeementSheet: Bool = false
var salaryDisplay: String {
guard !salary.isEmpty else { return "์ƒ๊ด€์—†์Œ" }
guard salary.isNotEmpty else { return "์ƒ๊ด€์—†์Œ" }
return "\(numberFormatter.string(for: Int(salary)) ?? "0") ๋งŒ์›"
}
}
Expand Down
8 changes: 4 additions & 4 deletions Projects/Feature/MainFeature/Sources/Scene/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct MainView: View {
profileImageUrl: item.profileImageURL,
name: item.name,
major: item.major,
techStack: item.techStacks
techStacks: item.techStacks
)
.foregroundColor(.sms(.system(.black)))
.buttonWrapper {
Expand Down Expand Up @@ -186,11 +186,11 @@ struct MainView: View {
profileImageUrl: String,
name: String,
major: String,
techStack: [String]
techStacks: [String]
) -> some View {
HStack(spacing: 12) {
Group {
if !profileImageUrl.isEmpty, let imageURL = URL(string: profileImageUrl) {
if profileImageUrl.isNotEmpty, let imageURL = URL(string: profileImageUrl) {
LazyImage(url: imageURL) { state in
if let image = state.image {
image
Expand All @@ -212,7 +212,7 @@ struct MainView: View {
SMSText(major, font: .body2)
.padding(.bottom, 16)

techStackListView(techStack: techStack)
techStackListView(techStack: techStacks)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ struct MyPageProjectView: View {

projectContentTextEditor(index: index)

projectMyActivityTextEditor(index: index)

projectTechStack(geometry: geometry, index: index)

projectDuration(index: index)
Expand Down Expand Up @@ -219,15 +221,47 @@ private extension MyPageProjectView {
)
.overlay(alignment: .topLeading) {
ConditionView(projectContent.isEmpty) {
SMSText("ํ”„๋กœ์ ํŠธ ๋‚ด์šฉ ์ž…๋ ฅ", font: .body1)
SMSText("ํ”„๋กœ์ ํŠธ ๋‚ด์šฉ ์„œ์ˆ ", font: .body1)
.foregroundColor(.sms(.neutral(.n30)))
.padding([.top, .leading], 12)
.onTapGesture {
projectContentIsFocused = true
}
}
}
.titleWrapper("ํ”„๋กœ์ ํŠธ ์„ค๋ช…")
}

@ViewBuilder
func projectMyActivityTextEditor(index: Int) -> some View {
let projectMyActivity = state.projectList[safe: index]?.mainTask ?? ""
TextEditor(
text: Binding(
get: { projectMyActivity },
set: { intent.updateProjectMainTask(index: index, mainTask: $0) }
)
)
.smsFont(.body1, color: .system(.black))
.focused($projectContentIsFocused)
.colorMultiply(.sms(.neutral(.n10)))
.frame(minHeight: 48)
.cornerRadius(8)
.roundedStroke(
cornerRadius: 8,
color: projectContentIsFocused ? .sms(.primary(.p1)) : .clear,
lineWidth: projectContentIsFocused ? 1 : 0
)
.overlay(alignment: .topLeading) {
ConditionView(projectMyActivity.isEmpty) {
SMSText("์ฃผ์š” ์ž‘์—… ๋‚ด์šฉ ์„œ์ˆ ", font: .body1)
.foregroundColor(.sms(.neutral(.n30)))
.padding([.top, .leading], 12)
.onTapGesture {
projectContentIsFocused = true
}
}
}
.titleWrapper("๋‚ด์šฉ")
.titleWrapper("์ฃผ์š” ์ž‘์—… ์„œ์ˆ ")
}

@ViewBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct StudentDetailView: View {
ZStack(alignment: .topTrailing) {
VStack {
Group {
if let studentDetail, !studentDetail.profileImageURL.isEmpty {
if let studentDetail, studentDetail.profileImageURL.isNotEmpty {
LazyImage(url: URL(string: studentDetail.profileImageURL)) { state in
if let image = state.image {
image.resizable()
Expand Down Expand Up @@ -188,24 +188,32 @@ struct StudentDetailView: View {
studentInfoForTeacher(geometry: geometry, detailInfo: detailInfoByTeacher)
}

VStack(spacing: 8) {
ForEach(studentDetail?.prizes ?? [], id: \.self) { prize in
PrizeRowView(prize: prize)
ConditionView(state.userRole == .teacher) {
Spacer().frame(height: 40)
}

ConditionView(studentDetail?.prizes.isNotEmpty ?? false) {
VStack(spacing: 8) {
ForEach(studentDetail?.prizes ?? [], id: \.self) { prize in
PrizeRowView(prize: prize)
}
}
.studentDetailTitleWrapper(title: "์ˆ˜์ƒ")

Spacer().frame(height: 40)
}
.studentDetailTitleWrapper(title: "์ˆ˜์ƒ")

VStack(spacing: 32) {
ForEach(studentDetail?.projects ?? [], id: \.self) { project in
ProjectRowView(project: project)
ConditionView(studentDetail?.projects.isNotEmpty ?? false) {
VStack(spacing: 32) {
ForEach(studentDetail?.projects ?? [], id: \.self) { project in
ProjectRowView(project: project)
}
}
.studentDetailTitleWrapper(title: "ํ”„๋กœ์ ํŠธ")
}
.studentDetailTitleWrapper(title: "ํ”„๋กœ์ ํŠธ")
}

Color.sms(.system(.white))
.frame(height: 300)
.conditional(state.userRole != .teacher)
Spacer().frame(height: 120)
}
}
.padding(.horizontal, 20)
.background {
Expand Down Expand Up @@ -258,10 +266,10 @@ struct StudentDetailView: View {
value: detailInfo.regions.joined(separator: ", "),
geometry: geometry
)
.conditional(!detailInfo.regions.isEmpty)
.conditional(detailInfo.regions.isNotEmpty)

SMSSeparator(.neutral(.n20), height: 1)
.conditional(!detailInfo.languageCertificate.isEmpty)
.conditional(detailInfo.languageCertificate.isNotEmpty)
}

Group {
Expand All @@ -270,19 +278,17 @@ struct StudentDetailView: View {
}

SMSSeparator(.neutral(.n20), height: 1)
.conditional(!detailInfo.certificate.isEmpty)
.conditional(detailInfo.certificate.isNotEmpty)
}

studentInfoRowView(
name: "์ž๊ฒฉ์ฆ",
value: detailInfo.certificate.joined(separator: "\n"),
geometry: geometry
)
.conditional(!detailInfo.certificate.isEmpty)

Spacer().frame(height: 120)
.conditional(detailInfo.certificate.isNotEmpty)
}
.studentDetailTitleWrapper(title: "์ˆ˜์ƒ")
.studentDetailTitleWrapper(title: "์„ธ๋ถ€์ •๋ณด")
}

@ViewBuilder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import DesignSystem
import SwiftUI
import StudentDomainInterface
import ViewUtil

struct PrizeRowView: View {
let prize: PrizeEntity
Expand All @@ -16,17 +17,23 @@ struct PrizeRowView: View {

VStack(alignment: .leading, spacing: 8) {
HStack(alignment: .top) {
SMSText(prize.name)
.foregroundColor(.sms(.system(.black)))
ConditionView(prize.name.isNotEmpty) {
SMSText(prize.name)
.foregroundColor(.sms(.system(.black)))
}

Spacer()

SMSText(prize.date, font: .caption2)
.foregroundColor(.sms(.system(.black)))
ConditionView(prize.date.isNotEmpty) {
SMSText(prize.date, font: .caption2)
.foregroundColor(.sms(.system(.black)))
}
}

SMSText(prize.type, font: .caption2)
.foregroundColor(.sms(.neutral(.n40)))
ConditionView(prize.type.isNotEmpty) {
SMSText(prize.type, font: .caption2)
.foregroundColor(.sms(.neutral(.n40)))
}
}
.padding(8)
}
Expand Down
Loading