-
Notifications
You must be signed in to change notification settings - Fork 0
Feature#137 : 마이페이지 디테일 수정 및 이전 활동내역 작업 완료 #138
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
Changes from 5 commits
0bd3130
fcdc77a
1ad9a24
b46a481
c2e7a5a
c50d812
62cb191
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,12 @@ | ||
| package com.yapp.dataapi | ||
|
|
||
| import com.yapp.model.ActivityHistory | ||
| import com.yapp.model.UserInfo | ||
| import kotlinx.coroutines.flow.Flow | ||
|
|
||
| interface UserRepository { | ||
| suspend fun getUserAccessToken() : Flow<String> | ||
| suspend fun deleteAccount() | ||
| suspend fun getUserProfile(): Flow<UserInfo> | ||
| fun getUserActivityHistories(): Flow<ActivityHistory> | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| package com.yapp.core.data.remote.model.response | ||
|
|
||
| import com.yapp.model.ActivityHistory | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class UserActivityHistoryResponse( | ||
| val activityUnits: List<Unit> | ||
| ) { | ||
| @Serializable | ||
| data class Unit( | ||
| val generation: Int, | ||
| val position: String, | ||
| val activityStartDate: String?, | ||
| val activityEndDate: String? | ||
| ) | ||
|
|
||
| fun toModel(): ActivityHistory { | ||
| return ActivityHistory( | ||
| activityUnits = activityUnits.map { | ||
| ActivityHistory.Unit( | ||
| generation = it.generation, | ||
| position = it.position, | ||
| activityStartDate = it.activityStartDate, | ||
| activityEndDate = it.activityEndDate | ||
| ) | ||
| } | ||
| ) | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package com.yapp.model | ||
|
|
||
| data class ActivityHistory( | ||
| val activityUnits: List<Unit> | ||
| ) { | ||
| data class Unit( | ||
| val generation: Int, | ||
| val position: String, | ||
| val activityStartDate: String?, | ||
| val activityEndDate: String? | ||
| ) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,6 @@ data class Sessions( | |
| val progressPhase: String | ||
| ) { | ||
| enum class AttendType { | ||
|
|
||
| OFFLINE, TEAM | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package com.yapp.feature.history | ||
| package com.yapp.feature.history.attend | ||
|
|
||
| import com.yapp.model.Sessions | ||
|
|
||
|
|
||
|
Member
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. R: |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3,20 +3,36 @@ package com.yapp.feature.history.navigation | |||||
| import androidx.navigation.NavController | ||||||
| import androidx.navigation.NavGraphBuilder | ||||||
| import androidx.navigation.compose.composable | ||||||
| import com.yapp.feature.history.AttendHistoryRoute | ||||||
| import com.yapp.feature.history.attend.AttendHistoryRoute | ||||||
| import com.yapp.feature.history.previous.PreviousHistoryRoute | ||||||
| import kotlinx.serialization.Serializable | ||||||
|
|
||||||
| @Serializable | ||||||
| data object AttendanceHistory | ||||||
|
|
||||||
| @Serializable | ||||||
| data object PreviousHistory | ||||||
|
|
||||||
| fun NavController.navigateToAttendance() { | ||||||
| navigate(AttendanceHistory) | ||||||
| } | ||||||
|
|
||||||
| fun NavController.navigateToPreviousHistory() { | ||||||
| navigate(PreviousHistory) | ||||||
| } | ||||||
|
|
||||||
| fun NavGraphBuilder.attendanceHistoryNavGraph( | ||||||
| navigateToBack: () -> Unit | ||||||
| ) { | ||||||
| composable<AttendanceHistory> { | ||||||
| AttendHistoryRoute(navigateToBack = navigateToBack) | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| fun NavGraphBuilder.previousHistoryNavGraph( | ||||||
| navigateToBack: () -> Unit | ||||||
| ) { | ||||||
| composable<PreviousHistory> { | ||||||
| PreviousHistoryRoute(onClickBackButton = navigateToBack) | ||||||
|
||||||
| PreviousHistoryRoute(onClickBackButton = navigateToBack) | |
| PreviousHistoryRoute(navigateToBack = navigateToBack) |
A: 기존 네이밍 컨벤션 맞춰주시면 좋을 것 같아요
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,50 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| package com.yapp.feature.history.previous | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.foundation.Image | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.foundation.background | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.Arrangement | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.Column | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.Row | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.fillMaxWidth | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.padding | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.material3.Text | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.runtime.Composable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.ui.Alignment | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.ui.Modifier | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.ui.res.painterResource | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.ui.tooling.preview.Preview | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.ui.unit.dp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.yapp.core.designsystem.theme.YappTheme | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import com.yapp.core.designsystem.R as coreDesignR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Composable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| internal fun HistoryItems( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| modifier: Modifier = Modifier, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| generation: Int, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| position: String, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| slot: @Composable (() -> Unit)? = null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Column(modifier = modifier.fillMaxWidth()) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Row(horizontalArrangement = Arrangement.spacedBy(12.dp), verticalAlignment = Alignment.CenterVertically) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Text(modifier = Modifier.weight(1f), text = position, style = YappTheme.typography.heading2Bold) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Image(painter = painterResource(coreDesignR.drawable.icon_yapp), contentDescription = null) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Text("${generation}기", style = YappTheme.typography.label1NormalMedium) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| slot?.invoke() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+21
to
+37
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. 🧹 Nitpick (assertive) 히스토리 아이템 컴포넌트 구현 검토 히스토리 항목을 표시하기 위한 컴포넌트가 잘 구현되어 있습니다. 다만 몇 가지 개선할 점이 있습니다:
다음과 같이 개선해 보세요: @Composable
+/**
+ * 활동 이력 항목을 표시하는 컴포넌트
+ *
+ * @param modifier 컴포넌트에 적용할 수정자
+ * @param generation YAPP 기수
+ * @param position 포지션(직책)
+ * @param slot 추가 콘텐츠를 위한 선택적 슬롯
+ */
internal fun HistoryItems(
modifier: Modifier = Modifier,
generation: Int,
position: String,
slot: @Composable (() -> Unit)? = null
) {
Column(modifier = modifier.fillMaxWidth()) {
Row(horizontalArrangement = Arrangement.spacedBy(12.dp), verticalAlignment = Alignment.CenterVertically) {
Text(modifier = Modifier.weight(1f), text = position, style = YappTheme.typography.heading2Bold)
- Image(painter = painterResource(coreDesignR.drawable.icon_yapp), contentDescription = null)
+ Image(painter = painterResource(coreDesignR.drawable.icon_yapp), contentDescription = "YAPP 로고")
Text("${generation}기", style = YappTheme.typography.label1NormalMedium)
}
slot?.invoke()
}
}📝 Committable suggestion
Suggested change
Comment on lines
+21
to
+37
Member
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. R: @Composable
internal fun HistoryItems(
modifier: Modifier = Modifier,
generation: Int,
position: String,
slot: @Composable (() -> Unit)? = null
) {
Column(modifier = modifier.fillMaxWidth()) {
Row(
horizontalArrangement = Arrangement.spacedBy(2.dp),
verticalAlignment = Alignment.CenterVertically
) {
Text(
modifier = Modifier.weight(1f),
text = position,
style = YappTheme.typography.heading2Bold
)
Box(
modifier = Modifier.size(20.dp),
contentAlignment = Alignment.Center
) {
Image(
modifier = Modifier.size(16.dp),
painter = painterResource(coreDesignR.drawable.icon_yapp),
contentDescription = null
)
}
Text(
"${generation}기",
style = YappTheme.typography.label1NormalMedium
)
}
slot?.invoke()
}
}피그마 디자인에 맞춰 아이콘 크기 및 간격이 수정이 필요해보입니다.
Contributor
Author
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. 넵 이거 확인해보니 Column 에도 수직 간격이 달라서 그것도 수정했습니다 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Preview(showBackground = true) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Composable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private fun PreviewHistoryItems() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| HistoryItems( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| modifier = Modifier.background( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color = YappTheme.colorScheme.orange99, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shape = RoundedCornerShape(12.dp) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ).padding(16.dp), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| generation = 20, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| position = "운영진" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package com.yapp.feature.history.previous | ||
|
|
||
| data class PreviousHistoryState( | ||
| val items: List<History> = emptyList() | ||
| ) { | ||
| data class History( | ||
| val generation: Int, | ||
| val position: String, | ||
| val activityStartDate: String?, | ||
| val activityEndDate: String? | ||
| ) | ||
| } | ||
|
|
||
| sealed interface PreviousHistorySideEffect { | ||
| data object Finish : PreviousHistorySideEffect | ||
| } | ||
|
|
||
| sealed interface PreviousHistoryIntent { | ||
| data object OnEntryScreen : PreviousHistoryIntent | ||
| data object OnClickBackButton : PreviousHistoryIntent | ||
|
Comment on lines
+21
to
+22
Member
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. A: 여기도 컨벤션 맞춰주시면 좋을 것 같습니다. |
||
| } | ||
|
|
||
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.
C: 저희 저번에 꼭 필요한 경우에만 Flow를 사용하기로 했던 것 같아요.