Skip to content

Commit

Permalink
CAD
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Pham committed Jul 28, 2018
1 parent a0c0029 commit a955b53
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions CoinPriceBar/CoinPriceTouchBarItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class CoinPriceTouchBarItem: NSTouchBarItem {

private var textField: NSTextField = {
let textField = NSTextField(labelWithString: "")
textField.font = NSFont.systemFont(ofSize: 10)
return textField
}()

Expand Down
4 changes: 2 additions & 2 deletions CoinPriceBar/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
// Copyright © 2017 Thanh Pham. All rights reserved.
//

let supportedCoins: [Coin] = [.BTC, .BCH, .ETH, .LTC, .XRP, .IOTA, .ADA]
let currency: FiatMoney = .USD
let supportedCoins: [Coin] = [.BTC, .ETH, .LTC, .XMR, .ZIL, .XLM, .ADA, .ARK]
let currency: FiatMoney = .CAD
4 changes: 2 additions & 2 deletions CoinPriceBar/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.5</string>
<string>1.5.0.16</string>
<key>CFBundleVersion</key>
<string>7</string>
<string>8</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>LSUIElement</key>
Expand Down
14 changes: 12 additions & 2 deletions CoinPriceBar/Money.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,23 @@ enum Coin: String {
case XRP
case IOTA
case ADA
case XMR
case ZIL
case XLM
case ARK
}

enum FiatMoney: String {
case USD
case CAD
}

extension Coin {

func priceProvider() -> CoinPriceProvider {
switch self {
case .XRP, .IOTA, .ADA: return BinancePriceProvider()
default: return CoinbasePriceProvider()
case .BTC, .BCH, .ETH, .LTC: return CoinbasePriceProvider()
default: return BinancePriceProvider()
}
}
}
Expand All @@ -43,6 +48,10 @@ extension Coin {
case .XRP: return "Ʀ"
case .IOTA: return "ι"
case .ADA: return ""
case .XMR: return "XMR"
case .ZIL: return "ZIL"
case .XLM: return "XML"
case .ARK: return "ARK"
}
}

Expand All @@ -55,6 +64,7 @@ extension Coin {
case .XRP: return NSColor(displayP3Red: 62 / 255, green: 139 / 255, blue: 192 / 255, alpha: 1)
case .IOTA: return NSColor(displayP3Red: 227 / 255, green: 227 / 255, blue: 227 / 255, alpha: 1)
case .ADA: return NSColor(displayP3Red: 59 / 255, green: 110 / 255, blue: 207 / 255, alpha: 1)
default: return .green
}
}
}

0 comments on commit a955b53

Please sign in to comment.