Skip to content

Commit

Permalink
Feat : 분석하기에서 스파클링 와인일 시 알코올이 아닌 탄산감 노출
Browse files Browse the repository at this point in the history
  • Loading branch information
DongChyeon committed Oct 12, 2024
1 parent 389e4e6 commit 10f7a05
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fun TasteAnalysis.toDomain() = TasteAnalysis(
avgPrice = this.avgPrice,
recommendCountry = this.recommendCountry,
recommendVarietal = this.recommendVarietal,
recommendWineType = convertTypeToSpecies(this.recommendWineType),
recommendWineType = this.recommendWineType,
taste = this.taste,
top3Type = this.top3Type.map { top3Type ->
Top3Type(convertTypeToColor(top3Type.type), top3Type.percent)
Expand All @@ -60,18 +60,6 @@ fun TasteAnalysis.toDomain() = TasteAnalysis(
buyAgainCnt = this.buyAgainCnt
)

private fun convertTypeToSpecies(type: String): String {
return when (type) {
"RED" -> "레드 와인"
"ROSE" -> "로제 와인"
"WHITE" -> "화이트 와인"
"SPARKLING" -> "스파클링 와인"
"FORTIFIED" -> "포트 와인"
"OTHER" -> "기타 와인"
else -> "기타 와인"
}
}

private fun convertTypeToColor(type: String): String {
return when (type) {
"RED" -> "레드"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fun AnalysisResultScreen(
)

Text(
text = "\"${analysisData.recommendCountry}${analysisData.recommendVarietal} 품종으로 만든 ${analysisData.recommendWineType}\"",
text = "\"${analysisData.recommendCountry}${analysisData.recommendVarietal} 품종으로 만든 ${convertTypeToSpecies(analysisData.recommendWineType)}\"",
style = WineyTheme.typography.title2,
color = WineyTheme.colors.main_3,
textAlign = TextAlign.Center,
Expand Down Expand Up @@ -203,3 +203,15 @@ fun AnalysisResultScreen(
}
}
}

private fun convertTypeToSpecies(type: String): String {
return when (type) {
"RED" -> "레드 와인"
"ROSE" -> "로제 와인"
"WHITE" -> "화이트 와인"
"SPARKLING" -> "스파클링 와인"
"FORTIFIED" -> "포트 와인"
"OTHER" -> "기타 와인"
else -> "기타 와인"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.teamwiney.analysis.component.pagercontent

import android.util.Log
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
Expand Down Expand Up @@ -31,6 +32,8 @@ fun WineTasteContent(
wineType: WineType,
tastes: Taste
) {
Log.d("WineTasteContent", "wineType: $wineType, progress: $progress, tastes: $tastes")

Column(
modifier = Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally
Expand Down

0 comments on commit 10f7a05

Please sign in to comment.