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
@@ -1,5 +1,6 @@
package io.github.hangillab.hangil.core.designsystem

import androidx.annotation.StringRes
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -124,14 +125,17 @@ fun ParkedChoice(
}

@Composable
fun ParkedLockedNotice() {
fun ParkedLockedNotice(
@StringRes titleRes: Int = R.string.practice_locked_title,
@StringRes descriptionRes: Int = R.string.practice_locked_description,
) {
ParkedPanel {
Text(
stringResource(R.string.practice_locked_title),
stringResource(titleRes),
style = MaterialTheme.typography.headlineMedium,
fontWeight = FontWeight.SemiBold,
)
Text(stringResource(R.string.practice_locked_description), style = MaterialTheme.typography.bodyLarge)
Text(stringResource(descriptionRes), style = MaterialTheme.typography.bodyLarge)
Text(
stringResource(R.string.practice_locked_saved),
style = MaterialTheme.typography.bodyLarge,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import io.github.hangillab.hangil.core.designsystem.ParkedDisclosure
import io.github.hangillab.hangil.core.designsystem.ParkedLockedNotice
import io.github.hangillab.hangil.core.designsystem.ParkedPage
import io.github.hangillab.hangil.core.designsystem.ParkedPanel
import io.github.hangillab.hangil.core.domain.ConnectionState
import io.github.hangillab.hangil.core.domain.LocationRecordingState
import io.github.hangillab.hangil.core.domain.PracticeSession
import io.github.hangillab.hangil.core.domain.Preparation
Expand Down Expand Up @@ -191,7 +192,14 @@ internal fun HomeScreen(
Modifier.testTag("home_locked_title"),
style = MaterialTheme.typography.titleLarge,
)
ParkedLockedNotice()
if (state.vehicle.connection == ConnectionState.PERMISSION_DENIED) {
ParkedLockedNotice(
titleRes = R.string.home_vehicle_permission_locked_title,
descriptionRes = R.string.home_vehicle_permission_locked_description,
)
} else {
ParkedLockedNotice()
}
} else {
HomeHeader()
HomeDashboard(first = sessionContent, second = {
Expand Down
2 changes: 2 additions & 0 deletions feature/home/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<resources>
<string name="map_preview">시연 지도 보기</string>
<string name="home_title">한길졸업</string>
<string name="home_vehicle_permission_locked_title">차량 상태를 확인할 수 없어요</string>
<string name="home_vehicle_permission_locked_description">차량 정보를 읽을 권한이 없어 준비와 복습을 잠갔어요.</string>
<string name="home_tagline">내가 매일 가야 하는 길 하나부터, 내 힘으로.</string>
<string name="home_intro">출발 전 준비부터 주차 후 복습까지, 생활 경로 하나를 익히는 연습을 준비하고 있어요.</string>
<string name="connection_vehicle">차량 연결</string>
Expand Down
Loading