Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ fun RecordWeekendReportScreen(
onBottomNavTabSelected: (BottomNavItem) -> Unit = {},
mindRecordViewModel: MindRecordViewModel = hiltViewModel()
) {

val weekState = mindRecordViewModel.totalSummary.collectAsStateWithLifecycle()
val dailyState = mindRecordViewModel.dailyQuestionSummary.collectAsStateWithLifecycle()
val afternoteState = mindRecordViewModel.afternoteSummary.collectAsStateWithLifecycle()
Expand Down Expand Up @@ -99,36 +98,6 @@ fun RecordWeekendReportScreen(
onBottomNavTabSelected(item)
}
)
},
floatingActionButton = {
FloatingActionButton(
onClick = { },
modifier = Modifier.size(56.dp),
containerColor = Color.Transparent,
contentColor = Color.White,
shape = CircleShape
) {
Box(
modifier = Modifier
.fillMaxSize()
.clip(CircleShape)
.background(
brush = Brush.linearGradient(
colors = listOf(
Color(0xFFBDE0FF), // B3
Color(0xFFFFE1CC) // 주황색 계열
)
)
),
contentAlignment = Alignment.Center
) {
Icon(
imageVector = Icons.Default.Add,
contentDescription = "새 애프터노트 추가",
modifier = Modifier.size(24.dp)
)
}
}
}
) { paddingValues ->
LazyColumn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.compose.ui.unit.sp
import com.kuit.afternote.R
import com.kuit.afternote.ui.theme.AfternoteTheme
import com.kuit.afternote.ui.theme.B3
import com.kuit.afternote.ui.theme.Gray2
import com.kuit.afternote.ui.theme.Gray9
import com.kuit.afternote.ui.theme.Sansneo

Expand All @@ -33,7 +34,7 @@ fun RecipientBadge(
Surface(
modifier = modifier,
shape = RoundedCornerShape(20.dp),
color = B3,
color = if (showCheckIcon) B3 else Gray2,
onClick = onCLick
) {
Row(
Expand All @@ -48,15 +49,31 @@ fun RecipientBadge(
modifier = Modifier.size(12.dp),
tint = androidx.compose.ui.graphics.Color.Unspecified
)
Text(
text = text,
fontFamily = Sansneo,
fontWeight = FontWeight.Medium,
fontSize = 12.sp,
lineHeight = 18.sp,
color = Gray9
)
}
else {
Icon(
painter = painterResource(R.drawable.unchecked),
contentDescription = null,
modifier = Modifier.size(12.dp),
tint = androidx.compose.ui.graphics.Color.Unspecified
)
Text(
text = "수신인 지정 미완료",
fontFamily = Sansneo,
fontWeight = FontWeight.Medium,
fontSize = 12.sp,
lineHeight = 18.sp,
color = Gray9
)
}
Text(
text = text,
fontFamily = Sansneo,
fontWeight = FontWeight.Medium,
fontSize = 12.sp,
lineHeight = 18.sp,
color = Gray9
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import com.kuit.afternote.feature.home.presentation.component.WeeklyCalendarStri
import com.kuit.afternote.feature.user.presentation.uimodel.ProfileUiState
import com.kuit.afternote.feature.user.presentation.viewmodel.ProfileEditViewModelContract
import com.kuit.afternote.feature.user.presentation.viewmodel.ProfileViewModel
import com.kuit.afternote.feature.user.presentation.viewmodel.ReceiverListViewModel
import com.kuit.afternote.ui.theme.AfternoteTheme
import com.kuit.afternote.ui.theme.Gray1
import com.kuit.afternote.ui.theme.Gray5
Expand Down Expand Up @@ -75,21 +76,26 @@ fun HomeScreen(
modifier: Modifier = Modifier,
event: HomeScreenEvent = EmptyHomeScreenEvent,
profileViewModel: ProfileEditViewModelContract = hiltViewModel<ProfileViewModel>(),
recordViewModel: MindRecordHomeContract = hiltViewModel<MindRecordViewModel>()
recordViewModel: MindRecordHomeContract = hiltViewModel<MindRecordViewModel>(),
mindRecordViewModel: MindRecordViewModel = hiltViewModel(),
receiverListViewModel: ReceiverListViewModel = hiltViewModel()
) {
var content by remember { mutableStateOf(HomeScreenContent()) }
val uiState = profileViewModel.uiState.collectAsStateWithLifecycle()
val recordUiState = recordViewModel.calendarDays.collectAsStateWithLifecycle()
val receiverState = receiverListViewModel.uiState.collectAsStateWithLifecycle()

val dailyState = mindRecordViewModel.uiState.collectAsStateWithLifecycle()
LaunchedEffect(Unit) {
profileViewModel.loadProfile()
recordViewModel.loadRecordsForDiaryList()


mindRecordViewModel.loadDailyQuestion()
receiverListViewModel.loadReceivers()
content = content.copy(
userName = uiState.value.name,
dailyQuestionDate = LocalDate.now().format(DateTimeFormatter.ofPattern("M월 d일", Locale.KOREAN)),
calendarDays = recordUiState.value
calendarDays = recordUiState.value,
dailyQuestion = dailyState.value.dailyQuestionText ?: "오늘 하루,\n누구에게 가장 고마웠나요?"
)
}

Expand Down Expand Up @@ -121,7 +127,8 @@ fun HomeScreen(

// Recipient badge
RecipientBadge(
modifier = Modifier.padding(horizontal = 20.dp)
modifier = Modifier.padding(horizontal = 20.dp),
showCheckIcon = !receiverState.value.receivers.isEmpty()
)

Spacer(modifier = Modifier.height(20.dp))
Expand Down
Binary file added app/src/main/res/drawable/unchecked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading