Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【FEAT】近日公開 (comming soom) のViewModifierを作成 #183

Merged
merged 7 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions NinjacordApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
4F6F9FB22BEBDEE40033AFB7 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 4F6F9FB12BEBDEE40033AFB7 /* Localizable.xcstrings */; };
4F7248F32BE825D2004FD3DC /* BannerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F7248F22BE825D2004FD3DC /* BannerViewController.swift */; };
4F7248F62BE827DF004FD3DC /* BannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F7248F52BE827DF004FD3DC /* BannerView.swift */; };
4F8F72372BF99E0D00EB1869 /* ComingSoonModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F8F72362BF99E0D00EB1869 /* ComingSoonModifier.swift */; };
4FAB6FF22BE1923F00B2F33A /* swiftlint.yml in Resources */ = {isa = PBXBuildFile; fileRef = 4FAB6FF12BE1923F00B2F33A /* swiftlint.yml */; };
4FAB6FFB2BE1C53B00B2F33A /* WebhookURLSettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FAB6FFA2BE1C53B00B2F33A /* WebhookURLSettingView.swift */; };
4FD55D492BE6F04700581F34 /* FirebaseAnalytics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FD55D482BE6F04700581F34 /* FirebaseAnalytics.swift */; };
Expand Down Expand Up @@ -61,6 +62,7 @@
4F6F9FB12BEBDEE40033AFB7 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
4F7248F22BE825D2004FD3DC /* BannerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BannerViewController.swift; sourceTree = "<group>"; };
4F7248F52BE827DF004FD3DC /* BannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BannerView.swift; sourceTree = "<group>"; };
4F8F72362BF99E0D00EB1869 /* ComingSoonModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComingSoonModifier.swift; sourceTree = "<group>"; };
4FAB6FF12BE1923F00B2F33A /* swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = swiftlint.yml; sourceTree = "<group>"; };
4FAB6FF72BE1A04D00B2F33A /* ci_post_clone.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = ci_post_clone.sh; sourceTree = "<group>"; };
4FAB6FFA2BE1C53B00B2F33A /* WebhookURLSettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebhookURLSettingView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -108,6 +110,7 @@
isa = PBXGroup;
children = (
4FF2FEA32BDFAEC300973FDA /* Extension */,
4F8F72352BF99DD600EB1869 /* Common */,
4F6755532BE008BC00F2629B /* AppDelegate.swift */,
4F5072B72BCF901E0005D352 /* NinjacordApp.swift */,
4F435C8D2BE115650087CEE3 /* MainView.swift */,
Expand Down Expand Up @@ -159,6 +162,14 @@
path = AdMob;
sourceTree = "<group>";
};
4F8F72352BF99DD600EB1869 /* Common */ = {
isa = PBXGroup;
children = (
4F8F72362BF99E0D00EB1869 /* ComingSoonModifier.swift */,
);
path = Common;
sourceTree = "<group>";
};
4FAB6FF62BE1A01B00B2F33A /* ci_scripts */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -314,6 +325,7 @@
4FD55D502BE701FE00581F34 /* PrivacyPolicyView.swift in Sources */,
4FD55D4B2BE6F92400581F34 /* AppInfo.swift in Sources */,
4F5C1BF52BDDDC2C001C9A51 /* SendMessageViewModel.swift in Sources */,
4F8F72372BF99E0D00EB1869 /* ComingSoonModifier.swift in Sources */,
4F6F9FAD2BEB9C820033AFB7 /* Extension+Color.swift in Sources */,
4F3A7B552BE836BF0046765E /* Extension+View.swift in Sources */,
4FF2FEA52BDFAF4F00973FDA /* Extension+TextFieldStyle.swift in Sources */,
Expand Down
23 changes: 23 additions & 0 deletions NinjacordApp/Common/ComingSoonModifier.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// ComingSoonModifier.swift
// NinjacordApp
//
// Created by 村石 拓海 on 2024/05/19.
//

import SwiftUI

struct ComingSoonModifier: ViewModifier {
func body(content: Content) -> some View {
HStack(spacing: .zero) {
content
Text(" (近日公開)")
}
}
}

extension View {
func addComingSoon() -> some View {
self.modifier(ComingSoonModifier())
}
}
54 changes: 10 additions & 44 deletions NinjacordApp/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,50 @@
"" : {

},
"URLを入れてください" : {
" (近日公開)" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Enter Webhook URL"
"value" : " (Coming Soon)"
}
},
"ja" : {
"stringUnit" : {
"state" : "needs_review",
"value" : "URLを入れてください"
"state" : "translated",
"value" : " (近日公開)"
}
}
}
},
"URL設定" : {
"URLを入れてください" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "URL Setting"
"value" : "Enter Webhook URL"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "URL設定"
"value" : "URLを入れてください"
}
}
}
},
"URL設定 (近日公開)" : {
"URL設定" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "URL Setting (Coming Soon)"
"value" : "URL Setting"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "URL設定 (近日公開)"
"value" : "URL設定"
}
}
}
Expand Down Expand Up @@ -85,7 +85,6 @@
}
},
"このアプリについて" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
Expand All @@ -101,22 +100,6 @@
}
}
},
"このアプリについて (近日公開)" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "About this App (Coming Soon)"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "このアプリについて (近日公開)"
}
}
}
},
"プライバシーポリシー" : {
"localizations" : {
"en" : {
Expand Down Expand Up @@ -182,7 +165,6 @@
}
},
"ライセンス" : {
"extractionState" : "stale",
"localizations" : {
"en" : {
"stringUnit" : {
Expand All @@ -198,22 +180,6 @@
}
}
},
"ライセンス (近日公開)" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "License (Coming Soon)"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "ライセンス (近日公開)"
}
}
}
},
"名前を入れてください" : {
"localizations" : {
"en" : {
Expand Down
9 changes: 6 additions & 3 deletions NinjacordApp/Setting/SettingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ struct SettingView: View {
Button {
isURLSettingPresented = true
} label: {
Text("URL設定 (近日公開)")
Text("URL設定")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keyが減って良かったと思います

.addComingSoon()
.foregroundStyle(.white)
}
.listRowBackground(Color.discordGray)
Expand All @@ -39,7 +40,8 @@ struct SettingView: View {
})

Section(content: {
Text("このアプリについて (近日公開)")
Text("このアプリについて")
.addComingSoon()
.foregroundStyle(.white)
.listRowBackground(Color.discordGray)

Expand All @@ -61,7 +63,8 @@ struct SettingView: View {
PrivacyPolicyView()
}

Text("ライセンス (近日公開)")
Text("ライセンス")
.addComingSoon()
.foregroundStyle(.white)
.listRowBackground(Color.discordGray)

Expand Down