Skip to content

Commit cb56353

Browse files
committed
Merge remote-tracking branch 'origin/develop' into release
2 parents 9d1a5d9 + 9625881 commit cb56353

29 files changed

Lines changed: 592 additions & 167 deletions

File tree

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
package com.yapp.ndgl.core.ui
2+
3+
import androidx.compose.foundation.Image
4+
import androidx.compose.foundation.layout.Arrangement
5+
import androidx.compose.foundation.layout.Column
6+
import androidx.compose.foundation.layout.fillMaxWidth
7+
import androidx.compose.foundation.layout.padding
8+
import androidx.compose.foundation.layout.size
9+
import androidx.compose.material3.Text
10+
import androidx.compose.runtime.Composable
11+
import androidx.compose.ui.Alignment
12+
import androidx.compose.ui.Modifier
13+
import androidx.compose.ui.res.painterResource
14+
import androidx.compose.ui.res.stringResource
15+
import androidx.compose.ui.text.style.TextAlign
16+
import androidx.compose.ui.tooling.preview.Preview
17+
import androidx.compose.ui.unit.dp
18+
import com.yapp.ndgl.core.ui.theme.NDGLTheme
19+
20+
@Composable
21+
fun CommonErrorView(
22+
modifier: Modifier = Modifier,
23+
title: String? = null,
24+
description: String? = null,
25+
) {
26+
Column(
27+
modifier = modifier
28+
.fillMaxWidth()
29+
.padding(horizontal = 24.dp, vertical = 165.dp),
30+
verticalArrangement = Arrangement.spacedBy(16.dp),
31+
horizontalAlignment = Alignment.CenterHorizontally,
32+
) {
33+
Image(
34+
painter = painterResource(R.drawable.img_empty_browser),
35+
contentDescription = null,
36+
modifier = Modifier.size(100.dp),
37+
)
38+
Column(
39+
modifier = Modifier.fillMaxWidth(),
40+
verticalArrangement = Arrangement.spacedBy(4.dp),
41+
horizontalAlignment = Alignment.CenterHorizontally,
42+
) {
43+
Text(
44+
text = title ?: stringResource(R.string.common_error_title),
45+
color = NDGLTheme.colors.black500,
46+
textAlign = TextAlign.Center,
47+
style = NDGLTheme.typography.subtitleMdSemiBold,
48+
)
49+
Text(
50+
text = description ?: stringResource(R.string.common_error_description),
51+
color = NDGLTheme.colors.black400,
52+
textAlign = TextAlign.Center,
53+
style = NDGLTheme.typography.bodyLgRegular,
54+
)
55+
}
56+
}
57+
}
58+
59+
@Preview(showBackground = true)
60+
@Composable
61+
private fun CommonErrorViewPreview() {
62+
NDGLTheme {
63+
CommonErrorView(
64+
modifier = Modifier,
65+
)
66+
}
67+
}

core/ui/src/main/java/com/yapp/ndgl/core/ui/designsystem/NDGLChipTab.kt

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import androidx.annotation.DrawableRes
44
import androidx.compose.foundation.background
55
import androidx.compose.foundation.border
66
import androidx.compose.foundation.clickable
7-
import androidx.compose.foundation.horizontalScroll
87
import androidx.compose.foundation.layout.Arrangement
8+
import androidx.compose.foundation.layout.PaddingValues
99
import androidx.compose.foundation.layout.Row
1010
import androidx.compose.foundation.layout.padding
1111
import androidx.compose.foundation.layout.size
1212
import androidx.compose.foundation.layout.widthIn
13-
import androidx.compose.foundation.rememberScrollState
13+
import androidx.compose.foundation.lazy.LazyRow
14+
import androidx.compose.foundation.lazy.itemsIndexed
1415
import androidx.compose.foundation.shape.CircleShape
1516
import androidx.compose.material3.Icon
1617
import androidx.compose.material3.Text
@@ -45,14 +46,17 @@ fun NDGLChipTab(
4546
selectedIndex: Int,
4647
onTabSelected: (Int) -> Unit,
4748
modifier: Modifier = Modifier,
49+
contentPadding: PaddingValues = PaddingValues(0.dp),
4850
) {
49-
val scrollState = rememberScrollState()
50-
51-
Row(
52-
modifier = modifier.horizontalScroll(scrollState),
51+
LazyRow(
52+
modifier = modifier,
5353
horizontalArrangement = Arrangement.spacedBy(8.dp),
54+
contentPadding = contentPadding,
5455
) {
55-
tabs.forEachIndexed { index, tab ->
56+
itemsIndexed(
57+
items = tabs,
58+
key = { index, tab -> "${index}_${tab.tag}" },
59+
) { index, tab ->
5660
NDGLChipTabItem(
5761
isSelected = index == selectedIndex,
5862
name = tab.name,
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
6+
<path
7+
android:pathData="M6.53,16.47C6.388,16.337 6.2,16.265 6.005,16.269C5.811,16.272 5.626,16.351 5.488,16.488C5.351,16.626 5.272,16.811 5.269,17.005C5.265,17.2 5.337,17.388 5.47,17.53L7.47,19.53C7.61,19.67 7.801,19.749 8,19.749C8.199,19.749 8.389,19.67 8.53,19.53L10.53,17.53C10.604,17.461 10.663,17.378 10.704,17.287C10.745,17.194 10.767,17.095 10.768,16.994C10.77,16.894 10.752,16.794 10.714,16.7C10.676,16.607 10.62,16.522 10.549,16.451C10.478,16.38 10.393,16.323 10.299,16.286C10.206,16.248 10.106,16.23 10.005,16.231C9.905,16.233 9.805,16.255 9.713,16.296C9.621,16.337 9.539,16.396 9.47,16.47L8.75,17.19V7C8.75,6.801 8.671,6.61 8.53,6.47C8.39,6.329 8.199,6.25 8,6.25C7.801,6.25 7.61,6.329 7.47,6.47C7.329,6.61 7.25,6.801 7.25,7V17.19L6.53,16.47ZM13.47,7.53C13.611,7.67 13.801,7.749 14,7.749C14.199,7.749 14.389,7.67 14.53,7.53L15.25,6.81V17C15.25,17.199 15.329,17.39 15.469,17.53C15.61,17.671 15.801,17.75 16,17.75C16.199,17.75 16.389,17.671 16.53,17.53C16.671,17.39 16.75,17.199 16.75,17V6.81L17.47,7.53C17.538,7.604 17.621,7.663 17.713,7.704C17.805,7.745 17.905,7.767 18.005,7.769C18.106,7.77 18.206,7.752 18.299,7.714C18.393,7.676 18.478,7.62 18.549,7.549C18.62,7.478 18.676,7.393 18.714,7.3C18.752,7.206 18.77,7.106 18.768,7.005C18.767,6.905 18.745,6.805 18.704,6.713C18.663,6.621 18.604,6.539 18.53,6.47L16.53,4.47C16.389,4.329 16.199,4.251 16,4.251C15.801,4.251 15.611,4.329 15.47,4.47L13.47,6.47C13.329,6.611 13.25,6.801 13.25,7C13.25,7.199 13.329,7.389 13.47,7.53Z"
8+
android:fillColor="#000000"/>
9+
</vector>

core/ui/src/main/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
<string name="common_dot_separator">•</string>
1616
<string name="common_retry">다시 시도</string>
1717
<string name="common_all">전체</string>
18+
<string name="common_err_unknown">알 수 없는 오류입니다</string>
19+
<string name="common_error_title">정보를 불러올 수 없어요</string>
20+
<string name="common_error_description">인터넷 연결 확인 후 다시 시도해 주세요</string>
1821

1922
<!-- User Guide Modal -->
2023
<string name="user_guide_modal_title">서비스 이용 전\n반드시 확인해주세요.</string>

data/auth/src/main/java/com/yapp/ndgl/data/auth/local/LocalAuthDataSource.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,28 @@ class LocalAuthDataSource @Inject constructor(
4545
}
4646
}
4747

48+
suspend fun getNickname(): String = dataStore.data
49+
.handleException()
50+
.map { preferences -> preferences[NICKNAME_KEY] ?: "" }
51+
.first()
52+
53+
suspend fun setNickname(nickname: String) {
54+
dataStore.edit { preferences ->
55+
preferences[NICKNAME_KEY] = nickname
56+
}
57+
}
58+
4859
suspend fun clearSession() {
4960
dataStore.edit { preferences ->
5061
preferences.remove(ACCESS_TOKEN_KEY)
5162
preferences.remove(UUID_KEY)
63+
preferences.remove(NICKNAME_KEY)
5264
}
5365
}
5466

5567
private companion object {
5668
private val ACCESS_TOKEN_KEY = stringPreferencesKey("access_token")
5769
private val UUID_KEY = stringPreferencesKey("uuid")
70+
private val NICKNAME_KEY = stringPreferencesKey("nickname")
5871
}
5972
}

data/auth/src/main/java/com/yapp/ndgl/data/auth/repository/AuthRepository.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class AuthRepository @Inject constructor(
3939

4040
localAuthDataSource.setAccessToken(response.accessToken)
4141
localAuthDataSource.setUuid(response.uuid)
42+
localAuthDataSource.setNickname(response.nickname)
4243
return isFirstUser
4344
}
4445

@@ -66,5 +67,7 @@ class AuthRepository @Inject constructor(
6667
}
6768
}
6869

70+
suspend fun getNickname(): String = localAuthDataSource.getNickname()
71+
6972
suspend fun getIdentifierCode(): String = localAuthDataSource.getUuid()
7073
}

data/travel/src/main/java/com/yapp/ndgl/data/travel/model/TravelTemplateSummary.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ data class TravelTemplateSummary(
77
val id: Long,
88
val title: String,
99
val country: String,
10+
val countryName: String,
1011
val city: String,
1112
val nights: Int,
1213
val days: Int,

data/travel/src/main/java/com/yapp/ndgl/data/travel/repository/TravelTemplateRepository.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ import javax.inject.Singleton
1818
class TravelTemplateRepository @Inject constructor(
1919
private val travelTemplateApi: TravelTemplateApi,
2020
) {
21-
suspend fun getAllPopularTravelTemplates(): PopularTravelTemplates {
22-
return travelTemplateApi.getPopularTravelTemplates().getData()
21+
suspend fun getAllPopularTravelTemplates(page: Int = 0): PopularTravelTemplates {
22+
return travelTemplateApi.getPopularTravelTemplates(page = page).getData()
2323
}
2424

25-
suspend fun getPopularTravelTemplates(travelProgramId: Long): PopularTravelTemplates {
25+
suspend fun getPopularTravelTemplates(travelProgramId: Long, page: Int = 0): PopularTravelTemplates {
2626
return travelTemplateApi.getPopularTravelTemplates(
2727
travelProgramId = travelProgramId,
28+
page = page,
2829
).getData()
2930
}
3031

feature/home/src/main/java/com/yapp/ndgl/feature/home/component/TravelTemplate.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ internal fun TravelTemplate(
6161
style = NDGLTheme.typography.bodyLgMedium,
6262
)
6363
Text(
64-
text = travel.country,
64+
text = travel.countryName,
6565
color = NDGLTheme.colors.black400,
6666
style = NDGLTheme.typography.bodyMdMedium,
6767
)

feature/home/src/main/java/com/yapp/ndgl/feature/home/main/HomeScreen.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ private fun HomeScreenPreview() {
166166
travelId = 1,
167167
title = "곽준빈의 신혼여행",
168168
country = "FR",
169+
countryName = "프랑스",
169170
city = "파리",
170171
nights = 7,
171172
days = 9,
@@ -177,6 +178,7 @@ private fun HomeScreenPreview() {
177178
travelId = 2,
178179
title = "스위스 여행",
179180
country = "CH",
181+
countryName = "스위스",
180182
city = "스위스",
181183
nights = 5,
182184
days = 6,
@@ -188,6 +190,7 @@ private fun HomeScreenPreview() {
188190
travelId = 3,
189191
title = "충격적인 북유럽 물가",
190192
country = "DK",
193+
countryName = "덴마크",
191194
city = "덴마크",
192195
nights = 4,
193196
days = 6,

0 commit comments

Comments
 (0)