diff --git a/Sources/UIKitComponents/Media.xcassets/dismiss.imageset/Contents.json b/Sources/UIKitComponents/Media.xcassets/dismiss.imageset/Contents.json new file mode 100644 index 0000000..71e3e58 --- /dev/null +++ b/Sources/UIKitComponents/Media.xcassets/dismiss.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "dismiss_24.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/UIKitComponents/Media.xcassets/dismiss.imageset/dismiss_24.png b/Sources/UIKitComponents/Media.xcassets/dismiss.imageset/dismiss_24.png new file mode 100644 index 0000000..d176e74 Binary files /dev/null and b/Sources/UIKitComponents/Media.xcassets/dismiss.imageset/dismiss_24.png differ diff --git a/Sources/UIKitComponents/SnackBar/SnackBarView.swift b/Sources/UIKitComponents/SnackBar/SnackBarView.swift new file mode 100644 index 0000000..d0f97ab --- /dev/null +++ b/Sources/UIKitComponents/SnackBar/SnackBarView.swift @@ -0,0 +1,49 @@ +// +// SwiftUIView.swift +// UIKitComponents +// +// Created by User on 28.05.2025. +// + +import SwiftUI + +public struct SnackBarView: View { + + @Binding var isShow: Bool + + public init(isShow: Binding) { + self._isShow = isShow + } + + public var body: some View { + ZStack(alignment: .topLeading) { + Color.white + .frame(height: 120) + .cornerRadius(8) + Text("Произошла ошибка\nНу вот опять") + .robotoFlex(size: 20, font: .black) + .tracking(0.38) + .lineSpacing(2.8) + .padding(.top, 24) + .padding(.leading, 20) + HStack { + Spacer() + Button { + isShow = false + print("no") + } label: { + Image("dismiss", bundle: .module) + .offset(y: -14) + .offset(x: 11) + } + } + + }.frame(maxWidth: .infinity) + .padding() + + } +} + +#Preview { + SnackBarView(isShow: .constant(true)) +}