-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: RequiredInputTextFieldView 추가(#76)
- Loading branch information
Showing
10 changed files
with
161 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
] | ||
) | ||
] | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
//더미임미다 |
18 changes: 18 additions & 0 deletions
18
Projects/Features/MemeEditor/Sources/RegisterMemeView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
} |
87 changes: 87 additions & 0 deletions
87
Projects/Features/MemeEditor/Sources/RequiredInputTextFieldView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
Projects/ResourceKit/Resources/Icon.xcassets/Star_Marker.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Star_Marker.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+334 Bytes
Projects/ResourceKit/Resources/Icon.xcassets/Star_Marker.imageset/Star_Marker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+525 Bytes
...cts/ResourceKit/Resources/Icon.xcassets/Star_Marker.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+743 Bytes
...cts/ResourceKit/Resources/Icon.xcassets/Star_Marker.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters