Skip to content

Commit

Permalink
✨[feat]: qa 수정완료
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy-wonji committed Aug 31, 2024
1 parent 408bafd commit 05b483d
Show file tree
Hide file tree
Showing 13 changed files with 677 additions and 833 deletions.
81 changes: 81 additions & 0 deletions OPeace/OPeace.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,287 changes: 520 additions & 767 deletions OPeace/Projects/App/OPeace.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
Expand Down Expand Up @@ -44,12 +44,10 @@
disableMainThreadChecker = "YES">
<TestPlans>
<TestPlanReference
default = "YES"
reference = "container:OPeaceTests/Sources/OPeaceTestPlan.xctestplan">
reference = "container:OPeaceTests/Sources/OPeaceTestPlan.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,28 +143,28 @@ public struct SignUpPaging {
switch AsyncAction {

case .updateUserInfo(let nickname, let year, let job, let generation):
return .run { @MainActor send in
return .run { send in
let userInfoResult = await Result {
try await signUpUseCase.updateUserInfo(nickname: nickname, year: year, job: job, generation: generation)
}

switch userInfoResult {
case .success(let updateUserInfoData):
if let updateUserInfoData = updateUserInfoData {
send(.async(.updateUserInfoResponse(.success(updateUserInfoData))))
await send(.async(.updateUserInfoResponse(.success(updateUserInfoData))))

send(.view(.closePopUp))
await send(.view(.closePopUp))

try await clock.sleep(for: .seconds(1))
if updateUserInfoData.data?.isFirstLogin == false {
send(.navigation(.presntOnboarding))
await send(.navigation(.presntOnboarding))
} else {
send(.navigation(.presntMainHome))
await send(.navigation(.presntMainHome))
}
}

case .failure(let error):
send(.async(.updateUserInfoResponse(.failure(CustomError.map(error)))))
await send(.async(.updateUserInfoResponse(.failure(CustomError.map(error)))))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ extension WriteQuestionView {
VStack {
Spacer()
.frame(height: 16)

if store.isInuputEmoji {
HStack {
Spacer()
.frame(width: UIScreen.screenWidth * 0.4)
.frame(width: UIScreen.main.bounds.width * 0.4)

EmojiTextField(
text: $store.selectEmojiText,
emojiImage: $store.emojiImage,
Expand All @@ -103,30 +103,36 @@ extension WriteQuestionView {
if newValue.count == 1, newValue.unicodeScalars.allSatisfy({ $0.properties.isEmoji }) {
self.store.emojiImage = Image.emojiToImage(emoji: newValue)
store.isInuputEmoji = false
store.isActiveEmoji = false
} else {
store.selectEmojiText = ""
}
}
.focused($isFocused)
.opacity(store.isActiveEmoji ? 0.1 : 0)
.overlay {
if store.isActiveEmoji {
Image(asset: .activeEmojiI)
.resizable()
.scaledToFit()
.frame(width: 80, height: 80)
.onTapGesture {
// Return to text field view
store.isActiveEmoji = false
store.isInuputEmoji = true
isFocused = true
}
.offset(x: -70)
}
}


Spacer()
}

UnderlineView(text: store.selectEmojiText.isEmpty ? "😀" : store.selectEmojiText)

}
else if store.isActiveEmoji {
Circle()
.fill(Color.gray500)
.frame(width: 80, height: 80)
.overlay(alignment: .center) {
Image(asset: .activeEmojiI)
.resizable()
.scaledToFit()
}

}
else if let emojiImage = store.emojiImage {

} else if let emojiImage = store.emojiImage {
emojiImage
.resizable()
.frame(width: 80, height: 80)
Expand All @@ -135,6 +141,7 @@ extension WriteQuestionView {
UIApplication.shared.sendAction(#selector(UIResponder.becomeFirstResponder), to: nil, from: nil, for: nil)
store.isInuputEmoji.toggle()
store.selectEmojiText = ""
store.isActiveEmoji.toggle()
isFocused.toggle()
}
.offset(x: 10)
Expand All @@ -150,14 +157,15 @@ extension WriteQuestionView {
.onTapGesture {
store.isInuputEmoji.toggle()
isFocused.toggle()
store.isActiveEmoji.toggle()
UIApplication.shared.sendAction(#selector(UIResponder.becomeFirstResponder), to: nil, from: nil, for: nil)
}
}
}
}
.padding()
}


@ViewBuilder
private func wittingQustionView() -> some View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ extension EditProfileView {
}

Spacer()
.frame(height: 12)
.frame(height: 8)

UnderlineView(text: store.editProfileName.isEmpty ? store.profileName : store.editProfileName)

Expand All @@ -116,7 +116,7 @@ extension EditProfileView {
private func erorNIckCheckText() -> some View {
VStack {
Spacer()
.frame(height: 16)
.frame(height: 12)

if store.editProfileName.isEmpty {
Text(store.checkNickNameMessage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public struct CustomButton: View {
.frame(height: config.frameHeight)
.overlay {
Text(title)
.pretendardFont(family: .Regular, size: 20)
.pretendardFont(family: .SemiBold, size: 20)
.foregroundColor(isEnable ? config.enableFontColor : config.disableFontColor)
}
.onTapGesture {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public struct NavigationBackButton: View {

public var body: some View {
HStack {
Spacer()
.frame(width: 19)

Image(asset: .arrowLeft)
.resizable()
.scaledToFit()
Expand All @@ -30,6 +33,5 @@ public struct NavigationBackButton: View {
Spacer()

}
.padding(.horizontal, 20)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public struct CustomTitleNaviagionBackButton: View {

public var body: some View {
HStack {
Spacer()
.frame(width: 19)

Image(asset: .arrowLeft)
.resizable()
.scaledToFit()
Expand All @@ -35,10 +38,11 @@ public struct CustomTitleNaviagionBackButton: View {
Text(title)
.pretendardFont(family: .SemiBold, size: 20)
.foregroundStyle(Color.gray200)
.offset(x: -10)

Spacer()


}
.padding(.horizontal, 20)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

import SwiftUI
import Utill

public struct UnderlineView: View {
var text: String
Expand All @@ -17,33 +16,33 @@ public struct UnderlineView: View {

public var body: some View {
GeometryReader { geometry in
let textWidth = calculateUnderlineWidth(text: text)
let textWidth = calculateUnderlineWidth(text: text)
RoundedRectangle(cornerRadius: 1)
.fill(Color.basicWhite)
.frame(width: textWidth, height: 2)
.offset(x: (geometry.size.width - textWidth) / 2)
}
}


private func calculateUnderlineWidth(text: String) -> CGFloat {
let baseWidth: CGFloat = 83
let extraWidthPerCharacter: CGFloat = 20
let koreanCharacterFactor: CGFloat = 0.8
let baseWidthForThreeCharacters: CGFloat = 125
let baseCharacterCount = 3

let widthPerCharacter: CGFloat = baseWidthForThreeCharacters / CGFloat(baseCharacterCount)
var totalWidth: CGFloat = 0

var totalWidth = baseWidth
for char in text {
if isKoreanCharacter(char) {
totalWidth += extraWidthPerCharacter * koreanCharacterFactor
totalWidth += widthPerCharacter * 0.8
} else {
totalWidth += extraWidthPerCharacter
totalWidth += widthPerCharacter
}
}
return totalWidth
return max(totalWidth, widthPerCharacter * CGFloat(text.count))
}

private func isKoreanCharacter(_ char: Character) -> Bool {
return ("\u{AC00}" <= char && char <= "\u{D7A3}") || ("\u{1100}" <= char && char <= "\u{11FF}")
}
}


Loading

0 comments on commit 05b483d

Please sign in to comment.