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] 마이페이지 개별 컴포넌트 구현 #43

Merged
merged 3 commits into from
Jul 8, 2024
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
@@ -0,0 +1,23 @@
package org.sopt.dateroad.presentation.type

import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import org.sopt.dateroad.R

enum class MyPageMenuType(
@StringRes val titleRes: Int,
@DrawableRes val iconRes: Int = R.drawable.ic_my_page_arrow
) {
FIRST(
titleRes = R.string.my_page_menu_my_enroll_course
),
SECOND(
titleRes = R.string.my_page_menu_point_guide
),
THIRD(
titleRes = R.string.my_page_menu_question
),
FOURTH(
titleRes = R.string.my_page_menu_logout
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package org.sopt.dateroad.presentation.type

import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import org.sopt.dateroad.R

enum class MyPagePointInfoType(
@StringRes val titleRes: Int,
@StringRes val descriptionRes: Int,
@DrawableRes val imageRes: Int = R.drawable.img_my_page_point_info

) {
FIRST(
titleRes = R.string.point_system_first_title,
descriptionRes = R.string.point_system_first_description
),
SECOND(
titleRes = R.string.point_system_second_title,
descriptionRes = R.string.point_system_second_description
),
THIRD(
titleRes = R.string.point_system_third_title,
descriptionRes = R.string.point_system_third_description
),
FOURTH(
titleRes = R.string.point_system_fourth_title,
descriptionRes = R.string.point_system_fourth_description
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package org.sopt.dateroad.presentation.ui.component.mypage

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.sopt.dateroad.presentation.type.MyPageMenuType
import org.sopt.dateroad.ui.theme.DateRoadTheme

@Composable
fun DateRoadMyPageButton(myPageMenuType: MyPageMenuType, onClick: () -> Unit = {}) {
Row(
modifier = Modifier
.padding(top = 19.dp, bottom = 20.dp)
.fillMaxWidth()
.clickable(onClick = onClick),
verticalAlignment = Alignment.CenterVertically
Copy link
Contributor

Choose a reason for hiding this comment

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

없어도 될 것 같네요

) {
Text(text = stringResource(id = myPageMenuType.titleRes), style = DateRoadTheme.typography.bodySemi15, color = DateRoadTheme.colors.black, modifier = Modifier.weight(1f))
Spacer(modifier = Modifier.width(20.dp))
Icon(painter = painterResource(id = myPageMenuType.iconRes), contentDescription = null)
}
}

@Preview
@Composable
fun DateRoadMyPageButtonPreview() {
val context = LocalContext.current
Column(
modifier = Modifier
.fillMaxSize()
.background(DateRoadTheme.colors.white)
) {
DateRoadMyPageButton(MyPageMenuType.FIRST, onClick = {
})
DateRoadMyPageButton(MyPageMenuType.SECOND, onClick = {
})
DateRoadMyPageButton(MyPageMenuType.THIRD, onClick = {
})
DateRoadMyPageButton(MyPageMenuType.FOURTH, onClick = {
})
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package org.sopt.dateroad.presentation.ui.component.mypage

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.sopt.dateroad.presentation.type.MyPagePointInfoType
import org.sopt.dateroad.ui.theme.DateRoadTheme

@Composable
fun DateRoadMyPagePointInfo(myPagePointInfoType: MyPagePointInfoType) {
Copy link
Contributor

Choose a reason for hiding this comment

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

기기대응 진행해 주세요

Row(
modifier = Modifier
.fillMaxWidth()
.clip(RoundedCornerShape(14.dp))
.background(DateRoadTheme.colors.gray100)
.padding(14.dp),
verticalAlignment = Alignment.CenterVertically // Aligns items vertically centered
) {
Image(painter = painterResource(id = myPagePointInfoType.imageRes), contentDescription = null)
Spacer(modifier = Modifier.width(10.dp))
Column {
Text(
text = stringResource(id = myPagePointInfoType.titleRes),
style = DateRoadTheme.typography.bodyBold15,
modifier = Modifier.fillMaxWidth()
)
Spacer(modifier = Modifier.height(10.dp))
Text(
text = stringResource(id = myPagePointInfoType.descriptionRes),
color = DateRoadTheme.colors.gray500,
style = DateRoadTheme.typography.bodyMed13,
modifier = Modifier.fillMaxWidth()
)
}
}
}

@Preview
@Composable
fun DateRoadMyPagePointInfoPreview() {
Column(
modifier = Modifier
.fillMaxSize()
.background(DateRoadTheme.colors.white)
.padding(horizontal = 16.dp)
) {
DateRoadMyPagePointInfo(myPagePointInfoType = MyPagePointInfoType.FIRST)
Spacer(modifier = Modifier.height(16.dp))
DateRoadMyPagePointInfo(myPagePointInfoType = MyPagePointInfoType.SECOND)
Spacer(modifier = Modifier.height(16.dp))
DateRoadMyPagePointInfo(myPagePointInfoType = MyPagePointInfoType.THIRD)
Spacer(modifier = Modifier.height(16.dp))
DateRoadMyPagePointInfo(myPagePointInfoType = MyPagePointInfoType.FOURTH)
}
}
58 changes: 58 additions & 0 deletions app/src/main/res/drawable/img_my_page_point_info.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="70dp"
android:height="70dp"
android:viewportWidth="70"
android:viewportHeight="70">
<group>
<clip-path
android:pathData="M35,0L35,0A35,35 0,0 1,70 35L70,35A35,35 0,0 1,35 70L35,70A35,35 0,0 1,0 35L0,35A35,35 0,0 1,35 0z"/>
<path
android:pathData="M35,0L35,0A35,35 0,0 1,70 35L70,35A35,35 0,0 1,35 70L35,70A35,35 0,0 1,0 35L0,35A35,35 0,0 1,35 0z"
android:fillColor="#4A3CEF"/>
<path
android:pathData="M-4.872,67.143a45.753,32.257 0,1 0,91.505 0a45.753,32.257 0,1 0,-91.505 0z"
android:fillColor="#F4F8FF"/>
<path
android:pathData="M-2.363,31.14a7.559,9.294 106.879,1 0,17.788 5.397a7.559,9.294 106.879,1 0,-17.788 -5.397z"
android:fillColor="#F4F8FF"/>
<path
android:pathData="M-3.59,29.861a7.559,9.294 129.513,1 0,14.341 11.827a7.559,9.294 129.513,1 0,-14.341 -11.827z"
android:fillColor="#A8A0FF"/>
<path
android:pathData="M-4.872,56.088a45.753,32.257 0,1 0,91.505 0a45.753,32.257 0,1 0,-91.505 0z"
android:fillColor="#F4F8FF"/>
<path
android:pathData="M36.826,46.376C40.478,48.375 47.688,54.134 47.314,61.186C52.915,53.625 58.659,40.078 36.826,46.376Z"
android:fillColor="#6E61FF"/>
<path
android:pathData="M27.114,33.687L21.523,30.514L46.241,25.778L52.234,28.614L27.114,33.687Z"
android:fillColor="#A8A0FF"/>
<path
android:pathData="M46.379,29.792L46.277,25.773L52.174,28.59L46.379,29.792Z"
android:fillColor="#6E61FF"/>
<path
android:pathData="M6.3,51.565a1.097,1.865 0,1 0,2.194 0a1.097,1.865 0,1 0,-2.194 0z"
android:fillColor="#A8A0FF"/>
<path
android:pathData="M13.981,56.503a1.097,1.755 0,1 0,2.194 0a1.097,1.755 0,1 0,-2.194 0z"
android:fillColor="#A8A0FF"/>
<path
android:pathData="M27.792,26.815a10.99,6.524 123.595,1 1,12.134 -18.328a10.99,6.524 123.595,1 1,-12.134 18.328z"
android:fillColor="#C6D968"/>
<path
android:pathData="M39.707,8.364L42.267,10.005L41.902,12.921L38.244,10.369L39.707,8.364Z"
android:fillColor="#C6D968"/>
<path
android:pathData="M28.554,24.223L31.114,25.864L30.017,28.234L27.823,26.775L28.554,24.223Z"
android:fillColor="#C6D968"/>
<path
android:pathData="M30.016,28.272a10.99,6.524 123.595,1 1,12.134 -18.328a10.99,6.524 123.595,1 1,-12.134 18.328z"
android:fillColor="#E5F3AE"/>
<path
android:pathData="M31.284,26.603a8.647,5.133 123.595,1 1,9.547 -14.421a8.647,5.133 123.595,1 1,-9.547 14.421z"
android:fillColor="#DFF37C"/>
<path
android:pathData="M37.593,19.203C38.632,18.767 39.214,18.205 39.214,17.216C39.214,16.239 38.863,15.47 37.857,15.47L35.514,16.343V20.082L37.593,19.203ZM33.784,25.081V15.47L38.148,14.016C40.119,14.016 40.863,15.1 40.863,16.925C40.863,18.762 39.699,20.028 37.646,20.804L35.514,21.702V24.295L33.784,25.081Z"
android:fillColor="#ffffff"/>
</group>
</vector>
17 changes: 17 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@
<string name="money_tag_less_than_50000">5만원 이하</string>
<string name="money_tag_less_than_30000">3만원 이하</string>

<!-- MyPagePointInfo -->
<string name="my_page_point_info_first_title">데이트 코스를 등록하면\n 포인트를 얻을 수 있어요</string>
<string name="my_page_point_info_description">내 데이트를 자랑하고 포인트를 받아보세요</string>
<string name="my_page_point_info_second_title">처음 3번 무료로\n데이트 코스를 열람할 수 있어요</string>
<string name="my_page_point_info_second_description">무료 찬스로 데이트를 열람하세요</string>
<string name="my_page_point_info_third_title">쌓인 포인트로\n다양한 데이트 코스를 둘러보세요</string>
<string name="my_page_point_info_third_description">다른 커플의 데이트, 궁금하지 않으세요?</string>
<string name="my_page_point_info_fourth_title">모인 포인트는 데이트 장소를\n예약할 때 현금처럼 사용 가능해요</string>
<string name="my_page_point_info_fourth_description">추후 만들어질 기능을 기대해주세요</string>

<!-- OnboardingType -->
<string name="onboarding_first_title">데이트로드는 포인트로\n데이트 코스를 열람할 수 있어요.</string>
<string name="onboarding_first_description">최초 3회 찬스로 다른 사람의 데이트 코스를 구경해 보세요</string>
Expand Down Expand Up @@ -157,5 +167,12 @@
<!-- Region Bottom Sheet -->
<string name="region_bottom_sheet_title">지역을 선택해주세요</string>
<string name="region_bottom_sheet_button_text">적용하기</string>

<!-- My Page Menu -->
<string name="my_page_menu_my_enroll_course">내가 등록한 코스</string>
<string name="my_page_menu_point_guide">포인트 제도 소개</string>
<string name="my_page_menu_question">문의하기</string>
<string name="my_page_menu_logout">로그아웃</string>


</resources>
Loading