Skip to content
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

[Feat/#34] 장소 상세 페이지 StoreInfo, StoreInfoItem 구현 #35

Merged
merged 12 commits into from
Jan 16, 2025
Prev Previous commit
Next Next commit
[Feat/#34] StoreInfo 구조 변경 및 StoreInfoItem title strings 추출
Roel4990 committed Jan 15, 2025
commit 6d6b8b6f5143ae1015eed4f724a600355dc21f22
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.PathEffect
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@@ -31,7 +32,11 @@ import kotlinx.collections.immutable.immutableListOf
@Composable
fun StoreInfo(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: 상호명이 빠졌어요!! 인자로 추가해주세요~~

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

구조가 바뀌었습니다! 확인 부탁드려요!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p1) 너무 외부까지 slot으로 뚫은 것 같아요.
내부에서 일부 선언해서 컴포넌트로 사용할 수 있게 해주세요

현재 Preview를 보시면 컴포넌트를 사용하는데 최소 120줄을 사용하고 있어요.
이것은 컴포넌트라고 볼 수 없을 것 같아요

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 수정했습니다!

menuContent: @Composable () -> Unit,
menuPaddingValues: PaddingValues,
menuShape: RoundedCornerShape,
locationContent: @Composable () -> Unit,
locationPaddingValues: PaddingValues,
locationShape: RoundedCornerShape,
modifier: Modifier = Modifier,
isBlurred: Boolean = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p2) isBlurred의 default값이 true인 이유가 있을까요?
서버에서 내려주는 값일텐데 디폴트가 존재하는 이유가 없다고 생각돼요

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

보이다가 안보이는 것보단 안보이다가 서버에서 isBlurred 가 false 라는것이 떴을 때 보이도록하는게 좋아보였습니다.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default값을 없애는 것이 더 좋아보입니다.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정완료했습니다.

) {
@@ -47,35 +52,17 @@ fun StoreInfo(
)
) {
StoreInfoItem(
title = "Menu",
title = stringResource(id = R.string.PLACE_DETAIL_STORE_INFO_MENU_TITLE),
content = menuContent,
padding = PaddingValues(
top = 20.dp,
bottom = 28.dp,
start = 16.dp,
end = 16.dp
),
shape = RoundedCornerShape(
topStart = 8.dp,
topEnd = 8.dp,
bottomStart = 20.dp,
bottomEnd = 20.dp
)
padding = menuPaddingValues,
shape = menuShape
)
HorizontalDashedLine()
StoreInfoItem(
title = "Location",
title = stringResource(id = R.string.PLACE_DETAIL_STORE_INFO_LOCATION_TITLE),
content = locationContent,
padding = PaddingValues(
vertical = 22.dp,
horizontal = 16.dp
),
shape = RoundedCornerShape(
topStart = 20.dp,
topEnd = 20.dp,
bottomStart = 8.dp,
bottomEnd = 8.dp
)
padding = locationPaddingValues,
shape = locationShape
)
}
}
@@ -144,6 +131,18 @@ private fun StoreInfoPreview() {
}
}
},
menuPaddingValues = PaddingValues(
top = 20.dp,
bottom = 28.dp,
start = 16.dp,
end = 16.dp
),
menuShape = RoundedCornerShape(
topStart = 8.dp,
topEnd = 8.dp,
bottomStart = 20.dp,
bottomEnd = 20.dp
),
locationContent = {
Text(
"어키",
@@ -161,7 +160,17 @@ private fun StoreInfoPreview() {
modifier = Modifier.fillMaxWidth()
)
}
}
},
locationPaddingValues = PaddingValues(
vertical = 22.dp,
horizontal = 16.dp
),
locationShape = RoundedCornerShape(
topStart = 20.dp,
topEnd = 20.dp,
bottomStart = 8.dp,
bottomEnd = 8.dp
)
)
StoreInfo(
modifier = Modifier
@@ -184,6 +193,18 @@ private fun StoreInfoPreview() {
}
}
},
menuPaddingValues = PaddingValues(
top = 20.dp,
bottom = 28.dp,
start = 16.dp,
end = 16.dp
),
menuShape = RoundedCornerShape(
topStart = 8.dp,
topEnd = 8.dp,
bottomStart = 20.dp,
bottomEnd = 20.dp
),
locationContent = {
Text(
"어키",
@@ -201,7 +222,17 @@ private fun StoreInfoPreview() {
modifier = Modifier.fillMaxWidth()
)
}
}
},
locationPaddingValues = PaddingValues(
vertical = 22.dp,
horizontal = 16.dp
),
locationShape = RoundedCornerShape(
topStart = 20.dp,
topEnd = 20.dp,
bottomStart = 8.dp,
bottomEnd = 8.dp
)
)
}
}
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<resources>
<string name="app_name">Spoony-Android</string>
<string name="COUNTER_TEXT">%1$s / %2$s</string>
<string name="PLACE_DETAIL_STORE_INFO_MENU_TITLE">Menu</string>
<string name="PLACE_DETAIL_STORE_INFO_LOCATION_TITLE">Location</string>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: string은 snake case로 네이밍합니다!! 이름만 수정해주세요~~!!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정했습니다!

</resources>