-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature/#873] 오늘의 솝마디 콕찌르기 추천 기능 구현 #881
Changes from all commits
1aa4880
427fcc1
1a75a66
e265c4e
3b483ac
4241e3f
533a29f
f655b50
e26989c
5950cec
71001df
1e42c44
625d11e
430b830
83c0641
8d86bcb
340c78e
2ea3be9
37e8027
0bde946
2f9ffff
69a0acc
8981910
a7c5b50
3c27c00
c2ac6ed
138a332
48e6648
9a2ae03
20b6fac
6b37380
3f16042
1291338
95bce58
f2dc7b7
7e40410
b0cedac
d0a3a68
c5d74ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -36,31 +36,46 @@ import androidx.compose.ui.Modifier | |||||||||
import androidx.compose.ui.tooling.preview.Preview | ||||||||||
import androidx.compose.ui.unit.dp | ||||||||||
import org.sopt.official.designsystem.SoptTheme | ||||||||||
import org.sopt.official.feature.fortune.feature.fortuneDetail.component.PokeRecommendationDashboard | ||||||||||
import org.sopt.official.feature.fortune.feature.fortuneDetail.component.TodayFortuneDashboard | ||||||||||
import org.sopt.official.feature.fortune.feature.fortuneDetail.model.FortuneDetailUiState | ||||||||||
import org.sopt.official.feature.fortune.feature.fortuneDetail.model.FortuneDetailUiState.Error | ||||||||||
import org.sopt.official.feature.fortune.feature.fortuneDetail.model.FortuneDetailUiState.Loading | ||||||||||
import org.sopt.official.feature.fortune.feature.fortuneDetail.model.FortuneDetailUiState.TodaySentence | ||||||||||
import org.sopt.official.feature.fortune.feature.fortuneDetail.model.FortuneDetailUiState.Success | ||||||||||
import org.sopt.official.feature.fortune.feature.fortuneDetail.model.FortuneDetailUiState.Success.TodaySentence | ||||||||||
import org.sopt.official.feature.fortune.feature.fortuneDetail.model.FortuneDetailUiState.Success.UserInfo | ||||||||||
import timber.log.Timber | ||||||||||
|
||||||||||
@Composable | ||||||||||
internal fun FortuneDetailScreen( | ||||||||||
paddingValue: PaddingValues, | ||||||||||
date: String, | ||||||||||
onFortuneAmuletClick: () -> Unit, | ||||||||||
onPokeClick: (userId: Long) -> Unit, | ||||||||||
onProfileClick: (userId: Long) -> Unit, | ||||||||||
modifier: Modifier = Modifier, | ||||||||||
uiState: FortuneDetailUiState = Loading, | ||||||||||
) { | ||||||||||
Column( | ||||||||||
horizontalAlignment = Alignment.CenterHorizontally, | ||||||||||
modifier = modifier.fillMaxSize().padding(paddingValues = paddingValue), | ||||||||||
modifier = modifier | ||||||||||
.fillMaxSize() | ||||||||||
.padding(paddingValues = paddingValue), | ||||||||||
) { | ||||||||||
Spacer(modifier = Modifier.height(height = 16.dp)) | ||||||||||
when (uiState) { | ||||||||||
is TodaySentence -> { | ||||||||||
is Success -> { | ||||||||||
TodayFortuneDashboard( | ||||||||||
date = date, | ||||||||||
todaySentence = uiState.message, | ||||||||||
todaySentence = uiState.todaySentence.message, | ||||||||||
) | ||||||||||
Spacer(modifier = Modifier.height(height = 20.dp)) | ||||||||||
PokeRecommendationDashboard( | ||||||||||
profile = uiState.userInfo.profile, | ||||||||||
name = uiState.userInfo.userName, | ||||||||||
userDescription = uiState.userInfo.userDescription, | ||||||||||
onPokeClick = { onPokeClick(uiState.userInfo.userId) }, | ||||||||||
onProfileClick = { onProfileClick(uiState.userInfo.userId) } | ||||||||||
Comment on lines
+77
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. onPokeClick 함수에서 userId 값을 넘겨준다면 아래처럼 간단하게 쓸 수 있어요.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오호~ 킹치만 호이스팅된 onXXXClick 함수들은 인자로 아무것도 넘겨주지 않아서 아래코드처럼 쓸 수 없습니당! 실제 onPokeClick, onProfileClick 등을 생성자로 받고있는 하위 컴포넌트들은 클릭 시 id를 넘겨줘야함!과 같은 구체적인 구현사항에 의존하지 않고, 호이스팅 된 상위 컴포넌트에서 위처럼 람다를 구현해서 상위로 전달해줍니다. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아 코드를 제가 잘못 이해했었네요. |
||||||||||
) | ||||||||||
} | ||||||||||
|
||||||||||
|
@@ -80,10 +95,21 @@ private fun FortuneDetailScreenPreview() { | |||||||||
paddingValue = PaddingValues(vertical = 16.dp), | ||||||||||
date = "2024-09-09", | ||||||||||
onFortuneAmuletClick = {}, | ||||||||||
uiState = TodaySentence( | ||||||||||
userName = "누누", | ||||||||||
content = "오늘 하루종일 기분 좋을 것 같은 날이네요.", | ||||||||||
uiState = Success( | ||||||||||
todaySentence = TodaySentence( | ||||||||||
userName = "이현우", | ||||||||||
content = "사과해요나한테사과해요나한테사과해요나한테" | ||||||||||
), | ||||||||||
userInfo = UserInfo( | ||||||||||
userId = 0L, | ||||||||||
profile = "", | ||||||||||
userName = "동민", | ||||||||||
generation = 111, | ||||||||||
part = "기획 파트" | ||||||||||
) | ||||||||||
), | ||||||||||
onPokeClick = { }, | ||||||||||
onProfileClick = { }, | ||||||||||
) | ||||||||||
} | ||||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
외부 뷰로 빠지는건가? 우리 WebViewActivity 활용하는 스펙은 아닌거?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 그냥 외부 뷰로 이동한다고 하더라구욥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기존에 콕찌르기에서 저렇게 되어있어서 세훈햄한테 외부 뷰로 빠진다고 이야기했었습니다!
근데 음... 협의만 된다면 WebVIewActivity 쓰는것도 좋을 것 같네용