Skip to content

Commit 2aa0bf2

Browse files
committed
feat: add preview
1 parent bc550b6 commit 2aa0bf2

File tree

1 file changed

+123
-0
lines changed

1 file changed

+123
-0
lines changed

app/src/main/java/to/bitkit/ui/components/NumberPadTextField.kt

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import androidx.compose.ui.Alignment
1515
import androidx.compose.ui.Modifier
1616
import androidx.compose.ui.semantics.contentDescription
1717
import androidx.compose.ui.semantics.semantics
18+
import androidx.compose.ui.tooling.preview.Preview
1819
import androidx.compose.ui.unit.dp
1920
import okhttp3.internal.toLongOrDefault
2021
import to.bitkit.ext.removeSpaces
@@ -23,6 +24,7 @@ import to.bitkit.models.BitcoinDisplayUnit
2324
import to.bitkit.models.PrimaryDisplay
2425
import to.bitkit.models.formatToModernDisplay
2526
import to.bitkit.ui.currencyViewModel
27+
import to.bitkit.ui.theme.AppThemeSurface
2628
import to.bitkit.ui.theme.Colors
2729

2830

@@ -156,3 +158,124 @@ fun MoneyAmount(
156158
}
157159
}
158160
}
161+
162+
163+
@Preview(name = "FIAT - Empty", group = "MoneyAmount", showBackground = true)
164+
@Composable
165+
fun PreviewMoneyAmountFiatEmpty() {
166+
AppThemeSurface {
167+
MoneyAmount(
168+
value = "",
169+
unit = PrimaryDisplay.FIAT,
170+
placeholder = ".00",
171+
showPlaceholder = true,
172+
satoshis = 0,
173+
currencySymbol = "$"
174+
)
175+
}
176+
}
177+
178+
@Preview(name = "FIAT - With Value", group = "MoneyAmount", showBackground = true)
179+
@Composable
180+
fun PreviewMoneyAmountFiatWithValue() {
181+
AppThemeSurface {
182+
MoneyAmount(
183+
value = "125.50",
184+
unit = PrimaryDisplay.FIAT,
185+
placeholder = "",
186+
showPlaceholder = true,
187+
satoshis = 12550000000,
188+
currencySymbol = "$"
189+
)
190+
}
191+
}
192+
193+
@Preview(name = "BITCOIN - Modern Empty", group = "MoneyAmount", showBackground = true)
194+
@Composable
195+
fun PreviewMoneyAmountBitcoinModernEmpty() {
196+
AppThemeSurface {
197+
MoneyAmount(
198+
value = "",
199+
unit = PrimaryDisplay.BITCOIN,
200+
placeholder = ".00000000",
201+
showPlaceholder = true,
202+
satoshis = 0,
203+
currencySymbol = ""
204+
)
205+
}
206+
}
207+
208+
@Preview(name = "BITCOIN - Modern With Value", group = "MoneyAmount", showBackground = true)
209+
@Composable
210+
fun PreviewMoneyAmountBitcoinModernWithValue() {
211+
AppThemeSurface {
212+
MoneyAmount(
213+
value = "1.25",
214+
unit = PrimaryDisplay.BITCOIN,
215+
placeholder = "00000",
216+
showPlaceholder = true,
217+
satoshis = 125000000,
218+
currencySymbol = ""
219+
)
220+
}
221+
}
222+
223+
@Preview(name = "BITCOIN - Classic Empty", group = "MoneyAmount", showBackground = true)
224+
@Composable
225+
fun PreviewMoneyAmountBitcoinClassicEmpty() {
226+
AppThemeSurface {
227+
MoneyAmount(
228+
value = "",
229+
unit = PrimaryDisplay.BITCOIN,
230+
placeholder = ".00000000",
231+
showPlaceholder = true,
232+
satoshis = 0,
233+
currencySymbol = ""
234+
)
235+
}
236+
}
237+
238+
@Preview(name = "BITCOIN - Classic With Value", group = "MoneyAmount", showBackground = true)
239+
@Composable
240+
fun PreviewMoneyAmountBitcoinClassicWithValue() {
241+
AppThemeSurface {
242+
MoneyAmount(
243+
value = "125000000",
244+
unit = PrimaryDisplay.BITCOIN,
245+
placeholder = "",
246+
showPlaceholder = true,
247+
satoshis = 125000000,
248+
currencySymbol = ""
249+
)
250+
}
251+
}
252+
253+
@Preview(name = "FIAT - Partial Input", group = "MoneyAmount", showBackground = true)
254+
@Composable
255+
fun PreviewMoneyAmountFiatPartial() {
256+
AppThemeSurface {
257+
MoneyAmount(
258+
value = "125.",
259+
unit = PrimaryDisplay.FIAT,
260+
placeholder = "00",
261+
showPlaceholder = true,
262+
satoshis = 12500000000,
263+
currencySymbol = "$"
264+
)
265+
}
266+
}
267+
268+
@Preview(name = "BITCOIN - Partial Input", group = "MoneyAmount", showBackground = true)
269+
@Composable
270+
fun PreviewMoneyAmountBitcoinPartial() {
271+
AppThemeSurface {
272+
MoneyAmount(
273+
value = "1.25",
274+
unit = PrimaryDisplay.BITCOIN,
275+
placeholder = "00000",
276+
showPlaceholder = true,
277+
satoshis = 125000000,
278+
currencySymbol = ""
279+
)
280+
}
281+
}

0 commit comments

Comments
 (0)