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

Develop #14

Merged
merged 6 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .github/workflows/ci-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI - Pull Request
on:
pull_request:
branches:
- 'main'
- main
workflow_dispatch:

jobs:
Expand All @@ -11,7 +11,7 @@ jobs:
uses: oversizedev/GithubWorkflows/.github/workflows/build-swiftpm.yml@main
strategy:
matrix:
packages: [OversizeKit, OversizeAdsKit, OversizeCalendarKit, OversizeContactsKit, OversizeLocationKit, OversizeNoticeKit, OversizeNotificationKit, OversizeOnboardingKit, OversizePhotoKit]
packages: [OversizeKit, OversizeCalendarKit, OversizeContactsKit, OversizeLocationKit, OversizeNoticeKit, OversizeNotificationKit, OversizeOnboardingKit, OversizePhotoKit]
with:
package: ${{ matrix.packages }}
secrets: inherit
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/ci-push.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: CI - Push

on:
push:
branches: ["main"]
pull_request:
types:
- closed
branches:
- main
workflow_dispatch:

jobs:
Expand All @@ -12,7 +14,7 @@ jobs:
uses: oversizedev/GithubWorkflows/.github/workflows/build-swiftpm.yml@main
strategy:
matrix:
packages: [OversizeKit, OversizeAdsKit, OversizeCalendarKit, OversizeContactsKit, OversizeLocationKit, OversizeNoticeKit, OversizeNotificationKit, OversizeOnboardingKit, OversizePhotoKit]
packages: [OversizeKit, OversizeCalendarKit, OversizeContactsKit, OversizeLocationKit, OversizeNoticeKit, OversizeNotificationKit, OversizeOnboardingKit, OversizePhotoKit]
with:
package: ${{ matrix.packages }}
secrets: inherit
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Release
uses: softprops/action-gh-release@v1
5 changes: 1 addition & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ let productionDependencies: [PackageDescription.Package.Dependency] = [
.package(url: "https://github.com/oversizedev/OversizeModels.git", .upToNextMajor(from: "0.1.0")),
.package(url: "https://github.com/hmlongco/Factory.git", .upToNextMajor(from: "2.1.3")),
.package(url: "https://github.com/lorenzofiamingo/swiftui-cached-async-image.git", .upToNextMajor(from: "2.1.1")),
.package(url: "https://github.com/GetStream/effects-library.git", .upToNextMajor(from: "1.0.0")),
]

let developmentDependencies: [PackageDescription.Package.Dependency] = [
Expand All @@ -29,7 +28,6 @@ let developmentDependencies: [PackageDescription.Package.Dependency] = [
.package(name: "OversizeModels", path: "../OversizeModels"),
.package(url: "https://github.com/lorenzofiamingo/swiftui-cached-async-image.git", .upToNextMajor(from: "2.1.1")),
.package(url: "https://github.com/hmlongco/Factory.git", .upToNextMajor(from: "2.1.3")),
.package(url: "https://github.com/GetStream/effects-library.git", .upToNextMajor(from: "1.0.0")),
]

let isProductionDependencies = ProcessInfo.processInfo.environment["RELEASE_DEPENDENCIES"] == "TRUE"
Expand Down Expand Up @@ -68,8 +66,7 @@ let package = Package(
.product(name: "OversizeModels", package: "OversizeModels"),
.product(name: "OversizeNetwork", package: "OversizeNetwork"),
.product(name: "Factory", package: "Factory"),
.product(name: "CachedAsyncImage", package: "swiftui-cached-async-image"),
.product(name: "EffectsLibrary", package: "effects-library"),
.product(name: "CachedAsyncImage", package: "swiftui-cached-async-image")
]
),
.target(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public struct CreateEventView: View {
Button { viewModel.present(.calendar) } label: {
HStack(spacing: .xxxSmall) {
Circle()
.fill(Color(viewModel.calendar?.cgColor ?? UIColor.gray.cgColor))
.fill(Color(viewModel.calendar?.cgColor ?? CGColor.init(red: 0.4, green: 0.4, blue: 0.4, alpha: 1)))
.frame(width: 16, height: 16)
.padding(.xxxSmall)

Expand Down Expand Up @@ -149,6 +149,7 @@ public struct CreateEventView: View {
.body(.medium)
.scrollContentBackground(.hidden)
.background {
#if os(iOS)
RoundedRectangleCorner(radius: 4, corners: [.bottomLeft, .bottomRight])
.fillSurfaceSecondary()
.overlay(alignment: .topLeading) {
Expand All @@ -159,6 +160,18 @@ public struct CreateEventView: View {
.padding(.small)
}
}
#else
RoundedRectangle(cornerRadius: .small)
.fillSurfaceSecondary()
.overlay(alignment: .topLeading) {
if viewModel.note.isEmpty {
Text("Note")
.body(.medium)
.onSurfaceDisabledForegroundColor()
.padding(.small)
}
}
#endif
}
.frame(minHeight: 76)

Expand All @@ -169,8 +182,13 @@ public struct CreateEventView: View {
.padding(.horizontal, .small)
.padding(.vertical, 18)
.background {
#if os(iOS)
RoundedRectangleCorner(radius: 4, corners: [.topLeft, .topRight])
.fillSurfaceSecondary()
#else
RoundedRectangle(cornerRadius: .small)
.fillSurfaceSecondary()
#endif
}
}
.clipShape(RoundedRectangle(cornerRadius: .large, style: .continuous))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,25 @@ public extension CreateEventView {
Group {
switch sheet {
case .startTime:
#if os(iOS)
DatePickerSheet(title: "Starts time", selection: $viewModel.dateStart)
.onDisappear {
if viewModel.dateStart > viewModel.dateEnd {
viewModel.dateEnd = viewModel.dateStart.halfHour
}
}
.presentationDetents([.height(500)])
#else
EmptyView()
#endif
case .endTime:
#if os(iOS)
DatePickerSheet(title: "Ends time", selection: $viewModel.dateEnd)
.datePickerMinimumDate(viewModel.dateStart.minute)
.presentationDetents([.height(500)])
#else
EmptyView()
#endif
case .attachment:
AttachmentView()
.presentationDetents([.height(270)])
Expand Down
2 changes: 1 addition & 1 deletion Sources/OversizeCalendarKit/Pickers/CalendarPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public struct CalendarPicker: View {
}
}
}
.surfaceContentRowInsets()
.surfaceContentRowMargins()
}
}

Expand Down
6 changes: 5 additions & 1 deletion Sources/OversizeCalendarKit/Pickers/RepeatPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public struct RepeatPicker: View {
}))
.disabled(rule == .never)
}
.surfaceContentRowInsets()
.surfaceContentRowMargins()
}
.presentationDetents(rule == .never ? [.height(630), .large] : [.large])
.presentationDragIndicator(.hidden)
Expand All @@ -107,7 +107,9 @@ public struct RepeatPicker: View {
repeatCount = newValue
endRule = .occurrenceCount(Int(newValue) ?? 1)
}))
#if os(iOS)
.keyboardType(.numberPad)
#endif
.textFieldStyle(DefaultPlaceholderTextFieldStyle())
.focused($isFocusedRepitCount)
case .endDate:
Expand All @@ -117,7 +119,9 @@ public struct RepeatPicker: View {
endDate = newDate
endRule = .endDate(newDate)
}))
#if os(iOS)
.datePickerStyle(.wheel)
#endif
.labelsHidden()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public struct ContactsListsView: View {
@ViewBuilder
private func emailRow(email: CNLabeledValue<NSString>, contact: CNContact) -> some View {
let email = email.value as String
#if os(iOS)
if let avatarThumbnailData = contact.thumbnailImageData, let avatarThumbnail = UIImage(data: avatarThumbnailData) {
Row(contact.givenName + " " + contact.familyName, subtitle: email) {
Avatar(firstName: contact.givenName, lastName: contact.familyName, avatar: Image(uiImage: avatarThumbnail))
Expand All @@ -74,6 +75,11 @@ public struct ContactsListsView: View {
Avatar(firstName: contact.givenName, lastName: contact.familyName)
}
}
#else
Row(contact.givenName + " " + contact.familyName, subtitle: email) {
Avatar(firstName: contact.givenName, lastName: contact.familyName)
}
#endif
}

@ViewBuilder
Expand Down
14 changes: 14 additions & 0 deletions Sources/OversizeContactsKit/ContactsPicker/EmailPickerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public struct EmailPickerView: View {
TextField("Email or name", text: $viewModel.searchText)
.textFieldStyle(DefaultPlaceholderTextFieldStyle())
.focused($isFocusSearth)
#if os(iOS)
.keyboardType(.emailAddress)
#endif
}
.onAppear {
isFocusSearth = true
Expand Down Expand Up @@ -151,6 +153,7 @@ public struct EmailPickerView: View {
private func emailRow(email: CNLabeledValue<NSString>, contact: CNContact) -> some View {
let email = email.value as String
let isSelected = selectedEmails.contains(email)
#if os(iOS)
if let avatarThumbnailData = contact.thumbnailImageData, let avatarThumbnail = UIImage(data: avatarThumbnailData) {
Checkbox(isOn: Binding(
get: { isSelected },
Expand All @@ -172,6 +175,17 @@ public struct EmailPickerView: View {

})
}
#else
Checkbox(isOn: Binding(
get: { isSelected },
set: { _ in onContactClick(email: email) }
), label: {
Row(contact.givenName + " " + contact.familyName, subtitle: email) {
Avatar(firstName: contact.givenName, lastName: contact.familyName)
}

})
#endif
}

private func onDoneAction() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//

import CachedAsyncImage
import EffectsLibrary
import OversizeComponents
import OversizeCore
import OversizeLocalizable
Expand Down Expand Up @@ -97,7 +96,7 @@ public struct StoreSpecialOfferView: View {
}
}
.toolbar {
ToolbarItem(placement: .topBarLeading) {
ToolbarItem(placement: .cancellationAction) {
Button {
lastClosedSpecialOffer = event.id
dismiss()
Expand All @@ -113,14 +112,7 @@ public struct StoreSpecialOfferView: View {
var effectsView: some View {
switch event.effect {
case .snow:
SnowView(config: .init(
intensity: .low,
lifetime: .long,
initialVelocity: .medium,
fadeOut: .slow,
spreadRadius: .high
))
.offset(y: -150)
EmptyView()
default:
EmptyView()
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/OversizeKit/StoreKit/StoreScreen/StoreView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ import SwiftUI
}

public func closable(_: Bool = true) -> StoreView {
var control = self
let control = self
return control
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ public struct MapCoordinateView: View {
})
.background(.thickMaterial, ignoresSafeAreaEdges: .top)
}
#if os(iOS)
.toolbar(.hidden, for: .tabBar)
#endif
} else {
mapView
.safeAreaInset(edge: .top) {
Expand Down Expand Up @@ -132,7 +134,7 @@ public struct MapCoordinateView: View {
})
.backgroundSecondary()
.disableScrollShadow(true)
.surfaceContentRowInsets()
.surfaceContentRowMargins()
}

func onTapAppleMaps() {
Expand Down
2 changes: 2 additions & 0 deletions Sources/OversizeOnboardingKit/OnboardingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ public struct OnboardingView<Content: View>: View {
// .tag(index)
// }
}
#if os(iOS)
.tabViewStyle(.page(indexDisplayMode: .never))
.indexViewStyle(.page(backgroundDisplayMode: .never))
#endif
}
.background(
Color.backgroundSecondary.ignoresSafeArea()
Expand Down
2 changes: 2 additions & 0 deletions Sources/OversizePhotoKit/PhotosGalleryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public struct PhotosGalleryView: View {
.leadingBar {
BarButton(.back)
}
#if os(iOS)
.photoOverlay(isPresent: $isShowPhoto, selection: $selection, photos: images)
#endif
}
}

Expand Down