2024-02-20 22:31:44 +01:00
// M a d e b y L u m a a
import SwiftUI
struct UpdateView : View {
@ Environment ( \ . dismiss ) private var dismiss
var body : some View {
ZStack {
Color . appBackground
. ignoresSafeArea ( )
VStack ( alignment : . center ) {
Text ( " update.title " )
. font ( . title . bold ( ) )
2024-02-24 13:27:00 +01:00
. padding ( . top , 50 )
2024-02-20 22:31:44 +01:00
Text ( " about.version- \( AppInfo . appVersion ) " )
. font ( . caption )
. foregroundStyle ( Color . gray )
Spacer ( )
features
Spacer ( )
Button {
dismiss ( )
} label : {
Text ( " update.hide " )
2024-02-24 13:27:00 +01:00
. frame ( minWidth : 250 )
2024-02-20 22:31:44 +01:00
}
. buttonStyle ( LargeButton ( filled : true ) )
}
}
}
var features : some View {
VStack ( spacing : 40 ) {
2024-02-24 13:27:00 +01:00
newFeature ( imageName : " HeroPlus " , title : " Threaded+ " , text : " You can now pay for the, long teased, Plus features. Starting at $1.99 " )
2024-02-20 22:31:44 +01:00
2024-02-24 13:27:00 +01:00
newFeature ( systemImage : " folder.badge.person.crop " , title : " Account Switcher " , text : " You can now switch accounts very easily using the Account Switcher, go in the settings to start using it " )
2024-02-20 22:31:44 +01:00
2024-02-24 13:27:00 +01:00
newFeature ( systemImage : " photo.on.rectangle " , title : " Better Viewer " , text : " The attachment viewer used to only work on images, now it works on all type of media with new buttons as well " )
2024-02-20 22:31:44 +01:00
}
. frame ( height : 500 )
}
@ ViewBuilder
private func newFeature ( systemImage : String , title : String , text : String ) -> some View {
ViewThatFits {
HStack ( alignment : . center ) {
Image ( systemName : systemImage )
. resizable ( )
. scaledToFit ( )
. frame ( width : 60 , height : 60 )
. foregroundStyle ( Color ( uiColor : UIColor . label ) )
Spacer ( )
. frame ( width : 30 )
VStack ( alignment : . leading ) {
Text ( title )
. bold ( )
. foregroundStyle ( Color ( uiColor : UIColor . label ) )
. multilineTextAlignment ( . leading )
. lineLimit ( 1 )
Text ( text )
. foregroundStyle ( Color ( uiColor : UIColor . label ) . opacity ( 0.7 ) )
. font ( . callout )
. multilineTextAlignment ( . leading )
. lineLimit ( 4 )
}
Spacer ( )
}
. frame ( width : 330 )
VStack ( alignment : . leading ) {
Text ( title )
. bold ( )
. foregroundStyle ( Color ( uiColor : UIColor . label ) )
. multilineTextAlignment ( . leading )
. lineLimit ( 1 )
Text ( text )
. foregroundStyle ( Color ( uiColor : UIColor . label ) )
. multilineTextAlignment ( . leading )
. lineLimit ( 4 )
}
. padding ( . horizontal )
}
}
2024-02-24 13:27:00 +01:00
@ ViewBuilder
private func newFeature ( imageName : String , title : String , text : String ) -> some View {
ViewThatFits {
HStack ( alignment : . center ) {
Image ( imageName )
. resizable ( )
. scaledToFit ( )
. frame ( width : 60 , height : 60 )
. foregroundStyle ( Color ( uiColor : UIColor . label ) )
Spacer ( )
. frame ( width : 30 )
VStack ( alignment : . leading ) {
Text ( title )
. bold ( )
. foregroundStyle ( Color ( uiColor : UIColor . label ) )
. multilineTextAlignment ( . leading )
. lineLimit ( 1 )
Text ( text )
. foregroundStyle ( Color ( uiColor : UIColor . label ) . opacity ( 0.7 ) )
. font ( . callout )
. multilineTextAlignment ( . leading )
. lineLimit ( 4 )
}
Spacer ( )
}
. frame ( width : 330 )
VStack ( alignment : . leading ) {
Text ( title )
. bold ( )
. foregroundStyle ( Color ( uiColor : UIColor . label ) )
. multilineTextAlignment ( . leading )
. lineLimit ( 1 )
Text ( text )
. foregroundStyle ( Color ( uiColor : UIColor . label ) )
. multilineTextAlignment ( . leading )
. lineLimit ( 4 )
}
. padding ( . horizontal )
}
}
2024-02-20 22:31:44 +01:00
}
# Preview {
2024-02-24 13:27:00 +01:00
Text ( String ( " UpdateView " ) )
. sheet ( isPresented : . constant ( true ) ) {
UpdateView ( )
}
2024-02-20 22:31:44 +01:00
}