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 1 commit
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 @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ struct MainView: View {
) -> 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 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 @@ -192,7 +192,7 @@ struct StudentDetailView: View {
Spacer().frame(height: 40)
}

ConditionView(!(studentDetail?.prizes.isEmpty ?? false)) {
ConditionView(studentDetail?.prizes.isNotEmpty ?? false) {
VStack(spacing: 8) {
ForEach(studentDetail?.prizes ?? [], id: \.self) { prize in
PrizeRowView(prize: prize)
Expand All @@ -203,7 +203,7 @@ struct StudentDetailView: View {
Spacer().frame(height: 40)
}

ConditionView(!(studentDetail?.projects.isEmpty ?? false)) {
ConditionView(studentDetail?.projects.isNotEmpty ?? false) {
VStack(spacing: 32) {
ForEach(studentDetail?.projects ?? [], id: \.self) { project in
ProjectRowView(project: project)
Expand Down Expand Up @@ -266,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 @@ -278,15 +278,15 @@ 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)
.conditional(detailInfo.certificate.isNotEmpty)
}
.studentDetailTitleWrapper(title: "์„ธ๋ถ€์ •๋ณด")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ struct PrizeRowView: View {

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

Spacer()

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

ConditionView(!prize.type.isEmpty) {
ConditionView(prize.type.isNotEmpty) {
SMSText(prize.type, font: .caption2)
.foregroundColor(.sms(.neutral(.n40)))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ struct ProjectRowView: View {
VStack(spacing: 24) {
projectHeaderSection()

ConditionView(!project.previewImageURLs.isEmpty) {
ConditionView(project.previewImageURLs.isNotEmpty) {
projectPreviewsSection()
}

ConditionView(!project.techStacks.isEmpty) {
ConditionView(project.techStacks.isNotEmpty) {
projectTechStacksSection()
}

ConditionView(!project.description.isEmpty) {
ConditionView(project.description.isNotEmpty) {
proejctDescriptionSection()
}

ConditionView(!project.myActivity.isEmpty) {
ConditionView(project.myActivity.isNotEmpty) {
projectMyActivitySection()
}

ConditionView(!project.links.isEmpty) {
ConditionView(project.links.isNotEmpty) {
projectRelatedLinksSection()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct TechStackAppendView: View {
SMSChip("\"\(state.searchText)\" ์ง์ ‘ ์ถ”๊ฐ€ํ•˜๊ธฐ") {
intent.directAppendButtonDidTap(techStack: state.searchText)
}
.conditional(!state.selectedTechStacks.contains(state.searchText) && !state.searchText.isEmpty)
.conditional(!state.selectedTechStacks.contains(state.searchText) && state.searchText.isNotEmpty)
}
} else {
LazyVStack(spacing: 16) {
Expand All @@ -88,7 +88,7 @@ struct TechStackAppendView: View {
SMSChip("\"\(state.searchText)\" ์ง์ ‘ ์ถ”๊ฐ€ํ•˜๊ธฐ") {
intent.directAppendButtonDidTap(techStack: state.searchText)
}
.conditional(!state.selectedTechStacks.contains(state.searchText) && !state.searchText.isEmpty)
.conditional(!state.selectedTechStacks.contains(state.searchText) && state.searchText.isNotEmpty)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด๊ฑฐ๋„ notContains ๋งŒ๋“œ๋Š”๊ฑฐ ์–ด๋•Œ์š”?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ํ•ด๋‹น ์‚ฌํ•ญ์€ ํ˜„์žฌ ๋ธŒ๋žœ์น˜์—์„œ ์ง„ํ–‰ํ•˜๋Š”๊ฒƒ๋ณด๋‹ค ์ƒˆ๋กœ ์ด์Šˆ๋ฅผ ์ƒ์„ฑํ•ด์„œ ํ•˜๋Š”๊ฒƒ์ด ์ข‹์•„๋ณด์ž…๋‹ˆ๋‹ค.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด๋Ÿฐ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด์Šˆ ํŒŒ๋†“์•„์ฃผ์„ธ์š”

}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Foundation

public extension Collection {
var isNotEmpty: Bool {
!self.isEmpty
}
}
3 changes: 2 additions & 1 deletion Projects/Shared/Validator/Sources/RegexValidator.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Foundation
import FoundationUtil

public struct RegexValidator: Validator {
private let regexPattern: String
Expand All @@ -16,7 +17,7 @@ public struct RegexValidator: Validator {
}

public func validate(_ value: String) -> Bool {
guard !value.isEmpty, let regex = try? NSRegularExpression(
guard value.isNotEmpty, let regex = try? NSRegularExpression(
pattern: regexPattern,
options: regexOptions
) else { return false }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import SwiftUI
import FoundationUtil

public struct HighlightedText: View {
let text: String
Expand All @@ -20,7 +21,7 @@ public struct HighlightedText: View {

// swiftlint: disable shorthand_operator
public var body: some View {
guard !text.isEmpty && !highlightText.isEmpty else { return defaultModifier(Text(text)) }
guard text.isNotEmpty && highlightText.isNotEmpty else { return defaultModifier(Text(text)) }

var result: Text?
let parts = text.components(separatedBy: highlightText)
Expand Down