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

[Design/#232] 인증탭 리디자인 #253

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 10 additions & 10 deletions ILSANG.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
606292D82C19E70A0098B6D2 /* Network.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606292D72C19E70A0098B6D2 /* Network.swift */; };
606292DD2C19EAB00098B6D2 /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = 606292DC2C19EAB00098B6D2 /* Alamofire */; };
606C21CC2CC6B4FC00803947 /* SubmitStatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606C21CB2CC6B4FC00803947 /* SubmitStatusView.swift */; };
606C87AF2C0B9B8C002D5C3E /* ApprovalImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606C87AE2C0B9B8C002D5C3E /* ApprovalImageView.swift */; };
606C87AF2C0B9B8C002D5C3E /* ApprovalItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 606C87AE2C0B9B8C002D5C3E /* ApprovalItemView.swift */; };
606C87B12C0CC89B002D5C3E /* 2406_TERMS_OF_USE.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 606C87B02C0CC89B002D5C3E /* 2406_TERMS_OF_USE.pdf */; };
607FCBD42BFA648000BB2D04 /* Tab.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FCBD32BFA648000BB2D04 /* Tab.swift */; };
607FCBD62BFA660C00BB2D04 /* MainTabView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FCBD52BFA660C00BB2D04 /* MainTabView.swift */; };
Expand Down Expand Up @@ -199,7 +199,7 @@
6061327A2CDB33FD00830948 /* FilterPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterPicker.swift; sourceTree = "<group>"; };
606292D72C19E70A0098B6D2 /* Network.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Network.swift; sourceTree = "<group>"; };
606C21CB2CC6B4FC00803947 /* SubmitStatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubmitStatusView.swift; sourceTree = "<group>"; };
606C87AE2C0B9B8C002D5C3E /* ApprovalImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApprovalImageView.swift; sourceTree = "<group>"; };
606C87AE2C0B9B8C002D5C3E /* ApprovalItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApprovalItemView.swift; sourceTree = "<group>"; };
606C87B02C0CC89B002D5C3E /* 2406_TERMS_OF_USE.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 2406_TERMS_OF_USE.pdf; sourceTree = "<group>"; };
607FCBD32BFA648000BB2D04 /* Tab.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tab.swift; sourceTree = "<group>"; };
607FCBD52BFA660C00BB2D04 /* MainTabView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainTabView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -476,7 +476,7 @@
isa = PBXGroup;
children = (
607FCBD72BFA681500BB2D04 /* ApprovalView.swift */,
606C87AE2C0B9B8C002D5C3E /* ApprovalImageView.swift */,
606C87AE2C0B9B8C002D5C3E /* ApprovalItemView.swift */,
60943FE52C0A38FB00C8A714 /* ApprovalViewModel.swift */,
);
path = Approval;
Expand Down Expand Up @@ -944,7 +944,7 @@
A1F0ADC02CD738C30068E0A6 /* Polygon.swift in Sources */,
603F04132C26ADC6008A2332 /* CommonResponse.swift in Sources */,
607FCBE42BFD124900BB2D04 /* QuestItemView.swift in Sources */,
606C87AF2C0B9B8C002D5C3E /* ApprovalImageView.swift in Sources */,
606C87AF2C0B9B8C002D5C3E /* ApprovalItemView.swift in Sources */,
60943FE62C0A38FB00C8A714 /* ApprovalViewModel.swift in Sources */,
60C6B4DC2C2D042700926C0E /* Image.swift in Sources */,
A18EB9B02C26B61C00405D56 /* WithdrawNetwork.swift in Sources */,
Expand Down Expand Up @@ -1117,7 +1117,7 @@
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ILSANG/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "일상";
INFOPLIST_KEY_CFBundleDisplayName = "$(APP_NAME)";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.lifestyle";
INFOPLIST_KEY_NSCameraUsageDescription = "일상은 퀘스트 인증 사진을 촬영하기 위해 카메라 접근 권한이 필요합니다.\n계속하려면 카메라 접근 권한을 허용해주세요.";
INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "일상은 촬영한 퀘스트 인증 사진을 저장하기 위해 앨범 접근 권한이 필요합니다.\n계속하려면 앨범 접근 권한을 허용해주세요.";
Expand All @@ -1134,7 +1134,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.3.1;
MARKETING_VERSION = 1.3.2;
PRODUCT_BUNDLE_IDENTIFIER = "$(APP_BUNDLE_ID)";
"PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*]" = com.ilsang240615.dev;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -1324,7 +1324,7 @@
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ILSANG/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "일상";
INFOPLIST_KEY_CFBundleDisplayName = "$(APP_NAME)";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.lifestyle";
INFOPLIST_KEY_NSCameraUsageDescription = "일상은 퀘스트 인증 사진을 촬영하기 위해 카메라 접근 권한이 필요합니다.\n계속하려면 카메라 접근 권한을 허용해주세요.";
INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "일상은 촬영한 퀘스트 인증 사진을 저장하기 위해 앨범 접근 권한이 필요합니다.\n계속하려면 앨범 접근 권한을 허용해주세요.";
Expand All @@ -1341,7 +1341,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.3.1;
MARKETING_VERSION = 1.3.2;
PRODUCT_BUNDLE_IDENTIFIER = "$(APP_BUNDLE_ID)";
"PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*]" = com.ilsang240615.dev;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -1368,7 +1368,7 @@
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ILSANG/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "일상";
INFOPLIST_KEY_CFBundleDisplayName = "$(APP_NAME)";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.lifestyle";
INFOPLIST_KEY_NSCameraUsageDescription = "일상은 퀘스트 인증 사진을 촬영하기 위해 카메라 접근 권한이 필요합니다.\n계속하려면 카메라 접근 권한을 허용해주세요.";
INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "일상은 촬영한 퀘스트 인증 사진을 저장하기 위해 앨범 접근 권한이 필요합니다.\n계속하려면 앨범 접근 권한을 허용해주세요.";
Expand All @@ -1385,7 +1385,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.3.1;
MARKETING_VERSION = 1.3.2;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
Expand Down
7 changes: 0 additions & 7 deletions ILSANG.xcodeproj/xcshareddata/xcschemes/ILSANG.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@
ReferencedContainer = "container:ILSANG.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
<AdditionalOption
key = "NSZombieEnabled"
value = "YES"
isEnabled = "YES">
</AdditionalOption>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Debug"
Expand Down

This file was deleted.

Binary file modified ILSANG/Resources/Assets.xcassets/Image/share.imageset/share.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "syren.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "thumb_down.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"images" : [
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
4 changes: 2 additions & 2 deletions ILSANG/Sources/Network/Base/Network.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ final class Network {
} else {
request = AF.request(fullPath, method: method, encoding: parameters != nil ? URLEncoding.queryString : JSONEncoding.default, headers: headers)
}
Log(fullPath)

let response = await request.validate(statusCode: 200..<300)
.serializingDecodable(T.self, emptyResponseCodes: [200])
.response

switch response.result {
case .success(let res):
Log("네트워크 요청 성공: \(fullPath), \(request.request?.httpMethod ?? "")")
return .success(res)
case .failure(let error):
Log(error.localizedDescription)
Log("네트워크 요청 실패: \(fullPath), \(error.localizedDescription)")
return .failure(error)
}
}
Expand Down
140 changes: 140 additions & 0 deletions ILSANG/Sources/Views/Approval/ApprovalItemView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
//
// ApprovalImageView.swift
// ILSANG
//
// Created by Lee Jinhee on 6/2/24.
//

import SwiftUI

struct ApprovalItemView: View {
let item: ApprovalViewModelItem

let width: CGFloat
let height: CGFloat

let padding: CGFloat
let onLike: () -> Void
let onHate: () -> Void

var body: some View {
VStack(alignment: .leading, spacing: 16) {
ApprovalItemContentView(item: item, width: width, height: height)

HStack(spacing: 8) {
emojiButton(
imageName: .thumbsDown,
active: item.emoji?.isHate ?? false,
activeFgColor: .primary300,
activeBgColor: .primary100,
action: { onHate() }
)
emojiButton(
imageName: .thumbsUp,
active: item.emoji?.isLike ?? false,
activeFgColor: .white,
activeBgColor: .primaryPurple,
action: { onLike() }
)
}
}
.padding(padding)
.background(Color.white)
.cornerRadius(12)
}

private func emojiButton(
imageName: UIImage,
active: Bool,
activeFgColor: Color,
activeBgColor: Color,
action: @escaping () -> ()
) -> some View {
Button {
action()
} label: {
Image(uiImage: imageName)
.resizable()
.renderingMode(.template)
.frame(width: 27, height: 24)
.foregroundStyle(active ? activeFgColor : .gray300)
.frame(height: 50)
.frame(maxWidth: .infinity)
.background(
RoundedRectangle(cornerRadius: 12)
.frame(maxWidth: .infinity)
.foregroundStyle(active ? activeBgColor : .gray100)
)
}
}
}

struct ApprovalItemContentView: View {
let item: ApprovalViewModelItem

let width: CGFloat
let height: CGFloat

var body: some View {
VStack(alignment: .leading, spacing: 16) {
profileView(nickname: item.nickname, time: item.time)

Text(item.title)
.font(.system(size: 23, weight: .bold))
.frame(height: 24)
.foregroundStyle(.black)

Image(uiImage: item.image ?? .logo)
.resizable()
.scaledToFill()
.frame(width: width, height: height)
.clipShape(RoundedRectangle(cornerRadius: 12))
.allowsHitTesting(false)

HStack(spacing: 16) {
emojiView(imageName: .thumbsUp, count: item.likeCnt, alignment: .top)
emojiView(imageName: .thumbsDown, count: item.hateCnt, alignment: .bottom)
}
}
}

private func profileView(nickname: String, time: String) -> some View {
HStack(spacing: 10) {
Image(.profileCircle)
.resizable()
.frame(width: 35, height: 35)
VStack(alignment: .leading, spacing: 3) {
Text(nickname)
.font(.system(size: 14, weight: .semibold))
Text(time)
.font(.system(size: 12, weight: .regular))
}
.foregroundStyle(.gray500)
}
}

private func emojiView(imageName: UIImage, count: Int, alignment: Alignment) -> some View {
HStack(spacing: 4) {
Image(uiImage: imageName)
.resizable()
.renderingMode(.template)
.scaledToFit()
.frame(width: 21, height: 21)
.foregroundStyle(.gray200)
.frame(width: 24, height: 24, alignment: alignment)
Text(String(count))
.font(.system(size: 15, weight: .bold))
.foregroundStyle(.gray300)
}
.frame(height: 24)
}
}
#Preview {
ApprovalItemView(
item: .mockDataList[0],
width: .screenWidth-40,
height: 200,
padding: 20,
onLike: { },
onHate: { })
}
Loading