-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GachaKit // Preparing for GachaRecordRootView.
- Loading branch information
Showing
8 changed files
with
135 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
Packages/GachaKit/Sources/GachaKit/Frontends/GachaRecordRootView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// (c) 2024 and onwards Pizza Studio (AGPL v3.0 License or later). | ||
// ==================== | ||
// This code is released under the SPDX-License-Identifier: `AGPL-3.0-or-later`. | ||
|
||
import PZBaseKit | ||
import SFSafeSymbols | ||
import SwiftData | ||
import SwiftUI | ||
|
||
// MARK: - GachaRecordRootView | ||
|
||
public struct GachaRecordRootView: View { | ||
// MARK: Lifecycle | ||
|
||
public init(legacyImporter: (() -> Void)?) { | ||
self.importLegacyRecords = legacyImporter | ||
} | ||
|
||
// MARK: Public | ||
|
||
public static var navTitle: String = "gachaKit.GachaRecordRootView.navTitle".i18nGachaKit | ||
|
||
public static var navIcon: Image { Image("GachaRecordMgr_NavIcon", bundle: .module) } | ||
|
||
@MainActor public var body: some View { | ||
coreBody | ||
.navigationTitle(Self.navTitle) | ||
.navBarTitleDisplayMode(.large) | ||
.toolbar { | ||
ToolbarItem(placement: .confirmationAction) { | ||
Menu { | ||
Text("Temporary PlaceHolder".description) | ||
} label: { | ||
Image(systemSymbol: .goforwardPlus) | ||
} | ||
} | ||
} | ||
} | ||
|
||
// MARK: Private | ||
|
||
private let importLegacyRecords: (() -> Void)? | ||
@Query(sort: \PZGachaEntryMO.id) private var profiles: [PZGachaEntryMO] | ||
|
||
private var allowImporingOldRecords: Bool { importLegacyRecords != nil } | ||
} | ||
|
||
extension GachaRecordRootView { | ||
@MainActor @ViewBuilder public var coreBody: some View { | ||
List { | ||
Text("Under construction".description) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
Packages/GachaKit/Sources/GachaKit/Resources/Media.xcassets/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...t/Sources/GachaKit/Resources/Media.xcassets/GachaRecordMgr_NavIcon.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "GachaRecordMgr_NavIcon.heic", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+5.61 KB
...aKit/Resources/Media.xcassets/GachaRecordMgr_NavIcon.imageset/GachaRecordMgr_NavIcon.heic
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters