the manager lands in manager/, next to ios/ and web/. it is a fork of this repo's own app, not of feather, so scripts/apply-rebrand.sh excludes it the same way it excludes web/ — the generic feather-to- ftstore rule would rewrite its app.ftstore.manager identity and mangle the lineage notes in its docs. zsign and idevicekitten were vendored copies in the old repo. they are registered as submodules here instead, pinned to the same commits ios/ uses and verified byte-identical to what was vendored. that keeps 71 MB of duplicated source out of the tree and leaves the xcode project's relative paths intact, so project.pbxproj needed no edits. the server moves to ftstore.app in both apps: managerrepoclient, the seeded default source and managerconfig's fallback. downloadmanager keeps the old admin host in its user-agent allowlist — that check is permissive, not identifying, and dropping it would stop sending the header to installs whose stored override still names the old host. the rest of the admin rename lands too: the client id, the base-url environment variable, the info.plist key, and user-facing errors. the userdefaults override key is renamed with a one-time migration read, so an existing install keeps the address its owner configured instead of falling back to the default. tags gain a third namespace: manager-v* for releases, manager-dev for the rolling prerelease. both repos published to a tag called `dev` before; sharing it here would make each build overwrite the other's release assets.
113 lines
2.2 KiB
Swift
113 lines
2.2 KiB
Swift
//
|
|
// NBSheetButton.swift
|
|
// NimbleKit
|
|
//
|
|
// Created by samara on 8.05.2025.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
public struct NBSheetButton: View {
|
|
public enum NSSheetButtonStyle {
|
|
case prominent
|
|
case standard
|
|
}
|
|
|
|
@Environment(\.isEnabled) private var isEnabled
|
|
|
|
private var _title: String
|
|
private var _systemImage: String?
|
|
private var _style: NSSheetButtonStyle
|
|
|
|
public init(
|
|
title: String,
|
|
systemImage: String? = nil,
|
|
style: NSSheetButtonStyle = .standard
|
|
) {
|
|
self._title = title
|
|
self._systemImage = systemImage
|
|
self._style = style
|
|
}
|
|
|
|
public var body: some View {
|
|
ZStack {
|
|
if isEnabled {
|
|
Label {
|
|
Text(_title)
|
|
} icon: {
|
|
if let image = _systemImage {
|
|
Image(systemName: image)
|
|
}
|
|
}
|
|
.labelStyle(.titleAndIcon)
|
|
} else {
|
|
ProgressView()
|
|
.progressViewStyle(.circular)
|
|
.opacity(1)
|
|
}
|
|
}
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
.background {
|
|
adaptiveGlassBackground(
|
|
tintColor: isEnabled ? backgroundColor : Color(uiColor: .quaternarySystemFill),
|
|
fallback: isEnabled ? backgroundColor : Color(uiColor: .quaternarySystemFill)
|
|
)
|
|
}
|
|
.foregroundColor(foregroundColor)
|
|
.clipShape(RoundedRectangle(cornerRadius: _cornerRadius, style: .continuous))
|
|
.contentShape(RoundedRectangle(cornerRadius: _cornerRadius, style: .continuous))
|
|
.fontWeight(.semibold)
|
|
.frame(height: 50)
|
|
}
|
|
|
|
@ViewBuilder
|
|
private var content: some View {
|
|
Label {
|
|
Text(_title)
|
|
} icon: {
|
|
if let image = _systemImage {
|
|
Image(systemName: image)
|
|
}
|
|
}
|
|
.labelStyle(.titleAndIcon)
|
|
}
|
|
|
|
|
|
private var backgroundColor: Color {
|
|
switch _style {
|
|
case .prominent: .accentColor
|
|
case .standard: Color(uiColor: .quaternarySystemFill)
|
|
}
|
|
}
|
|
|
|
private var foregroundColor: Color {
|
|
switch _style {
|
|
case .prominent: .white
|
|
case .standard: .accentColor
|
|
}
|
|
}
|
|
|
|
private var _cornerRadius: CGFloat {
|
|
if #available(iOS 26.0, *) {
|
|
return 28.0
|
|
} else {
|
|
return 12.0
|
|
}
|
|
}
|
|
}
|
|
|
|
private extension View {
|
|
@ViewBuilder
|
|
func adaptiveGlassBackground(
|
|
tintColor: Color,
|
|
fallback: Color
|
|
) -> some View {
|
|
if #available(iOS 26.0, *) {
|
|
Color.clear
|
|
.glassEffect(.regular.tint(tintColor), in: .rect(cornerRadius: 28, style: .continuous))
|
|
} else {
|
|
fallback
|
|
}
|
|
}
|
|
}
|