-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into donburi/DON-628-calendar-changes-poc-second
- Loading branch information
Showing
19 changed files
with
156 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Backpack - Skyscanner's Design System | ||
* | ||
* Copyright 2018 Skyscanner Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import SwiftUI | ||
|
||
/// Represents a scrollable month with a unique identifier and anchor point for positioning. | ||
public struct MonthScroll { | ||
/// Unique identifier for the scroll item. | ||
let scrollId: String | ||
|
||
/// Anchor point for the scroll position, defaulting to `.top`. | ||
let anchor: UnitPoint | ||
|
||
/// Whether to animate the change in scroll position or not | ||
let animated: Bool | ||
|
||
/// The `DateFormatter` to format dates as "yyyy-MM" strings, used for generating `scrollId`s. | ||
/// - Example: For a date of December 25, 2024, it produces `"2024-12"`. | ||
let formatter: DateFormatter | ||
|
||
// MARK: - Initialiser | ||
|
||
/// Initialises `MonthScroll` using a `Date` to generate the `scrollId`, with `anchor`. | ||
public init(monthToScroll: Date, anchor: UnitPoint = .top, animated: Bool = false) { | ||
let dateFormatter = DateFormatter() | ||
dateFormatter.dateFormat = "yyyy-MM" | ||
|
||
self.scrollId = dateFormatter.string(from: monthToScroll) | ||
self.anchor = anchor | ||
self.animated = animated | ||
self.formatter = dateFormatter | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-26 Bytes
(98%)
...Tests/StarRating/__Snapshots__/BPKStarRatingTests/test_hotelStars.dark-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-16 Bytes
(99%)
...ests/StarRating/__Snapshots__/BPKStarRatingTests/test_hotelStars.light-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-16 Bytes
(99%)
...iftUI/Tests/StarRating/__Snapshots__/BPKStarRatingTests/test_hotelStars.rtl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.