Commit 91a3053 1 parent 233c53f commit 91a3053 Copy full SHA for 91a3053
File tree 1 file changed +15
-6
lines changed
1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -167,23 +167,32 @@ export function EditableField(props) {
167
167
/> { isCurrency ? 'atto' : 'bytes' }
168
168
< div className = "button" onClick = { save } > Save</ div >
169
169
< div className = "button cancel" onClick = { cancel } > Cancel</ div >
170
- { BigInt ( currentVal ) > oneNanoFil ? (
171
- < span className = "human" > ({ humanFIL ( BigInt ( currentVal ) ) } )</ span >
172
- ) : null }
170
+ < PreviewAmt currentVal = { currentVal } isCurrency = { isCurrency } />
173
171
</ td >
174
172
) : (
175
173
< td className = "val" onClick = { ( ) => setEditing ( true ) } >
176
174
{ displayVal }
177
175
< span className = "edit" />
178
- { BigInt ( currentVal ) > oneNanoFil ? (
179
- < span className = "human" > ({ humanFIL ( BigInt ( currentVal ) ) } )</ span >
180
- ) : null }
176
+ { isCurrency ? < PreviewAmt currentVal = { currentVal } isCurrency = { isCurrency } /> : null }
181
177
</ td >
182
178
) }
183
179
</ tr >
184
180
)
185
181
}
186
182
183
+ function PreviewAmt ( { currentVal, isCurrency} ) {
184
+ if ( isCurrency ) {
185
+ if ( BigInt ( currentVal ) > oneNanoFil ) {
186
+ return < span className = "human" > ({ humanFIL ( BigInt ( currentVal ) ) } )</ span >
187
+ }
188
+ } else {
189
+ if ( BigInt ( currentVal ) > BigInt ( 1024 ) ) {
190
+ return < span className = "human" > ({ humanFileSize ( BigInt ( currentVal ) ) } )</ span >
191
+ }
192
+ }
193
+ return null
194
+ }
195
+
187
196
export function SettingsMenuItem ( props ) {
188
197
return (
189
198
< Link key = "settings" className = "menu-item" to = "/settings" >
You can’t perform that action at this time.
0 commit comments