@@ -20,9 +20,11 @@ import androidx.compose.ui.Modifier
2020import androidx.compose.ui.platform.testTag
2121import androidx.compose.ui.res.painterResource
2222import androidx.compose.ui.res.stringResource
23+ import androidx.compose.ui.tooling.preview.Preview
2324import androidx.compose.ui.unit.dp
2425import androidx.lifecycle.compose.collectAsStateWithLifecycle
2526import to.bitkit.R
27+ import to.bitkit.data.dto.price.Change
2628import to.bitkit.data.dto.price.GraphPeriod
2729import to.bitkit.data.dto.price.PriceDTO
2830import to.bitkit.data.dto.price.PriceWidgetData
@@ -35,6 +37,7 @@ import to.bitkit.ui.components.SecondaryButton
3537import to.bitkit.ui.scaffold.AppTopBar
3638import to.bitkit.ui.scaffold.DrawerNavIcon
3739import to.bitkit.ui.scaffold.ScreenColumn
40+ import to.bitkit.ui.theme.AppThemeSurface
3841import to.bitkit.ui.theme.Colors
3942
4043@Composable
@@ -268,3 +271,56 @@ private fun PriceChartOptionRow(
268271 )
269272 }
270273}
274+
275+ @Suppress(" MagicNumber" )
276+ @Preview(showSystemUi = true )
277+ @Composable
278+ private fun Preview () {
279+ AppThemeSurface {
280+ PriceEditContent (
281+ onBack = {},
282+ priceModel = PriceDTO (
283+ widgets = listOf (
284+ PriceWidgetData (
285+ pair = TradingPair .BTC_USD ,
286+ period = GraphPeriod .ONE_DAY ,
287+ change = Change (isPositive = true , formatted = " +2.5%" ),
288+ price = " $97,500" ,
289+ pastValues = listOf (95000.0 , 96000.0 , 95500.0 , 97000.0 , 97500.0 )
290+ ),
291+ PriceWidgetData (
292+ pair = TradingPair .BTC_EUR ,
293+ period = GraphPeriod .ONE_DAY ,
294+ change = Change (isPositive = true , formatted = " +2.3%" ),
295+ price = " €89,000" ,
296+ pastValues = listOf (87000.0 , 88000.0 , 87500.0 , 88500.0 , 89000.0 )
297+ )
298+ ),
299+ source = " Kraken"
300+ ),
301+ allPeriodsUsd = listOf (
302+ PriceWidgetData (
303+ pair = TradingPair .BTC_USD ,
304+ period = GraphPeriod .ONE_DAY ,
305+ change = Change (isPositive = true , formatted = " +2.5%" ),
306+ price = " $97,500" ,
307+ pastValues = listOf (95000.0 , 96000.0 , 95500.0 , 97000.0 , 97500.0 )
308+ ),
309+ PriceWidgetData (
310+ pair = TradingPair .BTC_USD ,
311+ period = GraphPeriod .ONE_WEEK ,
312+ change = Change (isPositive = true , formatted = " +5.0%" ),
313+ price = " $97,500" ,
314+ pastValues = listOf (93000.0 , 94000.0 , 95000.0 , 96000.0 , 97500.0 )
315+ )
316+ ),
317+ onClickReset = {},
318+ onClickGraph = {},
319+ onClickTradingPair = {},
320+ onClickPreview = {},
321+ onClickSource = {},
322+ preferences = PricePreferences (),
323+ isLoading = false
324+ )
325+ }
326+ }
0 commit comments