diff --git a/Projects/Features/MemeEditor/Project.swift b/Projects/Features/MemeEditor/Project.swift new file mode 100644 index 0000000..26b0ec3 --- /dev/null +++ b/Projects/Features/MemeEditor/Project.swift @@ -0,0 +1,30 @@ +// +// Project.swift +// MemeEditor +// +// Created by hyeryeong on 9/20/24 +// + +import ProjectDescription +import ProjectDescriptionHelpers + +let project = Project( + name: "MemeEditor", + targets: [ + .configure( + name: "MemeEditor", + product: .framework, + infoPlist: .default, + sources: "Sources/**", + resources: "Resources/**", + dependencies: [ + .ThirdParty.Dependency, + .ResourceKit, + .Core.DesignSystem, + .Core.PPACModels, + .Core.PPACAnalytics + ] + ) + ] +) + diff --git a/Projects/Features/MemeEditor/Resources/dummy.swift b/Projects/Features/MemeEditor/Resources/dummy.swift new file mode 100644 index 0000000..1f7ee25 --- /dev/null +++ b/Projects/Features/MemeEditor/Resources/dummy.swift @@ -0,0 +1 @@ +//더미임미다 diff --git a/Projects/Features/MemeEditor/Sources/RegisterMemeView.swift b/Projects/Features/MemeEditor/Sources/RegisterMemeView.swift new file mode 100644 index 0000000..2e9aa99 --- /dev/null +++ b/Projects/Features/MemeEditor/Sources/RegisterMemeView.swift @@ -0,0 +1,18 @@ +// +// RegisterMemeView.swift +// MemeEditor +// +// Created by 장혜령 on 2024/09/20. +// + +import SwiftUI + +struct RegisterMemeView: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +#Preview { + RegisterMemeView() +} diff --git a/Projects/Features/MemeEditor/Sources/RequiredInputTextFieldView.swift b/Projects/Features/MemeEditor/Sources/RequiredInputTextFieldView.swift new file mode 100644 index 0000000..f110f0c --- /dev/null +++ b/Projects/Features/MemeEditor/Sources/RequiredInputTextFieldView.swift @@ -0,0 +1,87 @@ +// +// RequiredInputTextFieldView.swift +// MemeEditor +// +// Created by 장혜령 on 2024/09/20. +// + +import SwiftUI +import ResourceKit + +struct RequiredInputTextFieldView: View { + let title: String + let placeHolder: String + let limitedTextCount: Int + @State var content: String = "" + + var currentTextCount: Int { + return content.count + } + + var body: some View { + VStack(alignment: .leading) { + titleView + .padding(.bottom, 12) + textFieldView + } + + } + + var titleView: some View { + HStack { + Text(title) + .font(Font.Body.Xlarge.semiBold) + .foregroundStyle(Color.Text.primary) + ResourceKitAsset.Icon.starMarker.swiftUIImage + .resizable() + .frame(width: 12, height: 12) + .padding(.leading, -8) + .padding(.bottom, 10) + } + } + + var textFieldView: some View { + ZStack { + RoundedRectangle(cornerRadius: 10) + .foregroundStyle(Color.Background.assistive) + TextField(placeHolder, text: $content) + .font(Font.Body.Large.medium) + .padding(.leading, 16) + .padding(.top, 14) + } + } + + var textCountView: some View { + HStack(spacing: 2) { + currentTextCountView + Text("/") + Text("") + } + .foregroundStyle(Color.Text.assistive) + .font(Font.Body.Medium.medium) + + } + + var currentTextCountView: some View { + return Text("\(currentTextCount)") + .foregroundStyle(currentTextColor) + } + + var currentTextColor: SwiftUI.Color { + if currentTextCount == 0 { + return Color.Text.assistive + } else if currentTextCount <= limitedTextCount { + return Color.Text.brand + } + return Color.Text.secondary + } + +} + +#Preview { + RequiredInputTextFieldView( + title: "밈의 제목을 작성해주세요", + placeHolder: "예) 무한도전, 핀터레스트", + limitedTextCount: 32 + ) +} diff --git a/Projects/Features/MyPage/Project.swift b/Projects/Features/MyPage/Project.swift index 2a053ac..73c8c36 100644 --- a/Projects/Features/MyPage/Project.swift +++ b/Projects/Features/MyPage/Project.swift @@ -24,6 +24,7 @@ let project = Project( .Core.PPACModels, .Core.PPACAnalytics, .Feature.MemeDetail, + .Feature.MemeEditor, .Feature.Setting ] ) diff --git a/Projects/ResourceKit/Resources/Icon.xcassets/Star_Marker.imageset/Contents.json b/Projects/ResourceKit/Resources/Icon.xcassets/Star_Marker.imageset/Contents.json new file mode 100644 index 0000000..cbe9ee5 --- /dev/null +++ b/Projects/ResourceKit/Resources/Icon.xcassets/Star_Marker.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Star_Marker.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Star_Marker@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Star_Marker@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/ResourceKit/Resources/Icon.xcassets/Star_Marker.imageset/Star_Marker.png b/Projects/ResourceKit/Resources/Icon.xcassets/Star_Marker.imageset/Star_Marker.png new file mode 100644 index 0000000..a1ab533 Binary files /dev/null and b/Projects/ResourceKit/Resources/Icon.xcassets/Star_Marker.imageset/Star_Marker.png differ diff --git a/Projects/ResourceKit/Resources/Icon.xcassets/Star_Marker.imageset/Star_Marker@2x.png b/Projects/ResourceKit/Resources/Icon.xcassets/Star_Marker.imageset/Star_Marker@2x.png new file mode 100644 index 0000000..e93427f Binary files /dev/null and b/Projects/ResourceKit/Resources/Icon.xcassets/Star_Marker.imageset/Star_Marker@2x.png differ diff --git a/Projects/ResourceKit/Resources/Icon.xcassets/Star_Marker.imageset/Star_Marker@3x.png b/Projects/ResourceKit/Resources/Icon.xcassets/Star_Marker.imageset/Star_Marker@3x.png new file mode 100644 index 0000000..40f90c1 Binary files /dev/null and b/Projects/ResourceKit/Resources/Icon.xcassets/Star_Marker.imageset/Star_Marker@3x.png differ diff --git a/Tuist/ProjectDescriptionHelpers/TargetDependency+.swift b/Tuist/ProjectDescriptionHelpers/TargetDependency+.swift index 04ce146..a75b457 100644 --- a/Tuist/ProjectDescriptionHelpers/TargetDependency+.swift +++ b/Tuist/ProjectDescriptionHelpers/TargetDependency+.swift @@ -17,6 +17,7 @@ extension TargetDependency { public static let MyPage = project(moduleName: "MyPage") public static let MemeDetail = project(moduleName: "MemeDetail") public static let Setting = project(moduleName: "Setting") + public static let MemeEditor = project(moduleName: "MemeEditor") } public struct Core {