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 @@ -16,6 +16,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.hackathon.core.designsystem.theme.Gray400
Expand Down Expand Up @@ -71,7 +72,7 @@ fun BottomNavBar(
) {
Icon(
painter = painterResource(id = tab.icon),
contentDescription = tab.label,
contentDescription = stringResource(tab.label),
tint =
if (isSelected) {
HackathonTheme.colors.black
Expand All @@ -80,7 +81,7 @@ fun BottomNavBar(
}
)
Text(
text = tab.label,
text = stringResource(tab.label),
fontSize = 12.sp,
color =
if (isSelected) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
package com.example.hackathon.presentation.navigation

import com.example.hackathon.core.designsystem.R
import androidx.annotation.StringRes
import com.example.hackathon.R
import com.example.hackathon.core.designsystem.R as DesignSystemR
import com.example.hackathon.presentation.route.Route

enum class NavTab(val route: String, val label: String, val icon: Int) {
Home(Route.Home.route, label = "홈", icon = R.drawable.ic_home),
enum class NavTab(val route: String, @param:StringRes val label: Int, val icon: Int) {
Home(Route.Home.route, label = R.string.nav_home, icon = DesignSystemR.drawable.ic_home),
Create(
route = Route.Create.route,
label = "작성",
icon = R.drawable.ic_add
label = R.string.nav_create,
icon = DesignSystemR.drawable.ic_add
),
My(
route = Route.My.route,
label = "마이",
icon = R.drawable.ic_my
label = R.string.nav_my,
icon = DesignSystemR.drawable.ic_my
)
}
5 changes: 5 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<resources>
<string name="app_name">Hackathon</string>

<!-- 바텀 네비게이션 -->
<string name="nav_home">홈</string>
<string name="nav_create">작성</string>
<string name="nav_my">마이</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ import androidx.compose.ui.graphics.Paint
import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import coil3.compose.AsyncImage
import com.example.hackathon.core.designsystem.R
import com.example.hackathon.core.designsystem.icon.HackathonIcons
import com.example.hackathon.core.designsystem.theme.Gray50
import com.example.hackathon.core.designsystem.theme.Gray700
Expand Down Expand Up @@ -140,7 +142,7 @@ fun CombinationCard(
contentAlignment = Alignment.Center
) {
Text(
text = "이미지 없음",
text = stringResource(R.string.designsystem_no_image),
style = HackathonTheme.typography.Body_medium,
color = Gray700.copy(alpha = 0.5f)
)
Expand Down Expand Up @@ -246,7 +248,7 @@ fun CombinationCard(
} else {
HackathonIcons.FavoriteBorder
},
contentDescription = "좋아요",
contentDescription = stringResource(R.string.designsystem_like),
tint = Primary,
modifier = Modifier.size(18.dp)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@ package com.example.hackathon.core.designsystem.component

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
import com.example.hackathon.core.designsystem.icon.HackathonIcons
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.example.hackathon.core.designsystem.R
import com.example.hackathon.core.designsystem.icon.HackathonIcons

@Composable
fun SearchBar(
query: String,
onQueryChange: (String) -> Unit,
modifier: Modifier = Modifier,
placeholder: String = "검색어를 입력하세요"
placeholder: String = stringResource(R.string.designsystem_search_hint)
) {
OutlinedTextField(
value = query,
Expand All @@ -25,7 +27,7 @@ fun SearchBar(
leadingIcon = {
Icon(
imageVector = HackathonIcons.Search,
contentDescription = "검색"
contentDescription = stringResource(R.string.designsystem_search)
)
},
singleLine = true,
Expand Down
6 changes: 6 additions & 0 deletions core/designsystem/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<resources>
<string name="designsystem_search_hint">검색어를 입력하세요</string>
<string name="designsystem_search">검색</string>
<string name="designsystem_no_image">이미지 없음</string>
<string name="designsystem_like">좋아요</string>
</resources>
Loading