Skip to content

Commit

Permalink
🚸 (LekaUpdater): Inform user robot cannot be update
Browse files Browse the repository at this point in the history
  • Loading branch information
YannLocatelli authored and ladislas committed Sep 18, 2023
1 parent a50713b commit 19305d4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,21 @@ struct InformationView: View {
VStack {
ScrollView {
VStack(alignment: .center, spacing: 10) {
if viewModel.showRobotNeedsUpdate {
if viewModel.showRobotCannotBeUpdated {
RobotCannotBeUpdatedIllustration(size: 200)

Text(viewModel.robotName)
.font(.title3)

Text(
"""
🚧 DEV - Processus de mise à jour non reconnu ou inexistant (LekaOS v\(viewModel.robotOSVersion))
(Code erreur #0003)
"""
)
.font(.title2)
.multilineTextAlignment(.center)
} else if viewModel.showRobotNeedsUpdate {
RobotNeedsUpdateIllustration(size: 200)

Text(viewModel.robotName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import DesignKit
import SwiftUI

struct RobotCannotBeUpdateIllustration: View {
struct RobotCannotBeUpdatedIllustration: View {
public var illustrationSize: CGFloat = 300

private var circleSize: CGFloat {
Expand Down Expand Up @@ -36,7 +36,7 @@ struct RobotCannotBeUpdateIllustration: View {

Circle()
.strokeBorder(
.yellow,
.gray,
style: StrokeStyle(lineWidth: circleLineWidth, lineCap: .round, dash: [dashSpacer, dashSpacer])
)
.frame(width: circleSize)
Expand All @@ -53,22 +53,22 @@ struct RobotCannotBeUpdateIllustration: View {
Circle().fill(.white)
.frame(height: checkmarkSize)

Image(systemName: "exclamationmark.circle")
Image(systemName: "xmark.circle")
.font(.system(size: checkmarkSize))
.foregroundColor(.yellow)
.foregroundColor(.gray)
}
}
}
.frame(width: circleSize, height: illustrationSize)
}
}

struct RobotCannotBeUpdateIllustration_Previews: PreviewProvider {
struct RobotCannotBeUpdatedIllustration_Previews: PreviewProvider {
static var previews: some View {
Form {
Section {
Group {
RobotCannotBeUpdateIllustration(size: 600)
RobotCannotBeUpdatedIllustration(size: 600)
}
.frame(maxWidth: .infinity, alignment: .center)
}
Expand Down

0 comments on commit 19305d4

Please sign in to comment.