Skip to content

Commit

Permalink
Merge pull request #43 from score-dev/#26/feat-myPage
Browse files Browse the repository at this point in the history
[Feat/Style] 마이페이지 피드, 캘린더 뷰를 구현했습니다.
  • Loading branch information
soletree authored May 16, 2024
2 parents b7e1eb4 + 5d73b46 commit 7a186b3
Show file tree
Hide file tree
Showing 31 changed files with 1,164 additions and 405 deletions.
46 changes: 45 additions & 1 deletion Score/Score.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
FD208FC92BB9EAEF00DD4D3B /* SCProgressCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD208FC82BB9EAEF00DD4D3B /* SCProgressCard.swift */; };
FD208FCB2BB9EDCD00DD4D3B /* SCInformationCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD208FCA2BB9EDCD00DD4D3B /* SCInformationCard.swift */; };
FD2A260A2BAC837000F7B317 /* SCRadioButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD2A26092BAC837000F7B317 /* SCRadioButton.swift */; };
FD2E8CDF2BD9321E001957F3 /* MyPageMainFeature.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD2E8CDE2BD9321E001957F3 /* MyPageMainFeature.swift */; };
FD2E8CE12BD93238001957F3 /* MyPageMainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD2E8CE02BD93238001957F3 /* MyPageMainView.swift */; };
FD2E8CE32BD94064001957F3 /* MyPageTabRouteView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD2E8CE22BD94064001957F3 /* MyPageTabRouteView.swift */; };
FD2E8CE52BD940C2001957F3 /* SCLineTabBarFeature.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD2E8CE42BD940C2001957F3 /* SCLineTabBarFeature.swift */; };
FD2E8CE72BD94F37001957F3 /* SCIconButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD2E8CE62BD94F37001957F3 /* SCIconButton.swift */; };
FD2E8CE92BDA6763001957F3 /* FeedGridView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD2E8CE82BDA6763001957F3 /* FeedGridView.swift */; };
FD3428F52BDC04360021E542 /* Image+.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD3428F42BDC04360021E542 /* Image+.swift */; };
FD3428F72BDC13A60021E542 /* FeedMainFeature.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD3428F62BDC13A60021E542 /* FeedMainFeature.swift */; };
FD3428F92BDC24AE0021E542 /* CGFloat+.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD3428F82BDC24AE0021E542 /* CGFloat+.swift */; };
FD38E98C2BD527AB00D3BDB7 /* PolicyFeature.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD38E98B2BD527AB00D3BDB7 /* PolicyFeature.swift */; };
FD38E98E2BD5297E00D3BDB7 /* PolicyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD38E98D2BD5297E00D3BDB7 /* PolicyView.swift */; };
FD38E9902BD530AC00D3BDB7 /* SettingNavigationRowViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD38E98F2BD530AC00D3BDB7 /* SettingNavigationRowViewModifier.swift */; };
Expand Down Expand Up @@ -111,6 +120,15 @@
FD208FC82BB9EAEF00DD4D3B /* SCProgressCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SCProgressCard.swift; sourceTree = "<group>"; };
FD208FCA2BB9EDCD00DD4D3B /* SCInformationCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SCInformationCard.swift; sourceTree = "<group>"; };
FD2A26092BAC837000F7B317 /* SCRadioButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SCRadioButton.swift; sourceTree = "<group>"; };
FD2E8CDE2BD9321E001957F3 /* MyPageMainFeature.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageMainFeature.swift; sourceTree = "<group>"; };
FD2E8CE02BD93238001957F3 /* MyPageMainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageMainView.swift; sourceTree = "<group>"; };
FD2E8CE22BD94064001957F3 /* MyPageTabRouteView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageTabRouteView.swift; sourceTree = "<group>"; };
FD2E8CE42BD940C2001957F3 /* SCLineTabBarFeature.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SCLineTabBarFeature.swift; sourceTree = "<group>"; };
FD2E8CE62BD94F37001957F3 /* SCIconButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SCIconButton.swift; sourceTree = "<group>"; };
FD2E8CE82BDA6763001957F3 /* FeedGridView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedGridView.swift; sourceTree = "<group>"; };
FD3428F42BDC04360021E542 /* Image+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Image+.swift"; sourceTree = "<group>"; };
FD3428F62BDC13A60021E542 /* FeedMainFeature.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedMainFeature.swift; sourceTree = "<group>"; };
FD3428F82BDC24AE0021E542 /* CGFloat+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CGFloat+.swift"; sourceTree = "<group>"; };
FD38E98B2BD527AB00D3BDB7 /* PolicyFeature.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PolicyFeature.swift; sourceTree = "<group>"; };
FD38E98D2BD5297E00D3BDB7 /* PolicyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PolicyView.swift; sourceTree = "<group>"; };
FD38E98F2BD530AC00D3BDB7 /* SettingNavigationRowViewModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingNavigationRowViewModifier.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -250,17 +268,20 @@
FD0C397B2BA9E47400CC05AA /* Extension */ = {
isa = PBXGroup;
children = (
FD3428F42BDC04360021E542 /* Image+.swift */,
FD0C39792BA9DA4A00CC05AA /* Font+.swift */,
FD0C397C2BA9E48400CC05AA /* Color+.swift */,
FD208FBD2BB6F70200DD4D3B /* View+.swift */,
FD8FC3B12BC826F600B80B3D /* Date+.swift */,
FD3428F82BDC24AE0021E542 /* CGFloat+.swift */,
);
path = Extension;
sourceTree = "<group>";
};
FD13D4962BAB56A00016F0A0 /* UIComponent */ = {
isa = PBXGroup;
children = (
FD3428F32BDC04290021E542 /* Image */,
FDFAA42B2BCE05720053CD9F /* Progress */,
FD9E070B2BCB4E53000109FD /* Navigation */,
FDE9EA202BBDCA01007AA4D7 /* PopUp */,
Expand All @@ -287,6 +308,13 @@
path = Constant;
sourceTree = "<group>";
};
FD3428F32BDC04290021E542 /* Image */ = {
isa = PBXGroup;
children = (
);
path = Image;
sourceTree = "<group>";
};
FD38E99A2BD5C43000D3BDB7 /* Policy */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -400,9 +428,11 @@
FD38E9AD2BD84A1500D3BDB7 /* MyPage */ = {
isa = PBXGroup;
children = (
FD2E8CDE2BD9321E001957F3 /* MyPageMainFeature.swift */,
FD8FC3AF2BC8251700B80B3D /* CalendarFeature.swift */,
FD8B63A42BD217EA000500BF /* Setting */,
FD38E9AC2BD849F500D3BDB7 /* Profile */,
FD3428F62BDC13A60021E542 /* FeedMainFeature.swift */,
);
path = MyPage;
sourceTree = "<group>";
Expand Down Expand Up @@ -434,6 +464,7 @@
FD4A3B442BBAF0D100D2DFFA /* SCCapsuleButton.swift */,
FD4A3B422BBADCD400D2DFFA /* SCRecordButton.swift */,
FD9E07102BCC99DE000109FD /* DismissButton.swift */,
FD2E8CE62BD94F37001957F3 /* SCIconButton.swift */,
);
path = Button;
sourceTree = "<group>";
Expand Down Expand Up @@ -521,8 +552,12 @@
FD9E06FD2BC97DE1000109FD /* MyPage */ = {
isa = PBXGroup;
children = (
FD2E8CE02BD93238001957F3 /* MyPageMainView.swift */,
FD2E8CE22BD94064001957F3 /* MyPageTabRouteView.swift */,
FD8FC3B32BC834E400B80B3D /* Calendar */,
FDFAA4312BCE1C4D0053CD9F /* Profile */,
FDFAA4302BCE1C400053CD9F /* Setting */,
FD2E8CE82BDA6763001957F3 /* FeedGridView.swift */,
);
path = MyPage;
sourceTree = "<group>";
Expand Down Expand Up @@ -565,7 +600,6 @@
FDFD3CF62BD85B6800629B8C /* SchoolGroup */,
FDFD3CF72BD85B7700629B8C /* Record */,
FD9E06FD2BC97DE1000109FD /* MyPage */,
FD8FC3B32BC834E400B80B3D /* Calendar */,
FD13D4962BAB56A00016F0A0 /* UIComponent */,
);
path = View;
Expand Down Expand Up @@ -608,6 +642,7 @@
isa = PBXGroup;
children = (
FDFD3CF32BD8547900629B8C /* SCTabBarFeature.swift */,
FD2E8CE42BD940C2001957F3 /* SCLineTabBarFeature.swift */,
);
path = Component;
sourceTree = "<group>";
Expand Down Expand Up @@ -794,8 +829,10 @@
FD8FC3BE2BC86EB100B80B3D /* DateComponentsWithID.swift in Sources */,
FD8FC3B72BC8426800B80B3D /* CalendarGridItem.swift in Sources */,
FD9E06FF2BC97DF6000109FD /* ProfileEditView.swift in Sources */,
FD3428F92BDC24AE0021E542 /* CGFloat+.swift in Sources */,
FD2A260A2BAC837000F7B317 /* SCRadioButton.swift in Sources */,
FD13D49A2BAB62370016F0A0 /* SCCheckBox.swift in Sources */,
FD2E8CDF2BD9321E001957F3 /* MyPageMainFeature.swift in Sources */,
FDFAA43D2BCE72FB0053CD9F /* PrivacyPolicyView.swift in Sources */,
FD8B639D2BD200CD000500BF /* AlarmSettingFeature.swift in Sources */,
FD9E06FC2BC97D29000109FD /* User.swift in Sources */,
Expand All @@ -807,11 +844,14 @@
FDFAA4372BCE23180053CD9F /* SettingNavigation.swift in Sources */,
FD0C397A2BA9DA4A00CC05AA /* Font+.swift in Sources */,
FD208FC92BB9EAEF00DD4D3B /* SCProgressCard.swift in Sources */,
FD3428F72BDC13A60021E542 /* FeedMainFeature.swift in Sources */,
FD0C397D2BA9E48400CC05AA /* Color+.swift in Sources */,
FDFD3D0B2BD85EBB00629B8C /* AppFeature.swift in Sources */,
FD8B63A62BD21802000500BF /* ContactFeature.swift in Sources */,
FD8FC3B52BC834F300B80B3D /* CalendarView.swift in Sources */,
FD8FC3BB2BC8470700B80B3D /* Month.swift in Sources */,
FD3428F52BDC04360021E542 /* Image+.swift in Sources */,
FD2E8CE92BDA6763001957F3 /* FeedGridView.swift in Sources */,
FD8FC3B02BC8251700B80B3D /* CalendarFeature.swift in Sources */,
FDFD3CF92BD85B8800629B8C /* HomeMainView.swift in Sources */,
FD8B639B2BD1FF1E000500BF /* SettingMainFeature.swift in Sources */,
Expand All @@ -822,6 +862,7 @@
FD38E99F2BD5C4FD00D3BDB7 /* BlockUserSettingView.swift in Sources */,
FDFAA4422BCE7C7D0053CD9F /* UnregisterView.swift in Sources */,
FD38E9902BD530AC00D3BDB7 /* SettingNavigationRowViewModifier.swift in Sources */,
FD2E8CE52BD940C2001957F3 /* SCLineTabBarFeature.swift in Sources */,
FDFD3CFB2BD85B9F00629B8C /* SchoolGroupMainView.swift in Sources */,
FD3C6EBB2BBC79FE00B14FF9 /* SCSearchChip.swift in Sources */,
FD38E9992BD5A1A300D3BDB7 /* BlockUserSettingFeature.swift in Sources */,
Expand All @@ -842,18 +883,21 @@
FD13D4982BAB56AA0016F0A0 /* SCButton.swift in Sources */,
FD8B63A12BD2016D000500BF /* ServicePolicyFeature.swift in Sources */,
FDFD3D022BD85E2000629B8C /* HomeMainFeature.swift in Sources */,
FD2E8CE32BD94064001957F3 /* MyPageTabRouteView.swift in Sources */,
FDFAA42F2BCE0A550053CD9F /* Line.swift in Sources */,
FDFAA43B2BCE6F240053CD9F /* Contexts.swift in Sources */,
FD9E07012BC97F20000109FD /* ProfileEditFeature.swift in Sources */,
FD208FC32BB9B2FC00DD4D3B /* Constants.swift in Sources */,
FD9E07112BCC99DE000109FD /* DismissButton.swift in Sources */,
FD38E9A92BD83F0B00D3BDB7 /* EmailGuideSheet.swift in Sources */,
FD2E8CE12BD93238001957F3 /* MyPageMainView.swift in Sources */,
FDFD3D082BD85E8900629B8C /* SchoolGroupMainFeature.swift in Sources */,
FD38E98E2BD5297E00D3BDB7 /* PolicyView.swift in Sources */,
FDE62A102BAD959A00DFDA5C /* SCLabel.swift in Sources */,
FD3C6EBD2BBC7DE700B14FF9 /* SCTagChip.swift in Sources */,
FD8B63A32BD201CC000500BF /* UnregisterFeature.swift in Sources */,
FD3C6EB82BBC41A000B14FF9 /* SCTabBar.swift in Sources */,
FD2E8CE72BD94F37001957F3 /* SCIconButton.swift in Sources */,
FD208FC52BB9C45700DD4D3B /* SCNumberIcon.swift in Sources */,
FD208FCB2BB9EDCD00DD4D3B /* SCInformationCard.swift in Sources */,
FD208FBA2BB634AF00DD4D3B /* SCTextField.swift in Sources */,
Expand Down
3 changes: 3 additions & 0 deletions Score/Score/Constant/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ enum Constants {
case search
case user
case home
case setting

// Member Icons
case dustMood = "dust.mood"
Expand Down Expand Up @@ -93,6 +94,8 @@ enum Constants {

enum Layout: CGFloat {
case horizontal = 16
case navigationBarHeight = 56
case iconSize = 24
}
}

Expand Down
22 changes: 22 additions & 0 deletions Score/Score/Extension/CGFloat+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// CGFloat+.swift
// Score
//
// Created by sole on 4/27/24.
//

import UIKit

//MARK: - CGFloat

extension CGFloat {
//MARK: - device size
static let deviceWidth = UIScreen.main.bounds.width
static let deviceHeight = UIScreen.main.bounds.height

//MARK: - calendarItemSize
static var calendarItemSize: CGFloat {
let paddingHorizontal: CGFloat = Constants.Layout.horizontal.rawValue * 2
return (.deviceWidth - paddingHorizontal) / 7
}
}
59 changes: 59 additions & 0 deletions Score/Score/Extension/Image+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
//
// Image+.swift
// Score
//
// Created by sole on 4/27/24.
//

import SwiftUI

//MARK: - Image+imagePlaceHolder

extension Image {

//MARK: - imagePlaceHolder

/// image 플레이스 홀더가 필요한 사진의 경우에 사용합니다.
/// 플레이스 홀더를 원형의 size*size로 생성합니다.
@ViewBuilder
func imagePlaceHolder(size: CGFloat) -> some View {
self
.resizable()
.frame(width: 130,
height: 130)
.clipShape(Circle())
.background {
Circle()
.frame(width: size,
height: size)
.foregroundStyle(
Color.brandColor(color: .gray2)
)
}
.frame(width: size,
height: size)
}
}

extension Image? {

@ViewBuilder
func imagePlaceHolder(size: CGFloat) -> some View {
let image: Image = self ?? Image("")
image
.resizable()
.frame(width: 130,
height: 130)
.clipShape(Circle())
.background {
Circle()
.frame(width: size,
height: size)
.foregroundStyle(
Color.brandColor(color: .gray2)
)
}
.frame(width: size,
height: size)
}
}
11 changes: 9 additions & 2 deletions Score/Score/Extension/View+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,15 @@ extension View {
// 양쪽에 padding이 들어가므로 2배를 곱해줍니다.
let paddingHorizontal: CGFloat = Constants.Layout.horizontal.rawValue * 2
frame(
width: (UIScreen.main.bounds.width - paddingHorizontal) / 7,
height: (UIScreen.main.bounds.width - paddingHorizontal) / 7
width: (.deviceWidth - paddingHorizontal) / 7,
height: (.deviceWidth - paddingHorizontal) / 7
)
}

@ViewBuilder
func rectFrame(size: CGFloat) -> some View {
self
.frame(width: size,
height: size)
}
}
12 changes: 8 additions & 4 deletions Score/Score/Model/User.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct User: Equatable,
// identifier
let nickName: String
let profileImageName: String
let sex: Sex
let gender: Gender
let height: Int
let weight: Int
let schoolName: String
Expand All @@ -25,16 +25,20 @@ struct User: Equatable,

static let defaultModel: User = .init(nickName: "왕감자",
profileImageName: "",
sex: .female,
gender: .female,
height: 160,
weight: 50,
schoolName: "감자대학교",
grade: 1)
}

//MARK: - Sex
//MARK: - Gender

enum Sex: String {
enum Gender: String, CaseIterable {
static let sex: [Gender] = [.male,
.female]

case male = ""
case female = ""
case ect
}
36 changes: 36 additions & 0 deletions Score/Score/Reducer/Component/SCLineTabBarFeature.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// SCLineTabBarFeature.swift
// Score
//
// Created by sole on 4/24/24.
//

import ComposableArchitecture

@Reducer
struct SCLineTabBarFeature<T: SCLineTabProtocol> {
struct State: Equatable {
var tabItems: [SCLineTabItem<T>] = []
@BindingState var selectedTab: T
}

enum Action: BindableAction {
case binding(BindingAction<State>)
case tabBarButtonTapped(SCLineTabItem<T>)
}

var body: some ReducerOf<Self> {
BindingReducer()

Reduce { state, action in
switch action {
case .binding:
return .none

case .tabBarButtonTapped(let tabItem):
state.selectedTab = tabItem.tab
return .none
}
}
}
}
9 changes: 4 additions & 5 deletions Score/Score/Reducer/Component/SCTabBarFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ struct SCTabBarFeature {

Reduce { state, action in
switch action {
case .binding:
return .none

case .viewAppearing:
return .none

Expand All @@ -54,11 +51,13 @@ struct SCTabBarFeature {
}
return .none

case .destination:
case .binding,
.destination:
return .none
}
}
.ifLet(\.$destination, action: \.destination) {
.ifLet(\.$destination,
action: \.destination) {
Destination()
}
}
Expand Down
Loading

0 comments on commit 7a186b3

Please sign in to comment.