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

[Paywalls] Add Timeline component #4713

Merged
merged 5 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from 4 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
26 changes: 26 additions & 0 deletions RevenueCat.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,11 @@
4D322E382B7E7B170004AF53 /* PurchasesOrchestratorSK2Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D322E372B7E7B170004AF53 /* PurchasesOrchestratorSK2Tests.swift */; };
4D322E3A2B7E7B570004AF53 /* PurchasesOrchestratorSK1Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D322E392B7E7B570004AF53 /* PurchasesOrchestratorSK1Tests.swift */; };
4D322E3C2B7E7E250004AF53 /* PurchasesOrchestratorCommonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D322E3B2B7E7E250004AF53 /* PurchasesOrchestratorCommonTests.swift */; };
4D3BA4CC2D37D15E00668AFC /* PaywallTimelineComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D3BA4CB2D37D15E00668AFC /* PaywallTimelineComponent.swift */; };
4D3BA4CD2D37D15E00668AFC /* PaywallTimelineComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D3BA4CB2D37D15E00668AFC /* PaywallTimelineComponent.swift */; };
4D3BA5882D432E5900668AFC /* Fill.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D3BA5872D432E5700668AFC /* Fill.swift */; };
4D3BA5B22D47AB4400668AFC /* TimelineComponentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D3BA5AF2D47AB4400668AFC /* TimelineComponentView.swift */; };
4D3BA5B32D47AB4400668AFC /* TimelineComponentViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D3BA5B02D47AB4400668AFC /* TimelineComponentViewModel.swift */; };
4D6ABB0C2AF13F9400BB2A08 /* StoreKit2Receipt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D6ABB0B2AF13F9400BB2A08 /* StoreKit2Receipt.swift */; };
4D6ABB0E2AF13FB100BB2A08 /* StoreEnvironment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D6ABB0D2AF13FB100BB2A08 /* StoreEnvironment.swift */; };
4D6ABB102AF13FBD00BB2A08 /* SK2AppTransaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D6ABB0F2AF13FBD00BB2A08 /* SK2AppTransaction.swift */; };
Expand Down Expand Up @@ -1726,6 +1731,10 @@
4D322E372B7E7B170004AF53 /* PurchasesOrchestratorSK2Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PurchasesOrchestratorSK2Tests.swift; sourceTree = "<group>"; };
4D322E392B7E7B570004AF53 /* PurchasesOrchestratorSK1Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PurchasesOrchestratorSK1Tests.swift; sourceTree = "<group>"; };
4D322E3B2B7E7E250004AF53 /* PurchasesOrchestratorCommonTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PurchasesOrchestratorCommonTests.swift; sourceTree = "<group>"; };
4D3BA4CB2D37D15E00668AFC /* PaywallTimelineComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaywallTimelineComponent.swift; sourceTree = "<group>"; };
4D3BA5872D432E5700668AFC /* Fill.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Fill.swift; sourceTree = "<group>"; };
4D3BA5AF2D47AB4400668AFC /* TimelineComponentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineComponentView.swift; sourceTree = "<group>"; };
4D3BA5B02D47AB4400668AFC /* TimelineComponentViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineComponentViewModel.swift; sourceTree = "<group>"; };
4D4CADED2D09B06C004E85B7 /* SnapshotTestingStub */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = SnapshotTestingStub; sourceTree = "<group>"; };
4D6ABB0B2AF13F9400BB2A08 /* StoreKit2Receipt.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreKit2Receipt.swift; sourceTree = "<group>"; };
4D6ABB0D2AF13FB100BB2A08 /* StoreEnvironment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreEnvironment.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2634,6 +2643,7 @@
2CC791542CC0452100FBE120 /* Packages */,
88B1BAEA2C813A3C001B7EE5 /* Stack */,
0354AA452D4029C300F9E330 /* Tabs */,
4D3BA5B12D47AB4400668AFC /* Timeline */,
88B1BADC2C813A3C001B7EE5 /* Text */,
778360772CCA85D1000785B8 /* StickyFooter */,
778360742CCA84FA000785B8 /* Root */,
Expand All @@ -2647,6 +2657,7 @@
2C7457872CEDF7AC004ACE52 /* BackgroundStyle.swift */,
77089F9D2CD39EC100848CD5 /* ShadowModifier.swift */,
4D6F4BCF2CF69DE300353AF6 /* ForegroundColorScheme.swift */,
4D3BA5872D432E5700668AFC /* Fill.swift */,
4DEB9BC42D08CA1500D33E36 /* BadgeModifier.swift */,
2C91068D2CE2481800189565 /* SizeModifier.swift */,
2CAB87F62CAAB13200247013 /* Shape.swift */,
Expand Down Expand Up @@ -4085,6 +4096,15 @@
path = BasicTypes;
sourceTree = "<group>";
};
4D3BA5B12D47AB4400668AFC /* Timeline */ = {
isa = PBXGroup;
children = (
4D3BA5AF2D47AB4400668AFC /* TimelineComponentView.swift */,
4D3BA5B02D47AB4400668AFC /* TimelineComponentViewModel.swift */,
);
path = Timeline;
sourceTree = "<group>";
};
4D6F4BE62CFE2FAB00353AF6 /* PaywallsTesterTests */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -4913,6 +4933,7 @@
88AD01032C740CF400AA1F2B /* PaywallImageComponent.swift */,
03C72FBD2D34949600297FEC /* PaywallIconComponent.swift */,
88E679462C7503C1007E69D5 /* PaywallStackComponent.swift */,
4D3BA4CB2D37D15E00668AFC /* PaywallTimelineComponent.swift */,
03E37BE92D30B32200CD9678 /* PaywallTabsComponent.swift */,
88AD01072C740CF400AA1F2B /* PaywallTextComponent.swift */,
2C2AEB3A2CA7209F00A50F38 /* PaywallPackageComponent.swift */,
Expand Down Expand Up @@ -6181,6 +6202,7 @@
5774F9B62805E6CC00997128 /* CustomerInfoResponse.swift in Sources */,
03A98D302D240C41009BCA61 /* UIConfig.swift in Sources */,
B34605D1279A6E600031CA74 /* CustomerAPI.swift in Sources */,
4D3BA4CC2D37D15E00668AFC /* PaywallTimelineComponent.swift in Sources */,
35D159D12BC492E4004D8061 /* DiagnosticsHTTPRequestPath.swift in Sources */,
2DDF41A224F6F331005BC22D /* ProductsManager.swift in Sources */,
57CCC6EC2984496D001CE9B6 /* Box.swift in Sources */,
Expand Down Expand Up @@ -6703,6 +6725,7 @@
88A543E12C37A4820039C6A5 /* TemplateView+MultiTier.swift in Sources */,
3523048A2D0A0F30003971A4 /* ErrorView.swift in Sources */,
887A60B72C1D037000E1A461 /* WatchTemplateView.swift in Sources */,
4D3BA4CD2D37D15E00668AFC /* PaywallTimelineComponent.swift in Sources */,
887A60722C1D037000E1A461 /* PaywallViewMode+Extensions.swift in Sources */,
887A60C32C1D037000E1A461 /* FooterView.swift in Sources */,
2C7457212CE702BB004ACE52 /* PackageContext.swift in Sources */,
Expand Down Expand Up @@ -6746,6 +6769,7 @@
353FDC0F2CA446FA0055F328 /* StoreProductDiscount+Extensions.swift in Sources */,
03A98CF12D222F5F009BCA61 /* FallbackComponentPreview.swift in Sources */,
887A60862C1D037000E1A461 /* FooterHidingModifier.swift in Sources */,
4D3BA5882D432E5900668AFC /* Fill.swift in Sources */,
FDAD6AC72D132DD900FB047E /* CustomerCenterStoreKitUtilitiesType.swift in Sources */,
887A60C02C1D037000E1A461 /* AsyncButton.swift in Sources */,
887A60892C1D037000E1A461 /* PaywallPurchasesType.swift in Sources */,
Expand Down Expand Up @@ -6830,6 +6854,8 @@
88B1BAFC2C813A3C001B7EE5 /* ImageComponentView.swift in Sources */,
2C91068A2CE22D3500189565 /* FlexVStack.swift in Sources */,
571197642D3AE403000BC39E /* CustomerCenterNavigationOptions.swift in Sources */,
4D3BA5B22D47AB4400668AFC /* TimelineComponentView.swift in Sources */,
4D3BA5B32D47AB4400668AFC /* TimelineComponentViewModel.swift in Sources */,
03C72FC22D349BAE00297FEC /* IconComponentViewModel.swift in Sources */,
887A60872C1D037000E1A461 /* ViewExtensions.swift in Sources */,
2C8EC6DB2CCC23B700D6CCF8 /* MultiTierPreview.swift in Sources */,
Expand Down
3 changes: 2 additions & 1 deletion RevenueCatUI/Templates/V2/Components/ComponentsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ struct ComponentsView: View {
PurchaseButtonComponentView(viewModel: viewModel)
case .stickyFooter(let viewModel):
StickyFooterComponentView(viewModel: viewModel)

case .timeline(let viewModel):
TimelineComponentView(viewModel: viewModel)
case .tabs(let viewModel):
TabsComponentView(viewModel: viewModel, onDismiss: onDismiss)
case .tabControl(let viewModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ struct IconComponentView: View {
shadow: style.iconBackgroundShadow,
background: style.iconBackgroundStyle,
uiConfigProvider: self.viewModel.uiConfigProvider)
.padding(style.padding)
.padding(style.margin)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug fix: we're already applying the padding a few lines above. This is the margin but we were using the padding property.

.size(style.size)
.clipped()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't see a reason why the icon needs to be clipped. This is likely to clip the shadow if present, which is not intended.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy/paste from image 🫠

}
}

Expand Down Expand Up @@ -153,7 +152,7 @@ struct IconComponentView_Previews: PreviewProvider {
),
size: .init(width: .fixed(150), height: .fixed(150)),
padding: .init(top: 20, bottom: 20, leading: 20, trailing: 20),
margin: .zero,
margin: .init(top: 20, bottom: 20, leading: 20, trailing: 20),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-adding the margin so the snapshot stays the same

color: PaywallComponent.ColorScheme(
light: .hex("#ff0000")
),
Expand Down
Loading