Skip to content

Commit 1d30542

Browse files
committed
refactor: extract compact widget card size constant
1 parent 6704f95 commit 1d30542

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package to.bitkit.ui.screens.widgets.components
2+
3+
import androidx.compose.ui.unit.DpSize
4+
import androidx.compose.ui.unit.dp
5+
6+
object WidgetCardDimens {
7+
val COMPACT_CARD_SIZE = DpSize(163.dp, 192.dp)
8+
}

app/src/main/java/to/bitkit/ui/screens/widgets/headlines/HeadlineCard.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import androidx.compose.ui.unit.dp
2222
import androidx.core.net.toUri
2323
import to.bitkit.ui.components.BodySSB
2424
import to.bitkit.ui.components.Title
25+
import to.bitkit.ui.screens.widgets.components.WidgetCardDimens
2526
import to.bitkit.ui.shared.modifiers.clickableAlpha
2627
import to.bitkit.ui.theme.AppThemeSurface
2728
import to.bitkit.ui.theme.Colors
@@ -100,7 +101,7 @@ fun HeadlineCardSmall(
100101

101102
Box(
102103
modifier = modifier
103-
.size(width = 163.dp, height = 192.dp)
104+
.size(WidgetCardDimens.COMPACT_CARD_SIZE)
104105
.clip(shape = MaterialTheme.shapes.medium)
105106
.background(Colors.White10)
106107
.clickableAlpha {

app/src/main/java/to/bitkit/ui/screens/widgets/price/PricePreviewScreen.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ import androidx.compose.foundation.layout.Box
66
import androidx.compose.foundation.layout.Column
77
import androidx.compose.foundation.layout.Row
88
import androidx.compose.foundation.layout.fillMaxWidth
9-
import androidx.compose.foundation.layout.height
109
import androidx.compose.foundation.layout.padding
11-
import androidx.compose.foundation.layout.width
10+
import androidx.compose.foundation.layout.size
1211
import androidx.compose.material3.HorizontalDivider
1312
import androidx.compose.runtime.Composable
1413
import androidx.compose.runtime.LaunchedEffect
@@ -34,6 +33,7 @@ import to.bitkit.ui.components.settings.SettingsButtonRow
3433
import to.bitkit.ui.components.settings.SettingsButtonValue
3534
import to.bitkit.ui.scaffold.AppTopBar
3635
import to.bitkit.ui.scaffold.ScreenColumn
36+
import to.bitkit.ui.screens.widgets.components.WidgetCardDimens
3737
import to.bitkit.ui.screens.widgets.components.WidgetSizeCarousel
3838
import to.bitkit.ui.theme.AppThemeSurface
3939
import to.bitkit.ui.theme.Colors
@@ -141,8 +141,7 @@ fun PricePreviewContent(
141141
pricePreferences = pricePreferences,
142142
priceDTO = priceDTO,
143143
modifier = Modifier
144-
.width(163.dp)
145-
.height(192.dp)
144+
.size(WidgetCardDimens.COMPACT_CARD_SIZE)
146145
.testTag("price_card_small")
147146
)
148147
},

0 commit comments

Comments
 (0)