Closed ReactaDev closed 1 year ago
Great first contribution! It would be great if you could include screenshots of how this button would look (editing your OP would suffice) to make evaluating this PR quicker. Thanks!
Great first contribution! It would be great if you could include screenshots of how this button would look (editing your OP would suffice) to make evaluating this PR quicker. Thanks!
Upated! Sorry about that!
Ok, looks good! Looks like the only thing that's left is to resolve these lint warnings before this PR can be merged!
A little tip: I suggest enabling the Automatically trim trailing whitespace and Including whitespace-only lines options in Xcode's settings to automatically remove any trailing whitespace.
Ahh I will fix that. Its a bad habit I have with code formating
A little tip: I suggest enabling the Automatically trim trailing whitespace and Including whitespace-only lines options in Xcode's settings to automatically remove any trailing whitespace.
Ohh I will enable that right now! Thank you! I have spent way to long debugging those.
Summery
A Button to directly copy user and discrim from the mini profile page.
How it works
Uses pasteboard to copy to clipboard, grabs the "user.username" and "user.discriminator" and interpolates it with a "#" to form a string "Username#1234" that gets copied to the clipboard.
Code that was added
let pasteboard = NSPasteboard.general
Button(action: { pasteboard.declareTypes([.string], owner: nil) pasteboard.setString("\(user.username)#\(user.discriminator)", forType: .string) }, label: { Image(systemName: "square.on.square") }) .buttonStyle(.plain) .padding() .frame(width: 20, height: 20)
All in all, a very simple ease of life change.
Examples