Skip to content

Commit

Permalink
Merge branch 'develop' into feature/ALTAPPS-498/Local_logging
Browse files Browse the repository at this point in the history
  • Loading branch information
XanderZhu committed Sep 28, 2023
2 parents ae9856b + ff1e9c7 commit eb8f616
Show file tree
Hide file tree
Showing 20 changed files with 214 additions and 232 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup-ios/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ runs:
using: "composite"
steps:
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1.5.1
uses: maxim-lobanov/setup-xcode@v1.6.0
with:
xcode-version: '14.3.1'
xcode-version: '15.0.0'

- name: Homebrew install git-crypt
run: brew install git-crypt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/first-interaction@v1.1.1
- uses: actions/first-interaction@v1.2.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: 'Thanks for submitting your first issue, we will have a look as quickly as possible.'
Expand Down
4 changes: 2 additions & 2 deletions iosHyperskillApp/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"].to_f < 11.0
config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "11.0"
if config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"].to_f < 12.0
config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "12.0"
end
end

Expand Down
2 changes: 1 addition & 1 deletion iosHyperskillApp/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,6 @@ SPEC CHECKSUMS:
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
SwiftLint: 6b0cf1f4d619808dbc16e4fab064ce6fc79f090b

PODFILE CHECKSUM: 07869e3e16335ad018705634d83de85353158df1
PODFILE CHECKSUM: 8c215b2f5d2b9d8faef86f0aa4f4ff03533ae1e7

COCOAPODS: 1.13.0
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,13 @@ private extension CodeEditorView.Appearance {
}
}

// MARK: - CodeEditor_Previews: PreviewProvider -

struct CodeEditor_Previews: PreviewProvider {
static var previews: some View {
CodeEditor(
code: .constant(CodeLanguageSamples.sample(for: .java)),
language: .java
)
.frame(height: 236)
.frame(maxWidth: .infinity)
}
// MARK: - Preview -

#Preview {
CodeEditor(
code: .constant(CodeLanguageSamples.sample(for: .java)),
language: .java
)
.frame(height: 236)
.frame(maxWidth: .infinity)
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ struct LatexView: View {
}
}

struct LatexView_Previews: PreviewProvider {
static var previews: some View {
Group {
LatexView(text: .constant("Plain text"))

LatexView(text: .constant("Rich <b>text</b>!!!"))
}
.previewLayout(.sizeThatFits)
.padding()
}
#Preview("Plain text") {
LatexView(
text: .constant("Plain text")
)
.padding()
}

#Preview("Rich text") {
LatexView(
text: .constant("Rich <b>text</b>!!!")
)
.padding()
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import Foundation

@available(*, deprecated, message: "Use Xcode 15 image resources instead")
enum Images {
// MARK: - Common -

enum Common {
static let hyperskillLogo = "hyperskill-logo"

static let skip = "skip"
static let trophy = "trophy"
static let hammer = "hammer"

static let topic = "topic"
static let project = "project"
}

// MARK: - TabBar -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,8 @@ extension AppView: ProgrammaticallyInitializableViewProtocol {
}
}

struct AppView_Previews: PreviewProvider {
static var previews: some View {
UIKitViewControllerPreview {
AppAssembly(pushNotificationData: nil).makeModule()
}
#Preview {
UIKitViewControllerPreview {
AppAssembly(pushNotificationData: nil).makeModule()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ struct AuthCredentialsErrorView: View {
}
}

struct AuthEmailErrorView_Previews: PreviewProvider {
static var previews: some View {
AuthCredentialsErrorView(message: "Error message")
}
#Preview {
AuthCredentialsErrorView(
message: "Error message"
)
.padding()
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,36 +97,35 @@ struct AuthCredentialsFormView: View {
}
}

struct AuthEmailFormView_Previews: PreviewProvider {
static var previews: some View {
Group {
Group {
AuthCredentialsFormView(
emailText: .constant(""),
passwordText: .constant("")
)

AuthCredentialsFormView(
emailText: .constant(""),
passwordText: .constant(""),
errorMessage: "error"
)
}

Group {
AuthCredentialsFormView(
emailText: .constant(""),
passwordText: .constant("")
)
#Preview("Light") {
Group {
AuthCredentialsFormView(
emailText: .constant(""),
passwordText: .constant("")
)

AuthCredentialsFormView(
emailText: .constant(""),
passwordText: .constant(""),
errorMessage: "error"
)
}
.padding(.horizontal)
}

AuthCredentialsFormView(
emailText: .constant(""),
passwordText: .constant(""),
errorMessage: "error"
)
}
.preferredColorScheme(.dark)
}
.padding(.horizontal)
#Preview("Dark") {
Group {
AuthCredentialsFormView(
emailText: .constant(""),
passwordText: .constant("")
)

AuthCredentialsFormView(
emailText: .constant(""),
passwordText: .constant(""),
errorMessage: "error"
)
}
.preferredColorScheme(.dark)
.padding(.horizontal)
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,18 @@ struct AuthCredentialsView: View {
}
}

struct AuthCredentialsView_Previews: PreviewProvider {
static var previews: some View {
Group {
AuthCredentialsAssembly().makeModule()
.previewDevice(PreviewDevice(rawValue: "iPhone 13 Pro"))

AuthCredentialsAssembly().makeModule()
.previewDevice(PreviewDevice(rawValue: "iPhone SE (3rd generation)"))
.preferredColorScheme(.dark)

AuthCredentialsAssembly().makeModule()
.previewDevice(PreviewDevice(rawValue: "iPad (9th generation)"))
}
}
#Preview("iPhone 15 Pro") {
AuthCredentialsAssembly().makeModule()
.previewDevice(PreviewDevice(rawValue: "iPhone 15 Pro"))
}

#Preview("iPhone SE (Dark)") {
AuthCredentialsAssembly().makeModule()
.previewDevice(PreviewDevice(rawValue: "iPhone SE (3rd generation)"))
.preferredColorScheme(.dark)
}

#Preview("iPad") {
AuthCredentialsAssembly().makeModule()
.previewDevice(PreviewDevice(rawValue: "iPad (10th generation)"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ struct ProfileStatisticsItemView: View {
@ViewBuilder private var image: some View {
switch icon.renderingMode {
case .original:
Image(icon.imageName)
Image(icon.imageResource)
.resizable()
.renderingMode(.original)
.aspectRatio(contentMode: .fit)
.frame(widthHeight: appearance.iconWidthHeight)
case .circleBackground:
Image(icon.imageName)
Image(icon.imageResource)
.resizable()
.renderingMode(.template)
.aspectRatio(contentMode: .fit)
Expand All @@ -60,7 +60,7 @@ struct ProfileStatisticsItemView: View {
}

struct Icon {
let imageName: String
let imageResource: ImageResource
let renderingMode: RenderingMode

enum RenderingMode {
Expand All @@ -70,28 +70,26 @@ struct ProfileStatisticsItemView: View {
}
}

struct ProfileStatisticsItemView_Previews: PreviewProvider {
static var previews: some View {
Group {
ProfileStatisticsItemView(
icon: .init(imageName: Images.Common.project, renderingMode: .circleBackground),
title: "3",
subtitle: Strings.Profile.Statistics.passedProjects
)
#Preview {
Group {
ProfileStatisticsItemView(
icon: .init(imageResource: .project, renderingMode: .circleBackground),
title: "3",
subtitle: Strings.Profile.Statistics.passedProjects
)

ProfileStatisticsItemView(
icon: .init(imageName: Images.Track.track, renderingMode: .circleBackground),
title: "3",
subtitle: Strings.Profile.Statistics.passedTracks
)
ProfileStatisticsItemView(
icon: .init(imageResource: .track, renderingMode: .circleBackground),
title: "3",
subtitle: Strings.Profile.Statistics.passedTracks
)

ProfileStatisticsItemView(
icon: .init(imageName: Images.StepQuiz.ProblemOfDaySolvedModal.gemsBadge, renderingMode: .original),
title: "3456",
subtitle: Strings.Profile.Statistics.hypercoinsBalance
)
}
.padding()
.background(Color.background)
ProfileStatisticsItemView(
icon: .init(imageResource: .problemOfDaySolvedModalGemsBadge, renderingMode: .original),
title: "3456",
subtitle: Strings.Profile.Statistics.hypercoinsBalance
)
}
.padding()
.background(Color.background)
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,34 @@ struct ProfileStatisticsView: View {
HStack {
ProfileStatisticsItemView(
appearance: .init(cornerRadius: appearance.cornerRadius),
icon: .init(imageName: Images.Common.project, renderingMode: .circleBackground),
icon: .init(imageResource: .project, renderingMode: .circleBackground),
title: "\(passedProjectsCount)",
subtitle: Strings.Profile.Statistics.passedProjects
)

ProfileStatisticsItemView(
appearance: .init(cornerRadius: appearance.cornerRadius),
icon: .init(imageName: Images.Track.track, renderingMode: .circleBackground),
icon: .init(imageResource: .track, renderingMode: .circleBackground),
title: "\(passedTracksCount)",
subtitle: Strings.Profile.Statistics.passedTracks
)

ProfileStatisticsItemView(
appearance: .init(cornerRadius: appearance.cornerRadius),
icon: .init(imageName: Images.StepQuiz.ProblemOfDaySolvedModal.gemsBadge, renderingMode: .original),
icon: .init(imageResource: .problemOfDaySolvedModalGemsBadge, renderingMode: .original),
title: "\(hypercoinsBalance)",
subtitle: Strings.Profile.Statistics.hypercoinsBalance
)
}
}
}

struct ProfileStatisticsView_Previews: PreviewProvider {
static var previews: some View {
ProfileStatisticsView(
passedProjectsCount: 3,
passedTracksCount: 3,
hypercoinsBalance: 3456
)
.padding()
.background(Color.background)
}
#Preview {
ProfileStatisticsView(
passedProjectsCount: 3,
passedTracksCount: 3,
hypercoinsBalance: 3456
)
.padding()
.background(Color.background)
}
Loading

0 comments on commit eb8f616

Please sign in to comment.