Skip to content

Commit

Permalink
chore: Merge branch 'master' into tbt
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-coye committed Feb 7, 2024
2 parents 67ddea2 + 85ddae2 commit 7c7b56c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/Infomaniak/ios-core-ui",
"state" : {
"revision" : "400b26b6a266bb9206ad4eade1231a9f264e98e7",
"version" : "4.0.0"
"revision" : "d593bdc3d788cadc8856137ff6d2cffbfd707163",
"version" : "4.1.0"
}
},
{
Expand Down Expand Up @@ -221,8 +221,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/Infomaniak/SnackBar.swift",
"state" : {
"revision" : "9a3c0c71796625ec3804df993483aa80266fa1ff",
"version" : "1.1.0"
"revision" : "7d8d20af50c6b744aa9791b597f7efbd0a15add2",
"version" : "1.2.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let project = Project(name: "kDrive",
.package(url: "https://github.com/apple/swift-algorithms", .upToNextMajor(from: "1.2.0")),
.package(url: "https://github.com/Alamofire/Alamofire", .upToNextMajor(from: "5.2.2")),
.package(url: "https://github.com/Infomaniak/ios-core", .upToNextMajor(from: "6.2.0")),
.package(url: "https://github.com/Infomaniak/ios-core-ui", .upToNextMajor(from: "4.0.0")),
.package(url: "https://github.com/Infomaniak/ios-core-ui", .upToNextMajor(from: "4.1.0")),
.package(url: "https://github.com/Infomaniak/ios-login", .upToNextMajor(from: "6.0.1")),
.package(url: "https://github.com/Infomaniak/ios-dependency-injection", .upToNextMajor(from: "2.0.0")),
.package(url: "https://github.com/Infomaniak/swift-concurrency", .upToNextMajor(from: "0.0.4")),
Expand Down
14 changes: 12 additions & 2 deletions kDriveCore/UI/UIConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ import SnackBar
import UIKit

public enum UIConstants {
private static let style: SnackBarStyle = {
var style = SnackBarStyle.infomaniakStyle
style.anchor = 20.0
style.maxWidth = 600.0
return style
}()

public static let inputCornerRadius = 2.0
public static let imageCornerRadius = 3.0
public static let cornerRadius = 6.0
Expand All @@ -41,9 +48,12 @@ public enum UIConstants {

@discardableResult
@MainActor
public static func showSnackBar(message: String, duration: SnackBar.Duration = .lengthLong,
public static func showSnackBar(message: String,
duration: SnackBar.Duration = .lengthLong,
action: IKSnackBar.Action? = nil) -> IKSnackBar? {
let snackbar = IKSnackBar.make(message: message, duration: duration)
let snackbar = IKSnackBar.make(message: message,
duration: duration,
style: style)
if let action {
snackbar?.setAction(action).show()
} else {
Expand Down
7 changes: 1 addition & 6 deletions kDriveCore/Utils/NotificationsHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,7 @@ public struct NotificationsHelper: NotificationsHelpable {
let request = UNNotificationRequest(identifier: id, content: notification, trigger: trigger)
UNUserNotificationCenter.current().add(request)
} else {
let snackbar = IKSnackBar.make(message: notification.body, duration: .lengthLong)
if let action {
snackbar?.setAction(action).show()
} else {
snackbar?.show()
}
UIConstants.showSnackBar(message: notification.body, duration: .lengthLong, action: action)
}
}
}
Expand Down

0 comments on commit 7c7b56c

Please sign in to comment.