-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add copy to clipboard for Firmwares (#119)
- Loading branch information
Showing
5 changed files
with
102 additions
and
23 deletions.
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
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,38 @@ | ||
// | ||
// FloatingAlert.swift | ||
// Mist | ||
// | ||
// Created by Nindi Gill on 25/1/2024. | ||
// | ||
|
||
import Foundation | ||
import SwiftUI | ||
|
||
struct FloatingAlert: View { | ||
var image: String | ||
var message: String | ||
private let length: CGFloat = 200 | ||
private let imageLength: CGFloat = 160 | ||
private let cornerRadius: CGFloat = 20 | ||
|
||
var body: some View { | ||
VStack { | ||
Image(systemName: image) | ||
.resizable() | ||
.scaledToFit() | ||
Text(message) | ||
.font(.title) | ||
.fontWeight(.medium) | ||
} | ||
.foregroundStyle(.secondary) | ||
.padding() | ||
.frame(width: length, height: length) | ||
.background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: cornerRadius)) | ||
} | ||
} | ||
|
||
struct FloatingAlert_Previews: PreviewProvider { | ||
static var previews: some View { | ||
FloatingAlert(image: "list.bullet.clipboard.fill", message: "Copied to Clipboard") | ||
} | ||
} |
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
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