Skip to content

Commit

Permalink
Merge pull request PlayCover#74 from IsaacMarovitz/develop
Browse files Browse the repository at this point in the history
Fixed typos in source code, and removed unused button styles
  • Loading branch information
Depal1 authored Jul 21, 2022
2 parents 1e2040a + 8eeb3f8 commit 6f4e98d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 48 deletions.
8 changes: 4 additions & 4 deletions PlayCover/View/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ struct MainView: View {
}.padding()
}
.background(.regularMaterial)
.overlay(GeometryReader { geomatry in
.overlay(GeometryReader { geometry in
Text("")
.onChange(of: geomatry.size.height) { v in bottomHeight = v }
.onChange(of: geometry.size.height) { v in bottomHeight = v }
.onAppear {
print("Bottom height: \(geomatry.size.height)")
bottomHeight = geomatry.size.height
print("Bottom height: \(geometry.size.height)")
bottomHeight = geometry.size.height
}
})
}
Expand Down
44 changes: 0 additions & 44 deletions PlayCover/View/Style.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@
import Foundation
import SwiftUI

struct GetButton: ButtonStyle {
func makeBody(configuration: Configuration) -> some View {
configuration.label
.padding(.horizontal, 16)
.padding(.vertical, 6)
.background(Colr.get)
.foregroundColor(.white)
.textCase(.uppercase)
.clipShape(Capsule())
}
}

struct UpdateButton: ButtonStyle {
func makeBody(configuration: Configuration) -> some View {
configuration.label
Expand All @@ -29,38 +17,6 @@ struct UpdateButton: ButtonStyle {
}
}

struct XcodeButton: ButtonStyle {
func makeBody(configuration: Configuration) -> some View {
configuration.label
.padding(.horizontal, 24)
.padding(.vertical, 16)
.background(Color.blue)
.foregroundColor(.white)
.clipShape(Capsule())
}
}

struct PlayPassButton: ButtonStyle {
@Environment(\.colorScheme) var colorScheme

func bgColor(_ pressed : Bool) -> Color {
return colorScheme == .dark ? Colr.blackWhite(pressed) : Colr.blackWhite(!pressed)
}

func textColor(_ pressed : Bool) -> Color {
return colorScheme == .dark ? Colr.blackWhite(!pressed) : Colr.blackWhite(pressed)
}

func makeBody(configuration: Configuration) -> some View {
configuration.label
.padding(.horizontal, 14)
.padding(.vertical, 14)
.background(configuration.isPressed ? bgColor(false) : bgColor(true))
.foregroundColor(configuration.isPressed ? textColor(false) : textColor(true))
.clipShape(Capsule())
}
}

struct GrowingButton: ButtonStyle {
func makeBody(configuration: Configuration) -> some View {
configuration.label
Expand Down

0 comments on commit 6f4e98d

Please sign in to comment.