Skip to content

Commit

Permalink
Add to Croptop mint settings: arbitrum, base
Browse files Browse the repository at this point in the history
  • Loading branch information
livid committed May 21, 2024
1 parent 5d2ba93 commit f24d9e0
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 17 deletions.
12 changes: 12 additions & 0 deletions Planet/SharedAssets.xcassets/arb-logo.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "arbitrum-logo.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions Planet/SharedAssets.xcassets/base-logo.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "base-logo.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Planet/versioning.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 2053
CURRENT_PROJECT_VERSION = 2058
68 changes: 52 additions & 16 deletions PlanetLite/Croptop/MintSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ struct MintSettings: View {
"collectionCategory",
"curatorAddress",
"separator1",
"label:If you want to use a different RPC endpoint, please enter it below.",
"ethereumMainnetRPC",
"ethereumSepoliaRPC",
"optimismMainnetRPC",
"optimismSepoliaRPC",
"arbitrumMainnetRPC",
"arbitrumSepoliaRPC",
"baseMainnetRPC",
"baseSepoliaRPC",
// "separator2",
// "highlightColor",
]
Expand All @@ -55,27 +60,22 @@ struct MintSettings: View {
.padding(.top, 6)
.padding(.bottom, 6)
}
else if key.hasPrefix("label:") {
HStack {
Text(key.replacingOccurrences(of: "label:", with: ""))
.font(.body)
.foregroundColor(.secondary)
.fixedSize(horizontal: false, vertical: true)
Spacer()
}
.padding(.bottom, 6)
}
else {
HStack {
HStack {
// You can get more logo images from:
// https://cryptologos.cc/ethereum
if key == "ethereumMainnetRPC"
|| key == "ethereumSepoliaRPC"
{
Image("eth-logo")
.interpolation(.high)
.resizable()
.frame(width: LOGO_SIZE, height: LOGO_SIZE)
}
if key == "optimismMainnetRPC"
|| key == "optimismSepoliaRPC"
{
Image("op-logo")
.interpolation(.high)
.resizable()
.frame(width: LOGO_SIZE, height: LOGO_SIZE)
}
cryptoLogo(key)
Text("\(settings[key]?.name ?? key)")
Spacer()
}
Expand Down Expand Up @@ -161,4 +161,40 @@ struct MintSettings: View {
}
)
}

@ViewBuilder
private func cryptoLogo(_ key: String) -> some View {
if key == "ethereumMainnetRPC"
|| key == "ethereumSepoliaRPC"
{
Image("eth-logo")
.interpolation(.high)
.resizable()
.frame(width: LOGO_SIZE, height: LOGO_SIZE)
}
if key == "optimismMainnetRPC"
|| key == "optimismSepoliaRPC"
{
Image("op-logo")
.interpolation(.high)
.resizable()
.frame(width: LOGO_SIZE, height: LOGO_SIZE)
}
if key == "arbitrumMainnetRPC"
|| key == "arbitrumSepoliaRPC"
{
Image("arb-logo")
.interpolation(.high)
.resizable()
.frame(width: LOGO_SIZE, height: LOGO_SIZE)
}
if key == "baseMainnetRPC"
|| key == "baseSepoliaRPC"
{
Image("base-logo")
.interpolation(.high)
.resizable()
.frame(width: LOGO_SIZE, height: LOGO_SIZE)
}
}
}

0 comments on commit f24d9e0

Please sign in to comment.