diff --git a/App/Resources/Colors/Medal.xcassets/Contents.json b/App/Resources/Colors/Medal.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/App/Resources/Colors/Medal.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/App/Resources/Colors/Medal.xcassets/FirstPlace.colorset/Contents.json b/App/Resources/Colors/Medal.xcassets/FirstPlace.colorset/Contents.json new file mode 100644 index 0000000..27d25f8 --- /dev/null +++ b/App/Resources/Colors/Medal.xcassets/FirstPlace.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x9B", + "green" : "0xD7", + "red" : "0xFF" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x9B", + "green" : "0xD7", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/App/Resources/Colors/Medal.xcassets/SecondPlace.colorset/Contents.json b/App/Resources/Colors/Medal.xcassets/SecondPlace.colorset/Contents.json new file mode 100644 index 0000000..ea75ab6 --- /dev/null +++ b/App/Resources/Colors/Medal.xcassets/SecondPlace.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xD9", + "green" : "0xD9", + "red" : "0xD9" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xD9", + "green" : "0xD9", + "red" : "0xD9" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/App/Resources/Colors/Medal.xcassets/ThirdPlace.colorset/Contents.json b/App/Resources/Colors/Medal.xcassets/ThirdPlace.colorset/Contents.json new file mode 100644 index 0000000..1e8b435 --- /dev/null +++ b/App/Resources/Colors/Medal.xcassets/ThirdPlace.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x5D", + "green" : "0x86", + "red" : "0xCE" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x5D", + "green" : "0x86", + "red" : "0xCE" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/Contents.json b/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/Contents.json index 84add43..a882844 100644 --- a/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/Contents.json +++ b/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "banner1.png", + "filename" : "SKBanner.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "banner1 1.png", + "filename" : "SKBanner 1.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "banner1 2.png", + "filename" : "SKBanner 2.png", "idiom" : "universal", "scale" : "3x" } diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/SKBanner 1.png b/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/SKBanner 1.png new file mode 100644 index 0000000..f74072b Binary files /dev/null and b/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/SKBanner 1.png differ diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/SKBanner 2.png b/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/SKBanner 2.png new file mode 100644 index 0000000..f74072b Binary files /dev/null and b/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/SKBanner 2.png differ diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/SKBanner.png b/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/SKBanner.png new file mode 100644 index 0000000..f74072b Binary files /dev/null and b/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/SKBanner.png differ diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/banner1 1.png b/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/banner1 1.png deleted file mode 100644 index 4d3f428..0000000 Binary files a/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/banner1 1.png and /dev/null differ diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/banner1 2.png b/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/banner1 2.png deleted file mode 100644 index 4d3f428..0000000 Binary files a/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/banner1 2.png and /dev/null differ diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/banner1.png b/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/banner1.png deleted file mode 100644 index 4d3f428..0000000 Binary files a/App/Resources/Images/Banner.xcassets/BannerImage_1.imageset/banner1.png and /dev/null differ diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/Contents.json b/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/Contents.json index 62acd5a..cd42b68 100644 --- a/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/Contents.json +++ b/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "banner22.png", + "filename" : "SKBanner2.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "banner22 1.png", + "filename" : "SKBanner2 1.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "banner22 2.png", + "filename" : "SKBanner2 2.png", "idiom" : "universal", "scale" : "3x" } diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/SKBanner2 1.png b/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/SKBanner2 1.png new file mode 100644 index 0000000..e5abf3c Binary files /dev/null and b/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/SKBanner2 1.png differ diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/SKBanner2 2.png b/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/SKBanner2 2.png new file mode 100644 index 0000000..e5abf3c Binary files /dev/null and b/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/SKBanner2 2.png differ diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/SKBanner2.png b/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/SKBanner2.png new file mode 100644 index 0000000..e5abf3c Binary files /dev/null and b/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/SKBanner2.png differ diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/banner22 1.png b/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/banner22 1.png deleted file mode 100644 index ac8a782..0000000 Binary files a/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/banner22 1.png and /dev/null differ diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/banner22 2.png b/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/banner22 2.png deleted file mode 100644 index ac8a782..0000000 Binary files a/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/banner22 2.png and /dev/null differ diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/banner22.png b/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/banner22.png deleted file mode 100644 index ac8a782..0000000 Binary files a/App/Resources/Images/Banner.xcassets/BannerImage_2.imageset/banner22.png and /dev/null differ diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/Contents.json b/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/Contents.json index 76f7c85..40a0183 100644 --- a/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/Contents.json +++ b/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "banner3.png", + "filename" : "SKBanner3.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "banner3 1.png", + "filename" : "SKBanner3 1.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "banner3 2.png", + "filename" : "SKBanner3 2.png", "idiom" : "universal", "scale" : "3x" } diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/SKBanner3 1.png b/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/SKBanner3 1.png new file mode 100644 index 0000000..efd622e Binary files /dev/null and b/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/SKBanner3 1.png differ diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/SKBanner3 2.png b/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/SKBanner3 2.png new file mode 100644 index 0000000..efd622e Binary files /dev/null and b/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/SKBanner3 2.png differ diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/SKBanner3.png b/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/SKBanner3.png new file mode 100644 index 0000000..efd622e Binary files /dev/null and b/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/SKBanner3.png differ diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/banner3 1.png b/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/banner3 1.png deleted file mode 100644 index dc6e099..0000000 Binary files a/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/banner3 1.png and /dev/null differ diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/banner3 2.png b/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/banner3 2.png deleted file mode 100644 index dc6e099..0000000 Binary files a/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/banner3 2.png and /dev/null differ diff --git a/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/banner3.png b/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/banner3.png deleted file mode 100644 index dc6e099..0000000 Binary files a/App/Resources/Images/Banner.xcassets/BannerImage_3.imageset/banner3.png and /dev/null differ diff --git a/App/Sources/DesignSystem/Banner/BannerView.swift b/App/Sources/DesignSystem/Banner/BannerView.swift new file mode 100644 index 0000000..f19d342 --- /dev/null +++ b/App/Sources/DesignSystem/Banner/BannerView.swift @@ -0,0 +1,28 @@ +import SwiftUI + +struct BannerView: View { + @State private var currentIndex = 0 + + let timer = Timer.publish(every: 3, on: .main, in: .common).autoconnect() + + var body: some View { + TabView(selection: $currentIndex) { + SKBannerImage(.Banner1) + .tag(0) + + SKBannerImage(.Banner2) + .tag(1) + + SKBannerImage(.Banner3) + .tag(2) + } + .tabViewStyle(PageTabViewStyle()) + .indexViewStyle(PageIndexViewStyle(backgroundDisplayMode: .automatic)) + .frame(height: 180) + .onReceive(timer) { _ in + withAnimation { + currentIndex = (currentIndex + 1) % 3 + } + } + } +} diff --git a/App/Sources/DesignSystem/Color/Color+sk.swift b/App/Sources/DesignSystem/Color/Color+sk.swift index e7c7a93..dc5f5a5 100644 --- a/App/Sources/DesignSystem/Color/Color+sk.swift +++ b/App/Sources/DesignSystem/Color/Color+sk.swift @@ -4,12 +4,14 @@ public extension Color { enum SKColorSystem { case main(Main) case gray(Gray) + case medal(Medal) } static func sk(_ style: SKColorSystem) -> Color { switch style { case let .main(colorable as SKColorable), - let .gray(colorable as SKColorable): + let .gray(colorable as SKColorable), + let .medal(colorable as SKColorable): return colorable.color } } diff --git a/App/Sources/DesignSystem/Color/SKColorSystem+Medal.swift b/App/Sources/DesignSystem/Color/SKColorSystem+Medal.swift new file mode 100644 index 0000000..ce9608d --- /dev/null +++ b/App/Sources/DesignSystem/Color/SKColorSystem+Medal.swift @@ -0,0 +1,20 @@ +import SwiftUI + +public extension Color.SKColorSystem { + // swiftlint:disable identifier_name + enum Medal: SKColorable { + case firstplace + case secondplace + case thirdplace + } +} + +public extension Color.SKColorSystem.Medal { + var color: Color { + switch self { + case .firstplace: return StackKnowledgeAsset.Medal.firstPlace.swiftUIColor + case .secondplace: return StackKnowledgeAsset.Medal.secondPlace.swiftUIColor + case .thirdplace: return StackKnowledgeAsset.Medal.thirdPlace.swiftUIColor + } + } +} diff --git a/App/Sources/DesignSystem/Extensions/View/LogoNavigationBar.swift b/App/Sources/DesignSystem/Extensions/View/LogoNavigationBar.swift new file mode 100644 index 0000000..5fcbb39 --- /dev/null +++ b/App/Sources/DesignSystem/Extensions/View/LogoNavigationBar.swift @@ -0,0 +1,47 @@ +import SwiftUI + +struct LogoNavigationBarModifier: ViewModifier { + + var logo: Image = Image(asset: StackKnowledgeAsset.Logo.logoIcon) + var title: String = "Stack Knowledge" + + func body(content: Content) -> some View { + content + .navigationBarBackButtonHidden(true) + .toolbar { + ToolbarItemGroup(placement: .navigationBarLeading) { + HStack { + logo + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: 20, height: 20) + + Spacer() + .frame(width: 10) + + Text(title) + .skFont(.r18) + } + } + ToolbarItem(placement: .navigationBarTrailing) { + Button(action: { + + // logout 동작 필요. + + }) { + Image(asset: StackKnowledgeAsset.Logout.logoutIcon) + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: 24, height: 24) + .foregroundColor(.primary) + } + } + } + } +} + +public extension View { + func logoNavigationBar() -> some View { + self.modifier(LogoNavigationBarModifier()) + } +} diff --git a/App/Sources/DesignSystem/Image/SKBannerImage.swift b/App/Sources/DesignSystem/Image/SKBannerImage.swift index 7b9d560..799387c 100644 --- a/App/Sources/DesignSystem/Image/SKBannerImage.swift +++ b/App/Sources/DesignSystem/Image/SKBannerImage.swift @@ -19,19 +19,19 @@ public struct SKBannerImage: View { } public var body: some View { - smsImageToImage() + skImageToImage() .resizable() .renderingMode(renderingMode) } - private func smsImageToImage() -> SwiftUI.Image { + private func skImageToImage() -> SwiftUI.Image { switch image { case .Banner1: return StackKnowledgeAsset.Banner.bannerImage1.swiftUIImage case .Banner2: - return StackKnowledgeAsset.Banner.bannerImage1.swiftUIImage + return StackKnowledgeAsset.Banner.bannerImage2.swiftUIImage case .Banner3: - return StackKnowledgeAsset.Banner.bannerImage1.swiftUIImage + return StackKnowledgeAsset.Banner.bannerImage3.swiftUIImage } } } diff --git a/App/Sources/DesignSystem/Image/SKBaseProfileImage.swift b/App/Sources/DesignSystem/Image/SKBaseProfileImage.swift index 4d8f9e2..d0250be 100644 --- a/App/Sources/DesignSystem/Image/SKBaseProfileImage.swift +++ b/App/Sources/DesignSystem/Image/SKBaseProfileImage.swift @@ -17,12 +17,12 @@ public struct SKBaseProfileImage: View { } public var body: some View { - smsImageToImage() + skImageToImage() .resizable() .renderingMode(renderingMode) } - private func smsImageToImage() -> SwiftUI.Image { + private func skImageToImage() -> SwiftUI.Image { switch image { case .BaseProfileImage: return StackKnowledgeAsset.BaseProfile.baseProfileImage.swiftUIImage diff --git a/App/Sources/DesignSystem/Image/SKSignUpImage.swift b/App/Sources/DesignSystem/Image/SKSignUpImage.swift index 4431a5b..d8f436d 100644 --- a/App/Sources/DesignSystem/Image/SKSignUpImage.swift +++ b/App/Sources/DesignSystem/Image/SKSignUpImage.swift @@ -17,12 +17,12 @@ public struct SKImage: View { } public var body: some View { - smsImageToImage() + skImageToImage() .resizable() .renderingMode(renderingMode) } - private func smsImageToImage() -> SwiftUI.Image { + private func skImageToImage() -> SwiftUI.Image { switch image { case .SignUpBackground: return StackKnowledgeAsset.SignUp.signUpBackground.swiftUIImage diff --git a/App/Sources/DesignSystem/View/MainMissionScrollView.swift b/App/Sources/DesignSystem/View/MainMissionScrollView.swift new file mode 100644 index 0000000..d75adee --- /dev/null +++ b/App/Sources/DesignSystem/View/MainMissionScrollView.swift @@ -0,0 +1,44 @@ +import Service +import SwiftUI + +struct MainMissionScrollView: View { + let missionDataList: [MissionListEntity] + + var body: some View { + VStack { + ScrollView(.horizontal, showsIndicators: false) { + HStack(spacing: 16) { + ForEach(missionDataList.indices, id: \.self) { mission in + if let missionList = missionDataList[safe: mission] { + VStack(alignment: .center) { + Text(missionList.user.userName) + .skFont(.pm14) + .padding(.top, 16) + + Text(missionList.missionTitle) + .skFont(.pr12) + .lineLimit(3) + .padding(.top, 16) + .padding(.horizontal, 16) + + Spacer() + + Text(missionList.missionPoint.description) + .skFont(.pm16) + .padding(.bottom, 24) + } + .padding(.init(top: 18, leading: 40, bottom: 18, trailing: 40)) + .background(Color.white) + .cornerRadius(10) + } + } + } + } + .frame(height: 160) + .padding(.vertical, 16) + .padding(.horizontal, 16) + .background(Color.SKColorSystem.Gray.lightgray1.color) + .cornerRadius(20) + } + } +} diff --git a/App/Sources/DesignSystem/View/MainRankingScrollView.swift b/App/Sources/DesignSystem/View/MainRankingScrollView.swift new file mode 100644 index 0000000..8a4c7d4 --- /dev/null +++ b/App/Sources/DesignSystem/View/MainRankingScrollView.swift @@ -0,0 +1,67 @@ +import Service +import SwiftUI + +struct MainRankingScrollView: View { + let rankingDataList: [PointRankingListEntity] + + var body: some View { + ScrollView(.horizontal, showsIndicators: false) { + HStack(spacing: 16) { + ForEach(rankingDataList.indices, id: \.self) { ranking in + if let rankingList = rankingDataList[safe: ranking] { + ZStack(alignment: .topLeading) { + VStack { + AsyncImage(url: URL(string: rankingList.user.profileImage)) + .frame(width: 60, height: 60) + .clipShape(Circle()) + .clipped() + + Text(rankingList.user.userName) + .skFont(.pm14) + + Spacer().frame(height: 16) + + Text(rankingList.cumulatePoint.description) + .skFont(.pm16) + } + .padding(.init(top: 18, leading: 30, bottom: 18, trailing: 30)) + .background(Color.white) + .cornerRadius(10) + + if ranking == 0 { + Circle() + .frame(width: 20, height: 20) + .foregroundColor(Color.SKColorSystem.Medal.firstplace.color) + .overlay( + Text("1") + .skFont(.pm14) + ) + } else if ranking == 1 { + Circle() + .frame(width: 20, height: 20) + .foregroundColor(Color.SKColorSystem.Medal.secondplace.color) + .overlay( + Text("2") + .skFont(.pm14) + ) + } else if ranking == 2 { + Circle() + .frame(width: 20, height: 20) + .foregroundColor(Color.SKColorSystem.Medal.thirdplace.color) + .overlay( + Text("3") + .skFont(.pm14) + ) + } + } + } + } + } + } + .frame(height: 160) + .padding(.vertical, 16) + .padding(.horizontal, 16) + .background(Color.SKColorSystem.Gray.lightgray1.color) + .cornerRadius(20) + } +} diff --git a/App/Sources/Presentation/Root/RootView.swift b/App/Sources/Presentation/Root/RootView.swift index 3e2d344..74fd5a9 100644 --- a/App/Sources/Presentation/Root/RootView.swift +++ b/App/Sources/Presentation/Root/RootView.swift @@ -29,7 +29,7 @@ struct RootView: View { .environmentObject(sceneState) case .studentMain: - AnyView(teacherTabBarFactory.makeView()) + AnyView(studentTabBarFactory.makeView()) .environmentObject(sceneState) } } diff --git a/App/Sources/Presentation/StudentMain/Source/DI/StudentMainComponent.swift b/App/Sources/Presentation/StudentMain/Source/DI/StudentMainComponent.swift index a14557b..46a3447 100644 --- a/App/Sources/Presentation/StudentMain/Source/DI/StudentMainComponent.swift +++ b/App/Sources/Presentation/StudentMain/Source/DI/StudentMainComponent.swift @@ -6,6 +6,15 @@ public protocol StudentMainDependency: Dependency {} public final class StudentMainComponent: Component, StudentMainFactory { public func makeView() -> some View { - StudentMainView() + let model = StudentMainModel() + let intent = StudentMainIntent() + + let container = MVIContainer( + intent: intent, + model: model as StudentMainModelStateProtocol, + modelChangePublisher: model.objectWillChange + ) + + return StudentMainView(studentMainContainer: container) } } diff --git a/App/Sources/Presentation/StudentMain/Source/Intent/StudentMainIntent.swift b/App/Sources/Presentation/StudentMain/Source/Intent/StudentMainIntent.swift new file mode 100644 index 0000000..83d2804 --- /dev/null +++ b/App/Sources/Presentation/StudentMain/Source/Intent/StudentMainIntent.swift @@ -0,0 +1,7 @@ +import Foundation + +final class StudentMainIntent { + + //추후에 action 관련 작성 예정. + +} diff --git a/App/Sources/Presentation/StudentMain/Source/Model/StudentMainModel.swift b/App/Sources/Presentation/StudentMain/Source/Model/StudentMainModel.swift new file mode 100644 index 0000000..191cc71 --- /dev/null +++ b/App/Sources/Presentation/StudentMain/Source/Model/StudentMainModel.swift @@ -0,0 +1,7 @@ +import Foundation +import Service + +final class StudentMainModel: ObservableObject, StudentMainModelStateProtocol { + @Published var missionDataList: [MissionListEntity] = [] + @Published var rankingDataList: [PointRankingListEntity] = [] +} diff --git a/App/Sources/Presentation/StudentMain/Source/Model/StudentMainModelStateProtocol.swift b/App/Sources/Presentation/StudentMain/Source/Model/StudentMainModelStateProtocol.swift new file mode 100644 index 0000000..b4c704d --- /dev/null +++ b/App/Sources/Presentation/StudentMain/Source/Model/StudentMainModelStateProtocol.swift @@ -0,0 +1,7 @@ +import Foundation +import Service + +protocol StudentMainModelStateProtocol { + var missionDataList: [MissionListEntity] { get } + var rankingDataList: [PointRankingListEntity] { get } +} diff --git a/App/Sources/Presentation/StudentMain/Source/Scene/StudentMainView.swift b/App/Sources/Presentation/StudentMain/Source/Scene/StudentMainView.swift index 76b762a..2222592 100644 --- a/App/Sources/Presentation/StudentMain/Source/Scene/StudentMainView.swift +++ b/App/Sources/Presentation/StudentMain/Source/Scene/StudentMainView.swift @@ -1,9 +1,32 @@ import SwiftUI +import PopupView + struct StudentMainView: View { + @StateObject var studentMainContainer: MVIContainer + var body: some View { - VStack(spacing: 0) { - Text("Main View") + NavigationView { + ScrollView { + BannerView() + + VStack(alignment: .leading) { + Text("* 문제는 12:30 ~ 19:30분까지 풀수 있습니다.") + .skFont(.pr12) + + Text("문제 풀기") + .skFont(.ps18) + .padding(.top, 15) + + MainMissionScrollView(missionDataList: studentMainContainer.model.missionDataList) + .padding(.top, 8) + + MainRankingScrollView(rankingDataList: studentMainContainer.model.rankingDataList) + .padding(.top, 10) + } + .padding(.horizontal, 16) + } + .logoNavigationBar() } } } diff --git a/App/Sources/Presentation/TeacherMain/Source/Scene/SignupListPopupView.swift b/App/Sources/Presentation/TeacherMain/Source/Scene/SignupListPopupView.swift new file mode 100644 index 0000000..5922dc8 --- /dev/null +++ b/App/Sources/Presentation/TeacherMain/Source/Scene/SignupListPopupView.swift @@ -0,0 +1,75 @@ +import SwiftUI + +struct SignupListPopupView: View { + @Binding var showPopup: Bool + + var body: some View { + VStack { + HStack { + Spacer() + Button(action: { + showPopup = false + }) { + Image(systemName: "xmark") + .foregroundColor(.black) + .padding(.top, 18) + .padding(.trailing, 18) + } + } + .frame(height: 50) + + ScrollView(.vertical, showsIndicators: false) { + VStack(spacing: 10) { + ForEach(1..<4) { _ in + VStack { + HStack(spacing: 10) { + Spacer() + + Text("") // TeacherMain페이지 model 완성 후 그에 맞는 데이터 삽입 필요 + .skFont(.pm16) + + Text("-") + + Text("") // TeacherMain페이지 model 완성 후 그에 맞는 데이터 삽입 필요 + .skFont(.pm16) + + Button { + + //회원가입 수락 동작 필요. + + } label: { + Text("수락") + .frame(width: 45, height: 21) + .background(Color.SKColorSystem.Main.mainColor.color) + .foregroundColor(Color.white) + .cornerRadius(2) + } + + Button { + + //회원가입 거절 동작 필요. + + } label: { + Text("거절") + .frame(width: 45, height: 21) + .background(Color.SKColorSystem.Main.mainColor.color) + .foregroundColor(Color.white) + .cornerRadius(2) + } + } + } + .frame(width: 270, height: 50) + } + } + } + .frame(width: 270, height: 245) + + Spacer() + } + .frame(width: 328, height: 345) + .background(Color.white) + .cornerRadius(20) + .shadow(radius: 10) + .padding(.top, 25) + } +} diff --git a/App/Sources/Presentation/TeacherMain/Source/Scene/TeacherMainView.swift b/App/Sources/Presentation/TeacherMain/Source/Scene/TeacherMainView.swift index 84c8cbf..6417c40 100644 --- a/App/Sources/Presentation/TeacherMain/Source/Scene/TeacherMainView.swift +++ b/App/Sources/Presentation/TeacherMain/Source/Scene/TeacherMainView.swift @@ -4,6 +4,33 @@ struct TeacherMainView: View { var body: some View { VStack(spacing: 0) { Text("Main View") + +// .overlay(alignment: .bottomTrailing) { +// Button { +// showPopup = true +// } label: { +// Image(systemName: "person.2") +// .resizable() +// .foregroundColor(.white) +// .padding(16) +// .background(Circle().fill(Color.SKColorSystem.Main.mainColor.color)) +// .frame(width: 60, height: 60) +// .padding(.trailing, 30) +// .padding(.bottom, 74) +// } +// } +// .popup(isPresented: $showPopup) { +// SignupListPopupView(studentMainContainer: studentMainContainer, showPopup: $showPopup) +// } customize: { +// $0 +// .type(.default) +// .position(.center) +// .animation(.spring()) +// .closeOnTapOutside(false) +// .closeOnTap(false) +// } +// TeacherMainView UI 작성할 시 주석 제거 필요 + } } } diff --git a/App/Sources/Presentation/TeacehrTabBar/Interface/TeacherTabBarFactory.swift b/App/Sources/Presentation/TeacherTabBar/Interface/TeacherTabBarFactory.swift similarity index 100% rename from App/Sources/Presentation/TeacehrTabBar/Interface/TeacherTabBarFactory.swift rename to App/Sources/Presentation/TeacherTabBar/Interface/TeacherTabBarFactory.swift diff --git a/App/Sources/Presentation/TeacehrTabBar/Source/TeacherTabBarComponent.swift b/App/Sources/Presentation/TeacherTabBar/Source/TeacherTabBarComponent.swift similarity index 100% rename from App/Sources/Presentation/TeacehrTabBar/Source/TeacherTabBarComponent.swift rename to App/Sources/Presentation/TeacherTabBar/Source/TeacherTabBarComponent.swift diff --git a/App/Sources/Presentation/TeacehrTabBar/Source/TeacherTabBarView.swift b/App/Sources/Presentation/TeacherTabBar/Source/TeacherTabBarView.swift similarity index 100% rename from App/Sources/Presentation/TeacehrTabBar/Source/TeacherTabBarView.swift rename to App/Sources/Presentation/TeacherTabBar/Source/TeacherTabBarView.swift diff --git a/ThirdPartyLib/Project.swift b/ThirdPartyLib/Project.swift index 2ec1f4c..c384f61 100644 --- a/ThirdPartyLib/Project.swift +++ b/ThirdPartyLib/Project.swift @@ -8,6 +8,7 @@ let project = Project.dynamicFramework( dependencies: [ .SPM.Alamofire, .SPM.NeedleFoundation, + .SPM.PopupView, ], scripts: [.SwiftLintString] ) diff --git a/Tuist/Dependencies.swift b/Tuist/Dependencies.swift index bcbe7b5..30cf855 100644 --- a/Tuist/Dependencies.swift +++ b/Tuist/Dependencies.swift @@ -12,6 +12,9 @@ let dependencies = Dependencies( url: "https://github.com/Alamofire/Alamofire.git", requirement: .upToNextMajor(from: "5.8.1") ), + .remote(url: "https://github.com/exyte/PopupView.git", + requirement: .upToNextMajor(from: "3.0.4") + ) ], baseSettings: .settings( configurations: [ diff --git a/Tuist/ProjectDescriptionHelpers/TargetDependency.swift b/Tuist/ProjectDescriptionHelpers/TargetDependency.swift index 9c4b38e..5334d89 100644 --- a/Tuist/ProjectDescriptionHelpers/TargetDependency.swift +++ b/Tuist/ProjectDescriptionHelpers/TargetDependency.swift @@ -7,6 +7,7 @@ public extension TargetDependency { public extension TargetDependency.SPM { static let NeedleFoundation = TargetDependency.external(name: "NeedleFoundation") static let Alamofire = TargetDependency.external(name: "Alamofire") + static let PopupView = TargetDependency.external(name: "PopupView") } public extension Package {}