-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add UpdateRequiredView (#1272)
- Loading branch information
Showing
11 changed files
with
193 additions
and
23 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,51 @@ | ||
/* | ||
Infomaniak Mail - iOS App | ||
Copyright (C) 2024 Infomaniak Network SA | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import MailCore | ||
import MailResources | ||
import SwiftUI | ||
import VersionChecker | ||
|
||
struct MailUpdateRequiredView: View { | ||
@Environment(\.openURL) private var openURL | ||
|
||
private let sharedStyle = TemplateSharedStyle( | ||
background: MailResourcesAsset.backgroundColor.swiftUIColor, | ||
titleTextStyle: .init(font: MailTextStyle.header2.font, color: MailTextStyle.header2.color), | ||
descriptionTextStyle: .init(font: MailTextStyle.bodySecondary.font, color: MailTextStyle.bodySecondary.color), | ||
buttonStyle: .init( | ||
background: .accentColor, | ||
textStyle: .init(font: MailTextStyle.bodyAccent.font, color: UserDefaults.shared.accentColor.onAccent.swiftUIColor), | ||
height: UIConstants.buttonLargeHeight, | ||
radius: UIConstants.buttonsRadius | ||
) | ||
) | ||
|
||
var body: some View { | ||
UpdateRequiredView(image: MailResourcesAsset.updateRequired.swiftUIImage, sharedStyle: sharedStyle, handler: updateApp) | ||
} | ||
|
||
private func updateApp() { | ||
let url: URLConstants = Bundle.main.isRunningInTestFlight ? .testFlight : .appStore | ||
openURL(url.url) | ||
} | ||
} | ||
|
||
#Preview { | ||
MailUpdateRequiredView() | ||
} |
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
25 changes: 25 additions & 0 deletions
25
MailResources/Assets.xcassets/update-required.imageset/Contents.json
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,25 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "update-required-light.svg", | ||
"idiom" : "universal" | ||
}, | ||
{ | ||
"appearances" : [ | ||
{ | ||
"appearance" : "luminosity", | ||
"value" : "dark" | ||
} | ||
], | ||
"filename" : "update-required-dark.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
}, | ||
"properties" : { | ||
"preserves-vector-representation" : true | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
MailResources/Assets.xcassets/update-required.imageset/update-required-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.