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

[FEAT] #13 - GoalSettingScreen #16

Merged
merged 6 commits into from
Feb 13, 2025
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "appLogo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group [email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group [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,23 @@
{
"images" : [
{
"filename" : "iconBell.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,23 @@
{
"images" : [
{
"filename" : "iconUp.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.
2 changes: 1 addition & 1 deletion dnd-12th-2-iOS/dnd-12th-2-iOS/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ struct ContentView: View {

#Preview {
ContentView()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import SwiftUI

struct DDButton: View {
let isDisable: Bool
let image: Image?
let imageSize: CGFloat?
let title: String
Expand All @@ -23,11 +24,12 @@ struct DDButton: View {
imageSize: CGFloat? = 12,
title: String = "λ‹€μŒ",
font: Font = .pretendard(size: 16, weight: .semibold),
backgroundColor: Color = .gray100,
textColor: Color = .gray500,
backgroundColor: Color = .purple500,
textColor: Color = .white,
width: CGFloat = 343,
height: CGFloat = 54,
cornerRadius: CGFloat = 12,
isDisable: Bool = false,
action: @escaping () -> Void) {
self.image = image
self.imageSize = imageSize
Expand All @@ -39,6 +41,7 @@ struct DDButton: View {
self.height = height
self.cornerRadius = cornerRadius
self.action = action
self.isDisable = isDisable
}

var body: some View {
Expand All @@ -57,8 +60,9 @@ struct DDButton: View {

}
.frame(width: width, height: height)
.background(backgroundColor)
.background(isDisable ? .gray100 : backgroundColor)
.cornerRadius(cornerRadius)
.disabled(isDisable)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct DDatePicker: View {
HStack {
// DDPickerλ₯Ό ν•©μ³μ„œ DDatePickerλ₯Ό λ§Œλ“ λ‹€

DDPicker(items: ["μ˜€μ „", "μ˜€ν›„"])
DDPicker(items: ["였늘", "내일"])
.frame(height: 56 * 3)
.overlay(alignment: .top) {
Divider()
Expand Down Expand Up @@ -67,19 +67,21 @@ struct DDatePicker: View {
.blendMode(.overlay)
.allowsHitTesting(false)
)
Spacer()
.frame(width: 45)
}
.frame(width: 307, height: 168)
.frame(width: 307, height: 198)
.overlay(alignment: .top) {
Rectangle()
.frame(height: 15)
.foregroundStyle(Color.white)
.offset(y: -10)
.offset(y: 10)
}
.overlay(alignment: .bottom) {
Rectangle()
.frame(height: 15)
.foregroundStyle(Color.white)
.offset(y: 10)
.offset(y: -10)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct DDNavigationModifier<C, L, R>: ViewModifier where C: View, L: View, R: Vi
Spacer()
right?()
}
.padding(.horizontal, 16)
.padding(.horizontal, 8)
.frame(maxWidth: .infinity)

HStack {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// DDRoundTextField.swift
// dnd-12th-2-iOS
//
// Created by κΆŒμ„κΈ° on 2/11/25.
//

import SwiftUI

struct DDRoundTextFiled: View {
@Binding var text: String
var body: some View {
ZStack {
Rectangle()
.frame(maxWidth: .infinity, minHeight: 48, maxHeight: 48)
.foregroundColor(Color.gray50)
.cornerRadius(12)

HStack {
TextField("", text: $text, prompt: Text("ex) OOμ—μ„œ OOν•˜κΈ°")
.font(.pretendard(size: 16, weight: .medium)))
.font(.pretendard(size: 16, weight: .medium))
.foregroundStyle(Color.black)

Text("0/50")
.font(.pretendard(size: 12, weight: .regular))
.foregroundStyle(Color.gray500)
}
.padding(.horizontal, 8)
}
}
}

#Preview {
DDRoundTextFiled(text: .constant(""))
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
//
// GoalResultView.swift
// dnd-12th-2-iOS
//
// Created by κΆŒμ„κΈ° on 2/12/25.
//

import SwiftUI
import ComposableArchitecture

struct GoalResultView: View {
var body: some View {
WithPerceptionTracking {
Spacer()
.frame(height: 16)
Text("λͺ©ν‘œλ₯Ό μœ„ν•œ \n첫 번째 계단을 μ˜¬λΌλ΄μš”!")
.font(.pretendard(size: 22, weight: .semibold), lineHeight: 31)
.frame(maxWidth: .infinity, alignment: .leading)
.foregroundStyle(Color.gray900)

Spacer()
VStack(spacing: 0) {
Image("appLogoImage")
Spacer()
.frame(height: 50)
Text("μ˜¬ν•΄κΉŒμ§€ μ˜€ν”½ ALλ°›κΈ°")
.font(.pretendard(size: 22, weight: .bold), lineHeight: 31)
.foregroundStyle(Color.gray900)
Spacer()
.frame(height: 12)
Text("μ˜€ν”½λ…Έλ‹₯ 30νŽ˜μ΄μ§€ 슀크립트 μž‘μ„±")
.font(.pretendard(size: 16, weight: .semibold), lineHeight: 24)
.foregroundStyle(Color.gray900)
Spacer()
.frame(height: 4)
Text("였늘 22:28 ~ 23:42")
.font(.pretendard(size: 14, weight: .regular), lineHeight: 17)
.foregroundStyle(Color.gray600)
}

Spacer()
Button(action: {}, label: {
HStack(spacing: 0) {
Image("iconBell")
Spacer()
.frame(width: 6)
Text("30λΆ„ μ „ μ•Œλ¦Ό")
.font(.pretendard(size: 14, weight: .medium), lineHeight: 21)
.foregroundStyle(Color.purple700)
Spacer()
.frame(width: 12)
Image("iconTriangle")
}
.padding(16)
})
.background(Color.purple50)
.clipShape(Capsule())
Spacer()
.frame(height: 16)
DDButton(action: {})
}
.padding(.horizontal, 16)
.navigationBar(left: {
DDBackButton(action: {})
})
}
}

#Preview {
GoalResultView()
}
120 changes: 120 additions & 0 deletions dnd-12th-2-iOS/dnd-12th-2-iOS/Presentation/Goal/GoalSettingView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
//
// GoalSettingView.swift
// dnd-12th-2-iOS
//
// Created by κΆŒμ„κΈ° on 2/11/25.
//

import SwiftUI
import ComposableArchitecture

struct GoalSettingView: View {
@State var text = ""
@State var isStartTimeToggle = false
@State var isEndTimeToggle = false

var body: some View {
WithPerceptionTracking {
ScrollView {
VStack(spacing: 40) {
VStack(spacing: 4) {
Text("λͺ©ν‘œ")
.font(.pretendard(size: 18, weight: .semibold))
.foregroundStyle(Color.gray900)
.frame(maxWidth: .infinity, alignment: .leading)
DDRoundTextFiled(text: $text)
Text("Tip λͺ©ν‘œκ°€ λΆ€λ‹΄μŠ€λŸ½λ‹€λ©΄ 3κ°œμ›” μ•ˆμ— μ‹€μ²œν•  수 μžˆλŠ” λͺ©ν‘œλ₯Ό \nμƒκ°ν•΄λ³΄μ„Έμš”!".splitCharacter())
.font(.pretendard(size: 14, weight: .medium))
.foregroundStyle(Color.purple500)
.frame(maxWidth: .infinity, alignment: .leading)
.multilineTextAlignment(.leading)
}

VStack(spacing: 4) {
Text("κ³„νš")
.font(.pretendard(size: 18, weight: .semibold))
.foregroundStyle(Color.gray900)
.frame(maxWidth: .infinity, alignment: .leading)
DDRoundTextFiled(text: $text)
Text("TIp! ν•  일이 λ§Žλ‹€λ©΄, κ°€μž₯ μ‰¬μš΄ 것뢀터 μ‹œμž‘ν•΄λ³΄μ„Έμš”!")
.font(.pretendard(size: 14, weight: .medium))
.foregroundStyle(Color.purple500)
.frame(maxWidth: .infinity, alignment: .leading)
}

VStack(spacing: 0) {
Text("μ‹œκ°„")
.font(.pretendard(size: 18, weight: .semibold))
.foregroundStyle(Color.gray900)
.frame(maxWidth: .infinity, alignment: .leading)
Spacer().frame(height: 12)
Text("였늘 22:28 ~ 23:42")
.font(.pretendard(size: 14, weight: .medium), lineHeight: 21)
.foregroundStyle(Color.gray500)
.frame(maxWidth: .infinity, alignment: .leading)
Spacer().frame(height: 8)
Divider().background(Color.gray50)
Spacer().frame(height: 8)
HStack {
Text("μ‹œμž‘ μ‹œκ°„")
.font(.pretendard(size: 14, weight: .medium), lineHeight: 21)
.foregroundStyle(Color.gray600)
Spacer()
Button(action: {
isEndTimeToggle = false
isStartTimeToggle.toggle()
}, label: {
Text("였늘 22:28")
.font(.pretendard(size: 14, weight: .medium), lineHeight: 21)
.foregroundStyle(Color.purple800)
Image(.iconUp)
.rotationEffect(.degrees(isStartTimeToggle ? 0 : 180))
})
}
if isStartTimeToggle {
DDatePicker()
}
Spacer().frame(height: 8)
HStack {
Text("μ’…λ£Œ μ‹œκ°„")
.font(.pretendard(size: 14, weight: .medium), lineHeight: 21)
.foregroundStyle(Color.gray600)
Spacer()
Button(action: {
isStartTimeToggle = false
isEndTimeToggle.toggle()
}, label: {
Text("였늘 22:28")
.font(.pretendard(size: 14, weight: .medium), lineHeight: 21)
.foregroundStyle(Color.purple800)
Image(.iconUp)
.rotationEffect(.degrees(isEndTimeToggle ? 0 : 180))
})
}
if isEndTimeToggle {
DDatePicker()
}
}
}
.padding(16)
.offset(y: isStartTimeToggle ? -16.0 : 0.0)
.animation(.easeInOut(duration: 0.3), value: isStartTimeToggle)
.onTapGesture {
UIApplication.shared.hideKeyboard()
}
}
.scrollDisabled(true)

DDButton(action: {})
.padding(.bottom, 8)
}

.navigationBar(left: {
DDBackButton(action: {})
})
}
}

#Preview {
GoalSettingView()
}
Loading