@@ -95,33 +95,29 @@ private enum Constants {
9595
9696#Preview {
9797 VStack ( spacing: 20 ) {
98- // Basic header with back button.
98+ // Header without back button.
9999 POSPageHeaderView (
100100 title: " Products " ,
101- backButtonConfiguration: . init( state: . enabled, action: { } )
102- )
101+ trailingContent: {
102+ Button ( action: { } ) {
103+ Text ( Image ( systemName: " info.circle " ) )
104+ . font ( . posButtonSymbolLarge)
105+ }
106+ . foregroundColor ( . posOnSurface)
107+ } )
103108
104- // Header with subtitle .
109+ // Basic header with back button .
105110 POSPageHeaderView (
106- title: " Products " ,
107- subtitle: " Select products to add to cart " ,
111+ title: " Variation " ,
108112 backButtonConfiguration: . init( state: . enabled, action: { } )
109113 )
110114
111115 // Header with shimmering back button.
112116 POSPageHeaderView (
113- title: " Products " ,
114- subtitle: " Select products to add to cart " ,
117+ title: " Cart " ,
115118 backButtonConfiguration: . init( state: . shimmering, action: { } )
116119 )
117120
118- // Header with disabled back button.
119- POSPageHeaderView (
120- title: " Products " ,
121- subtitle: " Select products to add to cart " ,
122- backButtonConfiguration: . init( state: . disabled, action: { } )
123- )
124-
125121 // Header with trailing content.
126122 POSPageHeaderView (
127123 title: " Products " ,
@@ -142,10 +138,24 @@ private enum Constants {
142138 }
143139 }
144140
141+ // Header with subtitle.
142+ POSPageHeaderView (
143+ title: " Cash payment " ,
144+ subtitle: " Total: $100.00 " ,
145+ backButtonConfiguration: . init( state: . enabled, action: { } )
146+ )
147+
148+ // Header with subtitle and disabled back button.
149+ POSPageHeaderView (
150+ title: " Cash payment " ,
151+ subtitle: " Total: $100.00 " ,
152+ backButtonConfiguration: . init( state: . disabled, action: { } )
153+ )
154+
145155 // Header with everything.
146156 POSPageHeaderView (
147- title: " Products " ,
148- subtitle: " Select products to add to cart " ,
157+ title: " Title " ,
158+ subtitle: " Subtitle " ,
149159 backButtonConfiguration: . init( state: . enabled, action: { } )
150160 ) {
151161 Button ( action: { } ) {
@@ -154,18 +164,6 @@ private enum Constants {
154164 }
155165 . foregroundColor ( . posOnSurface)
156166 }
157-
158- // Header without back button.
159- POSPageHeaderView (
160- title: " Products " ,
161- subtitle: " Select products to add to cart " ,
162- trailingContent: {
163- Button ( action: { } ) {
164- Text ( Image ( systemName: " info.circle " ) )
165- . font ( . posButtonSymbolLarge)
166- }
167- . foregroundColor ( . posOnSurface)
168- } )
169167 }
170168 . background ( Color . posSurface)
171169}
0 commit comments