Skip to content

Commit

Permalink
Merge pull request #27 from folio-world/feat/#26-localized-string
Browse files Browse the repository at this point in the history
[Feat/#26] localized string 적용
  • Loading branch information
mooyoung2309 authored Oct 3, 2023
2 parents a702817 + d8ed91e commit 8cde17e
Show file tree
Hide file tree
Showing 65 changed files with 2,002 additions and 953 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,5 @@ Derived/
*.p12
master.key
*.package.resolved

GoogleService-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ public extension [TargetDependency] {
]
case .Folio:
return [
.external(name: "GoogleMobileAds")
.external(name: "GoogleMobileAds"),
.external(name: "FirebaseAnalytics")
]
default: return []
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public extension Target {
deploymentTarget: .shared(product),
infoPlist: .shared(product),
sources: .path(type: .implement),
resources: nil,
resources: .path(type: .implement),
copyFiles: nil,
headers: nil,
entitlements: nil,
Expand Down Expand Up @@ -341,7 +341,7 @@ public extension Target {
deploymentTarget: .shared(product, module: module),
infoPlist: .shared(product, module: module),
sources: .path(type: type),
resources: nil,
resources: .path(type: .implement),
copyFiles: nil,
headers: nil,
entitlements: nil,
Expand Down
104 changes: 0 additions & 104 deletions Projects/Dying/.package.resolved

This file was deleted.

158 changes: 0 additions & 158 deletions Projects/Folio/.package.resolved

This file was deleted.

58 changes: 56 additions & 2 deletions Projects/Folio/Shared/DesignSystem/Sources/Color+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,61 @@
import SwiftUI

public extension Color {
static func blackOrWhite(_ isSelected: Bool = false) -> Self {
return isSelected ? Color(uiColor: .label) : Color(uiColor: .systemBackground)
init(hex: String) {
let hex = hex.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
var int: UInt64 = 0
Scanner(string: hex).scanHexInt64(&int)
let a, r, g, b: UInt64
switch hex.count {
case 3: // RGB (12-bit)
(a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17)
case 6: // RGB (24-bit)
(a, r, g, b) = (255, int >> 16, int >> 8 & 0xFF, int & 0xFF)
case 8: // ARGB (32-bit)
(a, r, g, b) = (int >> 24, int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF)
default:
(a, r, g, b) = (1, 1, 1, 0)
}

self.init(
.sRGB,
red: Double(r) / 255,
green: Double(g) / 255,
blue: Double(b) / 255,
opacity: Double(a) / 255
)
}

static var foreground: Self {
return Color(uiColor: .label)
}

static var background: Self {
return Color(uiColor: .systemBackground)
}

// static func blackOrWhite(_ isSelected: Bool = false) -> Self {
// return isSelected ? Color(uiColor: .label) : Color(uiColor: .systemBackground)
// }

func toHex() -> String {
let uic = UIColor(self)
guard let components = uic.cgColor.components, components.count >= 3 else {
return ""
}
let r = Float(components[0])
let g = Float(components[1])
let b = Float(components[2])
var a = Float(1.0)

if components.count >= 4 {
a = Float(components[3])
}

if a != Float(1.0) {
return String(format: "%02lX%02lX%02lX%02lX", lroundf(r * 255), lroundf(g * 255), lroundf(b * 255), lroundf(a * 255))
} else {
return String(format: "%02lX%02lX%02lX", lroundf(r * 255), lroundf(g * 255), lroundf(b * 255))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public struct MinimalButton: View {
}
.padding(.vertical, 10)
})
.background(.black)
.background(isActive ? Color.foreground : Color.foreground) //TODO: active 현재 미사용
.clipShape(
RoundedRectangle(
cornerRadius: 8,
Expand Down
23 changes: 0 additions & 23 deletions Projects/Toolinder/.package.resolved

This file was deleted.

Loading

0 comments on commit 8cde17e

Please sign in to comment.