mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-10 23:33:29 +01:00
[ADD] Hint for new users who don't have any sources
This commit is contained in:
committed by
Joe Mattiello
parent
6aaadc79e5
commit
fc974a8079
42
AltStore/View Components/HintView.swift
Normal file
42
AltStore/View Components/HintView.swift
Normal file
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// HintView.swift
|
||||
// SideStore
|
||||
//
|
||||
// Created by Fabian Thies on 15.01.23.
|
||||
// Copyright © 2023 SideStore. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct HintView<Content: View>: View {
|
||||
|
||||
var backgroundColor: Color = Color(.tertiarySystemBackground)
|
||||
|
||||
@ViewBuilder
|
||||
let content: () -> Content
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
self.content()
|
||||
}
|
||||
.padding()
|
||||
.background(self.backgroundColor)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 8))
|
||||
}
|
||||
}
|
||||
|
||||
struct HintView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ZStack {
|
||||
Color(.secondarySystemBackground).edgesIgnoringSafeArea(.all)
|
||||
|
||||
HintView {
|
||||
Text("Hint Title")
|
||||
.bold()
|
||||
|
||||
Text("This hint view can be used to tell the user something about how SideStore works.")
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user