Skip to content

Commit

Permalink
Merge pull request #139 from TeamHY2/Feature/#130-HomeView_TCA
Browse files Browse the repository at this point in the history
[Feature] 홈뷰와 관련된 UI 컴포넌트 구현
  • Loading branch information
Choe-ju authored Jan 10, 2025
2 parents 1ec25cd + d5d09a4 commit c6f6952
Show file tree
Hide file tree
Showing 9 changed files with 260 additions and 2 deletions.
Binary file modified .DS_Store
Binary file not shown.
44 changes: 44 additions & 0 deletions HongikYeolgong2.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
474B29472D27CBAF00DB410D /* RecordView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 474B29462D27CBAF00DB410D /* RecordView.swift */; };
474B294A2D27CBD300DB410D /* RankingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 474B29492D27CBD300DB410D /* RankingView.swift */; };
474B294D2D27CBE100DB410D /* SettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 474B294C2D27CBE100DB410D /* SettingView.swift */; };
474D76522D290DDE00AF8CA2 /* WeeklyStudy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 474D76512D290DDE00AF8CA2 /* WeeklyStudy.swift */; };
474D76552D290E6B00AF8CA2 /* WeeklyStudyFeature.swift in Sources */ = {isa = PBXBuildFile; fileRef = 474D76542D290E6B00AF8CA2 /* WeeklyStudyFeature.swift */; };
474D76582D2913C000AF8CA2 /* Quote.swift in Sources */ = {isa = PBXBuildFile; fileRef = 474D76572D2913C000AF8CA2 /* Quote.swift */; };
474D765B2D291B0A00AF8CA2 /* TimerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 474D765A2D291B0A00AF8CA2 /* TimerView.swift */; };
474D765D2D291CC300AF8CA2 /* StudyPeriod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 474D765C2D291CC300AF8CA2 /* StudyPeriod.swift */; };
47581ED02CF01EB200A2EA31 /* AmplitudeSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 47581ECF2CF01EB200A2EA31 /* AmplitudeSwift */; };
476120AB2D2827CF005EC300 /* SettingFeature.swift in Sources */ = {isa = PBXBuildFile; fileRef = 476120AA2D2827CF005EC300 /* SettingFeature.swift */; };
476120B22D282B17005EC300 /* LoginFeature.swift in Sources */ = {isa = PBXBuildFile; fileRef = 476120B12D282B17005EC300 /* LoginFeature.swift */; };
Expand Down Expand Up @@ -118,6 +123,11 @@
474B29462D27CBAF00DB410D /* RecordView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecordView.swift; sourceTree = "<group>"; };
474B29492D27CBD300DB410D /* RankingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RankingView.swift; sourceTree = "<group>"; };
474B294C2D27CBE100DB410D /* SettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingView.swift; sourceTree = "<group>"; };
474D76512D290DDE00AF8CA2 /* WeeklyStudy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeeklyStudy.swift; sourceTree = "<group>"; };
474D76542D290E6B00AF8CA2 /* WeeklyStudyFeature.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeeklyStudyFeature.swift; sourceTree = "<group>"; };
474D76572D2913C000AF8CA2 /* Quote.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Quote.swift; sourceTree = "<group>"; };
474D765A2D291B0A00AF8CA2 /* TimerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimerView.swift; sourceTree = "<group>"; };
474D765C2D291CC300AF8CA2 /* StudyPeriod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StudyPeriod.swift; sourceTree = "<group>"; };
476120AA2D2827CF005EC300 /* SettingFeature.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingFeature.swift; sourceTree = "<group>"; };
476120B12D282B17005EC300 /* LoginFeature.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginFeature.swift; sourceTree = "<group>"; };
476120B32D282B21005EC300 /* LoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -265,6 +275,32 @@
path = Setting;
sourceTree = "<group>";
};
474D76532D290DF000AF8CA2 /* WeeklyStudy */ = {
isa = PBXGroup;
children = (
474D76512D290DDE00AF8CA2 /* WeeklyStudy.swift */,
474D76542D290E6B00AF8CA2 /* WeeklyStudyFeature.swift */,
);
path = WeeklyStudy;
sourceTree = "<group>";
};
474D76562D2913AB00AF8CA2 /* Quote */ = {
isa = PBXGroup;
children = (
474D76572D2913C000AF8CA2 /* Quote.swift */,
);
path = Quote;
sourceTree = "<group>";
};
474D76592D291AD100AF8CA2 /* Timer */ = {
isa = PBXGroup;
children = (
474D765A2D291B0A00AF8CA2 /* TimerView.swift */,
474D765C2D291CC300AF8CA2 /* StudyPeriod.swift */,
);
path = Timer;
sourceTree = "<group>";
};
474FF2FB2CE36F4100ABEE63 /* Recovered References */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -441,6 +477,9 @@
47F6B7CC2D26FAE20096CCA5 /* Home */ = {
isa = PBXGroup;
children = (
474D76592D291AD100AF8CA2 /* Timer */,
474D76562D2913AB00AF8CA2 /* Quote */,
474D76532D290DF000AF8CA2 /* WeeklyStudy */,
47F6B7CD2D26FAF00096CCA5 /* HomeView.swift */,
47F6B7CF2D26FAF90096CCA5 /* HomeFeature.swift */,
);
Expand Down Expand Up @@ -670,22 +709,27 @@
474B29472D27CBAF00DB410D /* RecordView.swift in Sources */,
471940D32CAFEE5B00426D30 /* Font+Uikit.swift in Sources */,
471940D12CAFE61A00426D30 /* LineHeight.swift in Sources */,
474D765B2D291B0A00AF8CA2 /* TimerView.swift in Sources */,
47F6B7D02D26FAF90096CCA5 /* HomeFeature.swift in Sources */,
473671A52CB13D8100527896 /* SafeArea.swift in Sources */,
47F6B7D42D26FB2D0096CCA5 /* HomeClient.swift in Sources */,
471940C82CAFCB1B00426D30 /* SizeCheckModifier.swift in Sources */,
47B1D4AC2C9CB1740071B62B /* HongikYeolgong2App.swift in Sources */,
474D765D2D291CC300AF8CA2 /* StudyPeriod.swift in Sources */,
4780044E2CCAAE3200FFAF00 /* String+.swift in Sources */,
478F84372CD30A8F0097CAA1 /* IOSBackground.swift in Sources */,
474B294A2D27CBD300DB410D /* RankingView.swift in Sources */,
47D5EDCD2CCBCB6D00ACA469 /* ImageBackground.swift in Sources */,
473E8EB42CCE6827000F102C /* TimeInterval+.swift in Sources */,
476120AB2D2827CF005EC300 /* SettingFeature.swift in Sources */,
47BE30E32CC813BB0015D973 /* KeyChainManager.swift in Sources */,
474D76582D2913C000AF8CA2 /* Quote.swift in Sources */,
474D76522D290DDE00AF8CA2 /* WeeklyStudy.swift in Sources */,
473E8EB22CCE5267000F102C /* SystemOverlay.swift in Sources */,
476120B22D282B17005EC300 /* LoginFeature.swift in Sources */,
478B75462CE659C3000190EF /* BaseTextField.swift in Sources */,
47F79B302CCCB7FC00DD0899 /* TimePicker.swift in Sources */,
474D76552D290E6B00AF8CA2 /* WeeklyStudyFeature.swift in Sources */,
47D5EDCF2CCBD10300ACA469 /* BaseButton.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
24 changes: 23 additions & 1 deletion HongikYeolgong2/Presentation/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,29 @@ import SwiftUI

struct HomeView: View {
var body: some View {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
VStack(spacing: 0) {
Spacer()
.frame(height: 32)
WeeklyStudy()
Spacer()
.frame(height: 120)
Quote()
StudyPeriod(startTime: .now, endTime: .now)
Spacer()
.frame(height: 32)
TimerView()
Spacer()
HStack(spacing: 12) {
BaseButton(width: 69, backgroundColor: .clear, action: {})
.modifier(ImageBackground(imageName: .seatButton))

BaseButton(backgroundColor: .clear, action: {})
.modifier(ImageBackground(imageName: .startButton))
}
Spacer().frame(height: 36)
}
.padding(.horizontal, 32)
.modifier(IOSBackground())
}
}

Expand Down
28 changes: 28 additions & 0 deletions HongikYeolgong2/Presentation/Home/Quote/Quote.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// Quote.swift
// HongikYeolgong2
//
// Created by 권석기 on 1/4/25.
//

import SwiftUI

struct Quote: View {
var body: some View {
VStack {
Text("행동보다 빠르게 불안감을 \n 없앨 수 있는 것은 없습니다.")
.font(.pretendard(size: 18, weight: .regular), lineHeight: 20)
.foregroundColor(.gray100)
.multilineTextAlignment(.center)

Text("- 윌터 앤더슨")
.font(.pretendard(size: 12, weight: .regular), lineHeight: 18)
.foregroundColor(.gray200)
.multilineTextAlignment(.center)
}
}
}

#Preview {
Quote()
}
61 changes: 61 additions & 0 deletions HongikYeolgong2/Presentation/Home/Timer/StudyPeriod.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
//
// StudyPeriod.swift
// HongikYeolgong2
//
// Created by 권석기 on 1/4/25.
//

import SwiftUI

struct StudyPeriod: View {
let startTime: Date
let endTime: Date

var body: some View {
HStack(spacing: 0) {
VStack(alignment: .leading, spacing: 11) {
HStack(spacing: 13) {
Text("Start")
.font(.suite(size: 12, weight: .medium), lineHeight: 15)
.foregroundStyle(.gray300)
Image(.lineArrow)
.offset(y: -3)
}

HStack(alignment: .firstTextBaseline, spacing: 6) {
Text(startTime.getHourMinutes())
.font(.suite(size: 30, weight: .black), lineHeight: 32)
.foregroundColor(.gray100)
Text(startTime.getDaypart())
.font(.suite(size: 14, weight: .medium), lineHeight: 32)
.foregroundStyle(.gray100)
}
}

VStack(alignment: .leading, spacing: 11) {
HStack(spacing: 13) {
Text("End")
.font(.suite(size: 12, weight: .medium), lineHeight: 15)
.foregroundStyle(.gray300)
}

HStack(alignment: .firstTextBaseline, spacing: 6) {
Text(endTime.getHourMinutes())
.font(.suite(size: 30, weight: .black), lineHeight: 32)
.foregroundColor(.gray100)
Text(endTime.getDaypart())
.font(.suite(size: 14, weight: .medium), lineHeight: 32)
.foregroundStyle(.gray100)
}
}
.padding(.leading, 18)

Spacer()
}
}
}


//#Preview {
// StudyPeriod(startTime: .now, endTime: .now)
//}
49 changes: 49 additions & 0 deletions HongikYeolgong2/Presentation/Home/Timer/TimerView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//
// TimerView.swift
// HongikYeolgong2
//
// Created by 권석기 on 1/4/25.
//

import SwiftUI

struct TimerView: View {
var body: some View {
VStack(alignment: .leading, spacing: 0) {
Text("Time Left")
.font(.suite(size: 12, weight: .medium), lineHeight: 15)
.foregroundStyle(.gray300)

Text("06:00:00")
.font(.suite(size: 30, weight: .black), lineHeight: 32)
.foregroundColor(.white)
.padding(.top, 11)

LinearProgressView(shape: Rectangle(), value: 1)
.frame(height: 8)
.padding(.top, 16)
}
}
}

struct LinearProgressView<Shape: SwiftUI.Shape>: View {
var shape: Shape
let value: Double

var body: some View {
VStack {
shape.fill(.gray600)
.overlay(alignment: .leading) {
GeometryReader { proxy in
shape.fill(.blue100)
.frame(width: proxy.size.width * value)
}
}
}
.animation(.easeInOut, value: value)
}
}

#Preview {
TimerView()
}
46 changes: 46 additions & 0 deletions HongikYeolgong2/Presentation/Home/WeeklyStudy/WeeklyStudy.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//
// WeeklyStudy.swift
// HongikYeolgong2
//
// Created by 권석기 on 1/4/25.
//

import SwiftUI

struct WeeklyStudy: View {
var body: some View {
HStack {
ForEach(0..<7, id: \.self) { number in
if number != 0 && number != 7 {
Spacer()
}
WeeklyStudyCell()
}
}
}
}

struct WeeklyStudyCell: View {
var body: some View {
VStack {
Text("")
.font(.pretendard(size: 12, weight: .regular), lineHeight: 18)
.foregroundStyle(.gray400)

VStack {
Image(.shineCount00)
}
.frame(height: 28)
.padding(.top, 8)
.padding(.bottom, 2)

Text("1/1")
.font(.pretendard(size: 12, weight: .regular), lineHeight: 18)
.foregroundStyle(.gray400)
}
}
}

//#Preview {
// WeeklyStudy()
//}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// WeeklyStudyFeature.swift
// HongikYeolgong2
//
// Created by 권석기 on 1/4/25.
//

import Foundation
2 changes: 1 addition & 1 deletion HongikYeolgong2/Presentation/MainTabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct MainTabView: View {

}
}
.frame(height: 88)
.frame(height: SafeAreaHelper.getTabBarHeight())
.background(Image(.tabview)
.resizable()
.frame(maxWidth: .infinity))
Expand Down

0 comments on commit c6f6952

Please sign in to comment.