Skip to content

Commit ba45f42

Browse files
committed
feat: remove source field
1 parent bfd94d7 commit ba45f42

5 files changed

Lines changed: 2 additions & 33 deletions

File tree

app/src/main/java/to/bitkit/data/dto/price/PriceDTO.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ import kotlinx.serialization.Serializable
77
@Serializable
88
data class PriceDTO(
99
@Stable val widgets: List<PriceWidgetData>,
10-
val source: String
1110
)

app/src/main/java/to/bitkit/data/widgets/PriceService.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class PriceService @Inject constructor(
3636

3737
override val widgetType = WidgetType.PRICE
3838
override val refreshInterval = 1.minutes
39-
private val sourceLabel = "Bitfinex.com"
4039

4140
override suspend fun fetchData(): Result<PriceDTO> = runCatching {
4241
val period = widgetsStore.data.first().pricePreferences.period ?: GraphPeriod.ONE_DAY
@@ -50,7 +49,7 @@ class PriceService @Inject constructor(
5049
.getOrNull()
5150
}
5251
if (widgets.isEmpty()) throw PriceError.InvalidResponse("No price data available")
53-
PriceDTO(widgets = widgets, source = sourceLabel)
52+
PriceDTO(widgets = widgets)
5453
}.onFailure {
5554
Logger.warn(e = it, msg = "Failed to fetch price data", context = TAG)
5655
}
@@ -62,7 +61,7 @@ class PriceService @Inject constructor(
6261
val widgets = TradingPair.entries.mapNotNull { pair ->
6362
runCatching { fetchPairData(pair = pair, period = period) }.getOrNull()
6463
}
65-
PriceDTO(widgets = widgets, source = sourceLabel)
64+
PriceDTO(widgets = widgets)
6665
}
6766
}.awaitAll().filter { it.widgets.isNotEmpty() }
6867
}

app/src/main/java/to/bitkit/ui/screens/wallets/HomeScreen.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,6 @@ private val previewArticle = ArticleModel(
981981
)
982982

983983
private val previewPrice = PriceDTO(
984-
source = "Bitfinex.com",
985984
widgets = listOf(
986985
PriceWidgetData(
987986
pair = TradingPair.BTC_USD,

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

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import androidx.compose.ui.Modifier
2121
import androidx.compose.ui.draw.clip
2222
import androidx.compose.ui.graphics.SolidColor
2323
import androidx.compose.ui.platform.testTag
24-
import androidx.compose.ui.res.stringResource
2524
import androidx.compose.ui.text.font.FontWeight
2625
import androidx.compose.ui.tooling.preview.Preview
2726
import androidx.compose.ui.unit.dp
@@ -34,17 +33,14 @@ import ir.ehsannarmani.compose_charts.models.HorizontalIndicatorProperties
3433
import ir.ehsannarmani.compose_charts.models.LabelHelperProperties
3534
import ir.ehsannarmani.compose_charts.models.LabelProperties
3635
import ir.ehsannarmani.compose_charts.models.Line
37-
import to.bitkit.R
3836
import to.bitkit.data.dto.price.Change
3937
import to.bitkit.data.dto.price.GraphPeriod
4038
import to.bitkit.data.dto.price.PriceDTO
4139
import to.bitkit.data.dto.price.PriceWidgetData
4240
import to.bitkit.data.dto.price.TradingPair
4341
import to.bitkit.models.widget.PricePreferences
4442
import to.bitkit.ui.components.Caption13Up
45-
import to.bitkit.ui.components.CaptionB
4643
import to.bitkit.ui.components.HorizontalSpacer
47-
import to.bitkit.ui.components.VerticalSpacer
4844
import to.bitkit.ui.theme.AppThemeSurface
4945
import to.bitkit.ui.theme.Colors
5046

@@ -112,28 +108,6 @@ fun PriceCard(
112108
.height(48.dp)
113109
.testTag("price_card_chart")
114110
)
115-
116-
if (pricePreferences.showSource) {
117-
VerticalSpacer(8.dp)
118-
119-
Row(
120-
horizontalArrangement = Arrangement.SpaceBetween,
121-
modifier = Modifier
122-
.fillMaxWidth()
123-
.testTag("PriceWidgetSource")
124-
) {
125-
CaptionB(
126-
text = stringResource(R.string.widgets__widget__source),
127-
color = Colors.White64,
128-
modifier = Modifier.testTag("source_label")
129-
)
130-
CaptionB(
131-
text = priceDTO.source,
132-
color = Colors.White64,
133-
modifier = Modifier.testTag("source_text")
134-
)
135-
}
136-
}
137111
}
138112
}
139113
}
@@ -279,7 +253,6 @@ private fun FullBlockCardPreview() {
279253
showSource = true,
280254
),
281255
priceDTO = PriceDTO(
282-
source = "Bitfinex.com",
283256
widgets = listOf(
284257
PriceWidgetData(
285258
pair = TradingPair.BTC_USD,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ private fun PreviewWithDelete() {
311311
}
312312

313313
private val SAMPLE_PRICE_DTO = PriceDTO(
314-
source = "Bitfinex.com",
315314
widgets = listOf(
316315
PriceWidgetData(
317316
pair = TradingPair.BTC_USD,

0 commit comments

Comments
 (0)