@@ -22,7 +22,8 @@ struct SeedBackupPage: View {
2222
2323 let titleFontSize = 16.0
2424 let textFontSize = 12.0
25- let sectionSpacing = 12.0
25+ let dataFontSize = 8.0
26+ let sectionSpacing = 8.0
2627 let itemSpacing = 5.0
2728
2829 var body : some View {
@@ -35,36 +36,40 @@ struct SeedBackupPage: View {
3536 byteWords
3637 bip39
3738 envelopeView
38- if seed . creationDate != nil {
39+ if hasCreationDate {
3940 creationDate
4041 }
41- derivations
42- BackupPageNoteSection ( note: seed. note)
42+ if hasDerivation {
43+ derivations
44+ }
45+ if hasNote {
46+ BackupPageNoteSection ( note: seed. note)
47+ }
4348 Spacer ( )
4449 }
4550 }
4651
4752 var data : some View {
4853 BackupPageSection ( title: Text ( " Hex " ) , icon: Image . hex) {
4954 Text ( seed. data. hex)
50- . appMonospaced ( size: textFontSize)
51- . layoutPriority ( 1 )
55+ . appMonospaced ( size: dataFontSize)
5256 }
57+ . layoutPriority ( 1 )
5358 }
5459
5560 var byteWords : some View {
5661 BackupPageSection ( title: Text ( " ByteWords " ) , icon: Image . byteWords) {
5762 Text ( seed. byteWords)
58- . appMonospaced ( size: textFontSize )
59- . layoutPriority ( 1 )
63+ . appMonospaced ( size: dataFontSize )
64+ . fixedVertical ( )
6065 }
6166 }
6267
6368 var bip39 : some View {
6469 BackupPageSection ( title: Text ( " BIP39 Words " ) , icon: Image . bip39) {
6570 Text ( seed. bip39. mnemonic)
66- . appMonospaced ( size: textFontSize )
67- . layoutPriority ( 1 )
71+ . appMonospaced ( size: dataFontSize )
72+ . fixedVertical ( )
6873 }
6974 }
7075
@@ -74,13 +79,14 @@ struct SeedBackupPage: View {
7479 . appMonospaced ( size: textFontSize)
7580 . minimumScaleFactor ( 0.3 )
7681 }
82+ . layoutPriority ( 0.5 )
7783 }
7884
7985 var creationDate : some View {
8086 BackupPageSection ( title: Text ( " Creation Date " ) , icon: Image . date) {
8187 Text ( seedDateFormatter. string ( from: seed. creationDate!) )
82- . layoutPriority ( 1 )
8388 }
89+ . layoutPriority ( 1 )
8490 }
8591
8692 @ViewBuilder
@@ -145,6 +151,19 @@ struct SeedBackupPage: View {
145151 . layoutPriority ( 1 )
146152 }
147153
154+ var hasDerivation : Bool {
155+ globalSettings. primaryAsset != . btc ||
156+ seed. outputDescriptor != nil
157+ }
158+
159+ var hasCreationDate : Bool {
160+ seed. creationDate != nil
161+ }
162+
163+ var hasNote : Bool {
164+ !seed. note. isEmpty
165+ }
166+
148167 var masterKey : HDKey {
149168 seed. masterKey
150169 }
@@ -196,13 +215,11 @@ struct BackupPageNoteSection: View {
196215 let note : String
197216
198217 var body : some View {
199- if let note = sizeLimitedNote, !note. isEmpty {
200- BackupPageSection ( title: Text ( " Notes " ) , icon: Image . note) {
201- Text ( note)
202- . minimumScaleFactor ( 0.5 )
203- . layoutPriority ( 0.5 )
204- }
218+ BackupPageSection ( title: Text ( " Notes " ) , icon: Image . note) {
219+ Text ( note)
220+ . minimumScaleFactor ( 0.5 )
205221 }
222+ . layoutPriority ( 0.5 )
206223 }
207224
208225 var sizeLimitedNote : String ? {
0 commit comments