@@ -59,71 +59,6 @@ struct FileInspectorView: View {
5959 widthOptions
6060 wrapLinesToggle
6161 }
62- Section ( " Test Notifications " ) {
63- Button ( " Add Notification " ) {
64- let ( iconSymbol, iconColor) = randomSymbolAndColor ( )
65- NotificationManager . shared. post (
66- iconSymbol: iconSymbol,
67- iconColor: iconColor,
68- title: " Test Notification " ,
69- description: " This is a test notification. " ,
70- actionButtonTitle: " Action " ,
71- action: {
72- print ( " Test notification action triggered " )
73- }
74- )
75- }
76- Button ( " Add Sticky Notification " ) {
77- NotificationManager . shared. post (
78- iconSymbol: " pin.fill " ,
79- iconColor: . orange,
80- title: " Sticky Notification " ,
81- description: " This notification will stay until dismissed. " ,
82- actionButtonTitle: " Acknowledge " ,
83- action: {
84- print ( " Sticky notification acknowledged " )
85- } ,
86- isSticky: true
87- )
88- }
89- Button ( " Add Image Notification " ) {
90- NotificationManager . shared. post (
91- iconImage: randomImage ( ) ,
92- title: " Test Notification with Image " ,
93- description: " This is a test notification with a custom image. " ,
94- actionButtonTitle: " Action " ,
95- action: {
96- print ( " Test notification action triggered " )
97- }
98- )
99- }
100- Button ( " Add Text Notification " ) {
101- NotificationManager . shared. post (
102- iconText: randomLetter ( ) ,
103- iconTextColor: . white,
104- iconColor: randomColor ( ) ,
105- title: " Text Notification " ,
106- description: " This is a test notification with text. " ,
107- actionButtonTitle: " Acknowledge " ,
108- action: {
109- print ( " Test notification action triggered " )
110- }
111- )
112- }
113- Button ( " Add Emoji Notification " ) {
114- NotificationManager . shared. post (
115- iconText: randomEmoji ( ) ,
116- iconTextColor: . white,
117- iconColor: randomColor ( ) ,
118- title: " Emoji Notification " ,
119- description: " This is a test notification with an emoji. " ,
120- actionButtonTitle: " Acknowledge " ,
121- action: {
122- print ( " Test notification action triggered " )
123- }
124- )
125- }
126- }
12762 }
12863 } else {
12964 NoSelectionInspectorView ( )
@@ -146,62 +81,6 @@ struct FileInspectorView: View {
14681 }
14782 }
14883
149- func randomColor( ) -> Color {
150- let colors : [ Color ] = [
151- . red, . orange, . yellow, . green, . mint, . cyan,
152- . teal, . blue, . indigo, . purple, . pink, . gray
153- ]
154- return colors. randomElement ( ) ?? . black
155- }
156-
157- func randomSymbolAndColor( ) -> ( String , Color ) {
158- let symbols : [ ( String , Color ) ] = [
159- ( " bell.fill " , . red) ,
160- ( " bell.badge.fill " , . red) ,
161- ( " exclamationmark.triangle.fill " , . orange) ,
162- ( " info.circle.fill " , . blue) ,
163- ( " checkmark.seal.fill " , . green) ,
164- ( " xmark.octagon.fill " , . red) ,
165- ( " bubble.left.fill " , . teal) ,
166- ( " envelope.fill " , . blue) ,
167- ( " phone.fill " , . green) ,
168- ( " megaphone.fill " , . pink) ,
169- ( " clock.fill " , . gray) ,
170- ( " calendar " , . red) ,
171- ( " flag.fill " , . green) ,
172- ( " bookmark.fill " , . orange) ,
173- ( " bolt.fill " , . indigo) ,
174- ( " shield.lefthalf.fill " , . red) ,
175- ( " gift.fill " , . purple) ,
176- ( " heart.fill " , . pink) ,
177- ( " star.fill " , . orange) ,
178- ( " curlybraces " , . cyan) ,
179- ]
180- return symbols. randomElement ( ) ?? ( " bell.fill " , . red)
181- }
182-
183- func randomEmoji( ) -> String {
184- let emoji : [ String ] = [
185- " 🔔 " , " 🚨 " , " ⚠️ " , " 👋 " , " 😍 " , " 😎 " , " 😘 " , " 😜 " , " 😝 " , " 😀 " , " 😁 " ,
186- " 😂 " , " 🤣 " , " 😃 " , " 😄 " , " 😅 " , " 😆 " , " 😇 " , " 😉 " , " 😊 " , " 😋 " , " 😌 "
187- ]
188- return emoji. randomElement ( ) ?? " 🔔 "
189- }
190-
191- func randomImage( ) -> Image {
192- let images : [ Image ] = [
193- Image ( " GitHubIcon " ) ,
194- Image ( " BitBucketIcon " ) ,
195- Image ( " GitLabIcon " )
196- ]
197- return images. randomElement ( ) ?? Image ( " GitHubIcon " )
198- }
199-
200- func randomLetter( ) -> String {
201- let letters = " ABCDEFGHIJKLMNOPQRSTUVWXYZ " . map { String ( $0) }
202- return letters. randomElement ( ) ?? " A "
203- }
204-
20584 @ViewBuilder private var fileNameField : some View {
20685 @State var isValid : Bool = true
20786
0 commit comments