diff --git a/SOPT-iOS/Projects/Core/Sources/Amplitude/AmplitudeEventType.swift b/SOPT-iOS/Projects/Core/Sources/Amplitude/AmplitudeEventType.swift index 5520a8309..86e8349a1 100644 --- a/SOPT-iOS/Projects/Core/Sources/Amplitude/AmplitudeEventType.swift +++ b/SOPT-iOS/Projects/Core/Sources/Amplitude/AmplitudeEventType.swift @@ -31,6 +31,7 @@ public enum AmplitudeEventType: String { case clickShortcutButton = "click_link.btn" case clickReadAllButton = "click_allread.btn" case clickNotificationItem = "click_notification_item" + case clickCoffeeChat = "at38_playground_coffee_chat" // 먼저 배포된 안드로이드 컨벤션에 맞춤. 앰플리튜드 tf 개설 후 click_으로 통일하여 사용할 예정 // 신규 홈 클릭 이벤트 case clickAllCalendar = "click_all_calendar" diff --git a/SOPT-iOS/Projects/Core/Sources/Enum/ServiceType.swift b/SOPT-iOS/Projects/Core/Sources/Enum/ServiceType.swift index 68421880b..dcffd9b56 100644 --- a/SOPT-iOS/Projects/Core/Sources/Enum/ServiceType.swift +++ b/SOPT-iOS/Projects/Core/Sources/Enum/ServiceType.swift @@ -18,8 +18,8 @@ public enum ServiceType { case member case group case instagram - case playgroundCommunity - + case coffeechat + public var serviceDomainLink: String { switch self { case .officialHomepage: return ExternalURL.SOPT.officialHomepage @@ -31,7 +31,7 @@ public enum ServiceType { case .member: return ExternalURL.Playground.member case .group: return ExternalURL.Playground.group case .instagram: return ExternalURL.SNS.instagram - case .playgroundCommunity: return ExternalURL.Playground.playgroundCommunity + case .coffeechat: return ExternalURL.Playground.coffeechat } } } diff --git a/SOPT-iOS/Projects/Core/Sources/Enum/ServiceTypeTransform.swift b/SOPT-iOS/Projects/Core/Sources/Enum/ServiceTypeTransform.swift index b6cd60c31..dbce14330 100644 --- a/SOPT-iOS/Projects/Core/Sources/Enum/ServiceTypeTransform.swift +++ b/SOPT-iOS/Projects/Core/Sources/Enum/ServiceTypeTransform.swift @@ -9,7 +9,7 @@ import Foundation public extension ServiceType { - var toAmplitudeEventType: AmplitudeEventType { + var toAmplitudeEventType: AmplitudeEventType? { switch self { case .officialHomepage: return .clickOfficialHomepage case .review: return .clickReview @@ -20,7 +20,7 @@ public extension ServiceType { case .member: return .clickMember case .group: return .clickMoim case .instagram: return .clickInstagram - case .playgroundCommunity: return .clickPlaygroundCommunity + case .coffeechat: return .clickCoffeeChat } } } diff --git a/SOPT-iOS/Projects/Core/Sources/Literals/ExternalURL.swift b/SOPT-iOS/Projects/Core/Sources/Literals/ExternalURL.swift index 01a95d9a5..c2aea5a4b 100644 --- a/SOPT-iOS/Projects/Core/Sources/Literals/ExternalURL.swift +++ b/SOPT-iOS/Projects/Core/Sources/Literals/ExternalURL.swift @@ -48,12 +48,13 @@ public struct ExternalURL { public static let project = "\(main)/projects" public static let member = "\(main)/members" public static let group = "\(main)/group?utm_source=playground_group&utm_medium=app_button&utm_campaign=app" - public static let playgroundCommunity = main - public static let feed = "\(main)/feed/upload" + public static let feedUpload = "\(main)/feed/upload" + public static let feed = "\(main)/feed" public static let blog = "\(main)/blog" public static let makeGroup = "\(main)/group/make" public static let makeLightGroup = "\(main)/group/make/flash" public static let makeGroupFeed = "\(main)/group?modal=create-feed" public static let editProfile = "\(main)/members/edit" + public static let coffeechat = "\(main)/coffeechat" } } diff --git a/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift b/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift index eb2bee056..71334ccbf 100644 --- a/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift +++ b/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift @@ -266,17 +266,18 @@ public struct I18N { public struct MainProduct { public static let headerTitleForVisitor = "SOPT를 더 알고 싶다면, 둘러보세요" - public static let playground = "Playground" + public static let soptPlayground = "SOPT Playground" public static let groupAndStudy = "모임/스터디" public static let member = "멤버" public static let project = "프로젝트" + public static let coffeechat = "커피솝" public static let homePage = "홈페이지" public static let activityReview = "활동후기" public static let instagram = "인스타그램" } public struct PopularPosts { - public static let headerTitle = "실시간 인기글" + public static let headerTitle = "지금 인기 소식" public static let morePosts = "다른 게시물 보러가기" } diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/Amplitude/HomeAmplitudeEventPropertyValue.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/Amplitude/HomeAmplitudeEventPropertyValue.swift index 41f899ee4..cc0ccae93 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/Amplitude/HomeAmplitudeEventPropertyValue.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/Amplitude/HomeAmplitudeEventPropertyValue.swift @@ -12,6 +12,7 @@ import Core enum HomeAmplitudeEventPropertyValue: String, AmplitudeEventPropertyValueConvertible { case latestPosts = "latest_posts" + case popularPosts = "popular_posts" case realTimeFeed = "realtime_feed" case homeBanner = "home_banner" case homeFAB = "home_fab" diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/CollectionView/CompositionalLayout/HomeForMemberCompositionalLayout.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/CollectionView/CompositionalLayout/HomeForMemberCompositionalLayout.swift index 31b3d1ab9..c9ded57c6 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/CollectionView/CompositionalLayout/HomeForMemberCompositionalLayout.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/CollectionView/CompositionalLayout/HomeForMemberCompositionalLayout.swift @@ -96,25 +96,33 @@ extension HomeForMemberVC { } private func createMainProductSection() -> NSCollectionLayoutSection { + /// header: SOPT Playground + let headerSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), + heightDimension: .absolute(30)) + let header = NSCollectionLayoutBoundarySupplementaryItem(layoutSize: headerSize, + elementKind: UICollectionView.elementKindSectionHeader, + alignment: .top) + /// item: 프로덕트 카드 let productItemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.25), heightDimension: .absolute(92)) let productItem = NSCollectionLayoutItem(layoutSize: productItemSize) - + /// group: 프로덕트 카드 let productGroupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .estimated(92)) let productGroup = NSCollectionLayoutGroup.horizontal(layoutSize: productGroupSize, subitems: [productItem]) productGroup.interItemSpacing = .fixed(Metric.productItemSpacing) - + /// section 지정 let section = NSCollectionLayoutSection(group: productGroup) - section.contentInsets = NSDirectionalEdgeInsets(top: Metric.defaultItemSpacing, + section.boundarySupplementaryItems = [header] + section.contentInsets = NSDirectionalEdgeInsets(top: 12, leading: Metric.collectionViewDefaultSideInset, bottom: Metric.mainProductSectionSpacing, trailing: Metric.collectionViewDefaultSideInset) - + return section } @@ -156,12 +164,12 @@ extension HomeForMemberVC { elementKind: UICollectionView.elementKindSectionHeader, alignment: .top) - /// item: 실시간 인기글 + /// item: 지금 인기 소식 let popularPostsItemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .absolute(122)) let popularPostsItem = NSCollectionLayoutItem(layoutSize: popularPostsItemSize) - /// group: 실시간 인기글 + /// group: 지금 인기 소식 let popularPostsGroupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .estimated(122)) let popularPostsGroup = NSCollectionLayoutGroup.vertical(layoutSize: popularPostsGroupSize, diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/CollectionView/Protocol/HomeSectionUIConfigurable.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/CollectionView/Protocol/HomeSectionUIConfigurable.swift index a6433a6a2..9a6020121 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/CollectionView/Protocol/HomeSectionUIConfigurable.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/CollectionView/Protocol/HomeSectionUIConfigurable.swift @@ -10,6 +10,11 @@ import Foundation protocol HomeSectionUIConfigurable { var headerTitle: String { get } - var shouldShowFireIcon: Bool { get } // fire 아이콘의 유무 - var shouldShowViewAllContentButton: Bool { get } // 전체보기 버튼의 유무 + var shouldShowFireIcon: Bool { get } + var shouldShowViewAllContentButton: Bool { get } + var isSubSectionHeader: Bool { get } +} + +extension HomeSectionUIConfigurable { + var isSubSectionHeader: Bool { return false } } diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/CollectionView/Registration/HomeForMemberItemProvider.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/CollectionView/Registration/HomeForMemberItemProvider.swift index 6bd6ea427..e92bcb934 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/CollectionView/Registration/HomeForMemberItemProvider.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/CollectionView/Registration/HomeForMemberItemProvider.swift @@ -118,7 +118,7 @@ extension HomeForMemberVC { headerView.viewAllContentButtonTap .withUnretained(self) .sink { owner, _ in - owner.viewAllButtonTapped.send() + owner.viewAllButtonTapped.send(sectionKind) } .store(in: headerView.cancelBag) } diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/CollectionView/SectionLayoutKind/HomeForMemberSectionLayoutKind.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/CollectionView/SectionLayoutKind/HomeForMemberSectionLayoutKind.swift index 30643ef6f..359934c20 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/CollectionView/SectionLayoutKind/HomeForMemberSectionLayoutKind.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/CollectionView/SectionLayoutKind/HomeForMemberSectionLayoutKind.swift @@ -23,6 +23,8 @@ enum HomeForMemberSectionLayoutKind: Int, CaseIterable { extension HomeForMemberSectionLayoutKind: HomeSectionUIConfigurable { var headerTitle: String { switch self { + case .mainProduct: + return I18N.Home.MainProduct.soptPlayground case .popularPosts: return I18N.Home.PopularPosts.headerTitle case .latestPosts: @@ -31,12 +33,16 @@ extension HomeForMemberSectionLayoutKind: HomeSectionUIConfigurable { return "" } } - + var shouldShowFireIcon: Bool { return self == .popularPosts } - + var shouldShowViewAllContentButton: Bool { - return self == .latestPosts + return self == .popularPosts || self == .latestPosts + } + + var isSubSectionHeader: Bool { + return self == .mainProduct } } diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/VC/HomeForMemberVC.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/VC/HomeForMemberVC.swift index e729cbdb1..af846ba69 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/VC/HomeForMemberVC.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/VC/HomeForMemberVC.swift @@ -31,7 +31,7 @@ final class HomeForMemberVC: UIViewController, HomeForMemberViewControllable { private var cellTapped = PassthroughSubject() private(set) var attendanceButtonTapped = PassthroughSubject() private(set) var surveyButtonTapped = PassthroughSubject() - private(set) var viewAllButtonTapped = PassthroughSubject() + private(set) var viewAllButtonTapped = PassthroughSubject() private var socialLinkButtonTapped = PassthroughSubject() private(set) var profileImageViewTapped = PassthroughSubject() private(set) var profileEditTapped = PassthroughSubject() diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/HomeForMemberViewModel.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/HomeForMemberViewModel.swift index 63441fb01..e39db441e 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/HomeForMemberViewModel.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/HomeForMemberViewModel.swift @@ -34,10 +34,10 @@ public class HomeForMemberViewModel: HomeForMemberViewModelType { @Published private(set) var isFABTapped: Bool = false let productServiceList: [HomePresentationModel.ProductService] = [ - .init(product: .playgroundCommunity), - .init(product: .group), .init(product: .member), - .init(product: .project) + .init(product: .group), + .init(product: .project), + .init(product: .coffeechat) ] let socialLinkList: [HomePresentationModel.SocialLink] = [ @@ -60,7 +60,7 @@ public class HomeForMemberViewModel: HomeForMemberViewModelType { let extendedFloatingButtonTapped: Driver let surveyButtonTapped: Driver let socialLinkButtonTapped: Driver - let viewAllButtonTapped: Driver + let viewAllButtonTapped: Driver let profileImageViewTapped: Driver let editProfileTapped: Driver } @@ -204,9 +204,10 @@ extension HomeForMemberViewModel { input.viewAllButtonTapped .withUnretained(self) - .sink { owner, _ in - owner.onViewAllContentButtonTapped?(ExternalURL.Playground.main) - owner.eventTracker.trackClickViewAll(sectionName: .latestPosts) + .sink { owner, sectionKind in + owner.onViewAllContentButtonTapped?(ExternalURL.Playground.feed) + let sectionName: HomeAmplitudeEventPropertyValue = sectionKind == .popularPosts ? .popularPosts : .latestPosts + owner.eventTracker.trackClickViewAll(sectionName: sectionName) } .store(in: cancelBag) diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/ServiceTypeExtension.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/ServiceTypeExtension.swift index 8bd9ba9f9..a644c61ac 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/ServiceTypeExtension.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/ServiceTypeExtension.swift @@ -27,8 +27,8 @@ extension ServiceType { return DSKitAsset.Assets.imgGroupLogo.image case .instagram: return DSKitAsset.Assets.imgInstagram.image - case .playgroundCommunity: - return DSKitAsset.Assets.imgPlaygroundLogo.image + case .coffeechat: + return DSKitAsset.Assets.icCoffeechat.image case .youtube: return DSKitAsset.Assets.icYoutube.image default: @@ -50,8 +50,8 @@ extension ServiceType { return I18N.Home.MainProduct.groupAndStudy case .instagram: return I18N.Home.MainProduct.instagram - case .playgroundCommunity: - return I18N.Home.MainProduct.playground + case .coffeechat: + return I18N.Home.MainProduct.coffeechat case .youtube: return I18N.Home.SocialLink.youtube default: diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Views/FABButton/MenuSectionItem.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Views/FABButton/MenuSectionItem.swift index 200136fc4..a70da3b73 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Views/FABButton/MenuSectionItem.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Views/FABButton/MenuSectionItem.swift @@ -46,7 +46,7 @@ enum FABMenuSection: CaseIterable, FABMenuSectionProtocol { case .playground: return [MenuSectionItem(title: I18N.TabBar.Playground.write, icon: DSKitAsset.Assets.icFabPencil.image, - url: ExternalURL.Playground.feed)] + url: ExternalURL.Playground.feedUpload)] case .groupAndStudy: return [ MenuSectionItem(title: I18N.TabBar.GroupAndStudy.makeGroup, diff --git a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Views/HomeDefaultHeaderView.swift b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Views/HomeDefaultHeaderView.swift index 2a128ebf3..44606d41e 100644 --- a/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Views/HomeDefaultHeaderView.swift +++ b/SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/Views/HomeDefaultHeaderView.swift @@ -110,5 +110,21 @@ extension HomeDefaultHeaderView { self.titleLabel.text = sectionKind.headerTitle self.fireImageView.isHidden = !sectionKind.shouldShowFireIcon self.viewAllContentButton.isHidden = !sectionKind.shouldShowViewAllContentButton + + if sectionKind.isSubSectionHeader { + titleLabel.font = DSKitFontFamily.Suit.semiBold.font(size: 14) + titleLabel.textColor = DSKitAsset.Colors.gray400.color + titleLabel.snp.remakeConstraints { make in + make.leading.equalToSuperview() + make.top.equalToSuperview().offset(12) + } + } else { + titleLabel.font = DSKitFontFamily.Suit.bold.font(size: 20) + titleLabel.textColor = DSKitAsset.Colors.white.color + titleLabel.snp.remakeConstraints { make in + make.leading.equalToSuperview() + make.centerY.equalToSuperview() + } + } } } diff --git a/SOPT-iOS/Projects/Features/TabBarFeature/Sources/FABButton/MenuSectionItem.swift b/SOPT-iOS/Projects/Features/TabBarFeature/Sources/FABButton/MenuSectionItem.swift index 200136fc4..a70da3b73 100644 --- a/SOPT-iOS/Projects/Features/TabBarFeature/Sources/FABButton/MenuSectionItem.swift +++ b/SOPT-iOS/Projects/Features/TabBarFeature/Sources/FABButton/MenuSectionItem.swift @@ -46,7 +46,7 @@ enum FABMenuSection: CaseIterable, FABMenuSectionProtocol { case .playground: return [MenuSectionItem(title: I18N.TabBar.Playground.write, icon: DSKitAsset.Assets.icFabPencil.image, - url: ExternalURL.Playground.feed)] + url: ExternalURL.Playground.feedUpload)] case .groupAndStudy: return [ MenuSectionItem(title: I18N.TabBar.GroupAndStudy.makeGroup, diff --git a/SOPT-iOS/Projects/Modules/DSKit/Resources/Assets.xcassets/Home/Image/ic_coffeechat.imageset/Contents.json b/SOPT-iOS/Projects/Modules/DSKit/Resources/Assets.xcassets/Home/Image/ic_coffeechat.imageset/Contents.json new file mode 100644 index 000000000..34a38f04c --- /dev/null +++ b/SOPT-iOS/Projects/Modules/DSKit/Resources/Assets.xcassets/Home/Image/ic_coffeechat.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "ic_coffeechat.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SOPT-iOS/Projects/Modules/DSKit/Resources/Assets.xcassets/Home/Image/ic_coffeechat.imageset/ic_coffeechat.svg b/SOPT-iOS/Projects/Modules/DSKit/Resources/Assets.xcassets/Home/Image/ic_coffeechat.imageset/ic_coffeechat.svg new file mode 100644 index 000000000..3ca255faf --- /dev/null +++ b/SOPT-iOS/Projects/Modules/DSKit/Resources/Assets.xcassets/Home/Image/ic_coffeechat.imageset/ic_coffeechat.svg @@ -0,0 +1,6 @@ + + + + + +