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] 코스 신고하기 웹 뷰 연결 #189

Merged
merged 12 commits into from
Aug 27, 2024
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ enum class TwoButtonDialogWithDescriptionType(
confirmButtonTextRes = R.string.dialog_delete,
dismissButtonTextRes = R.string.dialog_cancel
),
DELETE_COURSE(
titleRes = R.string.two_button_dialog_with_description_delete_course_title,
descriptionRes = R.string.two_button_dialog_with_description_delete_course_description,
confirmButtonTextRes = R.string.dialog_delete,
dismissButtonTextRes = R.string.dialog_cancel
),
DELETE_PAST(
titleRes = R.string.two_button_dialog_with_description_delete_past_title,
descriptionRes = R.string.dialog_delete_schedule,
Expand All @@ -44,5 +50,11 @@ enum class TwoButtonDialogWithDescriptionType(
descriptionRes = R.string.two_button_dialog_with_description_withdrawal_description,
confirmButtonTextRes = R.string.dialog_cancel,
dismissButtonTextRes = R.string.withdrawal
),
REPORT_COURSE(
titleRes = R.string.two_button_dialog_with_description_report_course_title,
descriptionRes = R.string.two_button_dialog_with_description_report_course_description,
confirmButtonTextRes = R.string.dialog_report,
dismissButtonTextRes = R.string.dialog_cancel
Comment on lines +54 to +58
Copy link
Contributor

Choose a reason for hiding this comment

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

이 다이얼로그 다른 두 줄 + 버튼 2개짜리 다이얼로그랑 title이랑 description 사이 간격이 다른데 디자인 측에 확인해봐야할 것 같아요!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

이건 만나서 말씀드릴게 있읍니다!

)
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@ import org.sopt.dateroad.presentation.util.view.LoadState
class CourseDetailContract {
data class CourseDetailUiState(
val loadState: LoadState = LoadState.Idle,
val isEditBottomSheetOpen: Boolean = false,
val isDeleteCourseBottomSheetOpen: Boolean = false,
val isRegionBottomSheetOpen: Boolean = false,
val isReportCourseBottomSheetOpen: Boolean = false,
val isPointReadDialogOpen: Boolean = false,
val isPointLackDialogOpen: Boolean = false,
val isFreeReadDialogOpen: Boolean = false,
val isDeleteCourseDialogOpen: Boolean = false,
val isReportCourseDialogOpen: Boolean = false,
val isLikedButtonChecked: Boolean = false,
val courseDetail: CourseDetail = CourseDetail(),
val currentImagePage: Int = 0,
val deleteLoadState: LoadState = LoadState.Idle,
val usePointLoadState: LoadState = LoadState.Idle
val usePointLoadState: LoadState = LoadState.Idle,
var isWebViewOpened: Boolean = false
) : UiState

sealed interface CourseDetailSideEffect : UiSideEffect {
Expand All @@ -35,13 +39,21 @@ class CourseDetailContract {
data object DismissDialogLookedForFree : CourseDetailEvent()
data object OnDialogPointLack : CourseDetailEvent()
data object DismissDialogPointLack : CourseDetailEvent()
data object OnEditBottomSheet : CourseDetailEvent()
data object DismissEditBottomSheet : CourseDetailEvent()
data object OnDialogDeleteCourse : CourseDetailEvent()
data object DismissDialogDeleteCourse : CourseDetailEvent()
data object OnDialogReportCourse : CourseDetailEvent()
data object DismissDialogReportCourse : CourseDetailEvent()
data object OnDeleteCourseBottomSheet : CourseDetailEvent()
data object DismissDeleteCourseBottomSheet : CourseDetailEvent()
data object OnReportCourseBottomSheet : CourseDetailEvent()
data object DismissReportCourseBottomSheet : CourseDetailEvent()
data object OpenCourse : CourseDetailEvent()
data class FetchCourseDetail(val loadState: LoadState, val courseDetail: CourseDetail) : CourseDetailEvent()
data class PostUsePoint(val usePointLoadState: LoadState) : CourseDetailEvent()
data class DeleteCourseLike(val courseDetail: CourseDetail) : CourseDetailEvent()
data class PostCourseLike(val courseDetail: CourseDetail) : CourseDetailEvent()
data class DeleteCourse(val loadState: LoadState, val deleteLoadState: LoadState) : CourseDetailEvent()
data object OnReportWebViewClicked : CourseDetailEvent()
data object DismissReportWebView : CourseDetailEvent()
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,25 @@ class CourseDetailViewModel @Inject constructor(
is CourseDetailContract.CourseDetailEvent.DismissDialogPointLack -> setState { copy(isPointLackDialogOpen = false) }
is CourseDetailContract.CourseDetailEvent.OnDialogLookedForFree -> setState { copy(isFreeReadDialogOpen = true) }
is CourseDetailContract.CourseDetailEvent.DismissDialogLookedForFree -> setState { copy(isFreeReadDialogOpen = false) }
is CourseDetailContract.CourseDetailEvent.OnDialogDeleteCourse -> setState { copy(isDeleteCourseDialogOpen = true) }
is CourseDetailContract.CourseDetailEvent.DismissDialogDeleteCourse -> setState { copy(isDeleteCourseDialogOpen = false) }
is CourseDetailContract.CourseDetailEvent.OnDialogReportCourse -> setState { copy(isReportCourseDialogOpen = true) }
is CourseDetailContract.CourseDetailEvent.DismissDialogReportCourse -> setState { copy(isReportCourseDialogOpen = false) }
is CourseDetailContract.CourseDetailEvent.OnDialogLookedByPoint -> setState { copy(isPointReadDialogOpen = true) }
is CourseDetailContract.CourseDetailEvent.DismissDialogLookedByPoint -> setState { copy(isPointReadDialogOpen = false) }
is CourseDetailContract.CourseDetailEvent.OnLikeButtonClicked -> setState { copy(isLikedButtonChecked = !isLikedButtonChecked) }
is CourseDetailContract.CourseDetailEvent.OnEditBottomSheet -> setState { copy(isEditBottomSheetOpen = true) }
is CourseDetailContract.CourseDetailEvent.DismissEditBottomSheet -> setState { copy(isEditBottomSheetOpen = false) }
is CourseDetailContract.CourseDetailEvent.OnDeleteCourseBottomSheet -> setState { copy(isDeleteCourseBottomSheetOpen = true) }
is CourseDetailContract.CourseDetailEvent.DismissDeleteCourseBottomSheet -> setState { copy(isDeleteCourseBottomSheetOpen = false) }
is CourseDetailContract.CourseDetailEvent.OnReportCourseBottomSheet -> setState { copy(isReportCourseBottomSheetOpen = true) }
is CourseDetailContract.CourseDetailEvent.DismissReportCourseBottomSheet -> setState { copy(isReportCourseBottomSheetOpen = false) }
is CourseDetailContract.CourseDetailEvent.OpenCourse -> setState { copy(courseDetail = courseDetail.copy(isAccess = true)) }
is CourseDetailContract.CourseDetailEvent.FetchCourseDetail -> setState { copy(loadState = event.loadState, courseDetail = event.courseDetail) }
is CourseDetailContract.CourseDetailEvent.DeleteCourseLike -> setState { copy(courseDetail = event.courseDetail) }
is CourseDetailContract.CourseDetailEvent.PostCourseLike -> setState { copy(courseDetail = event.courseDetail) }
is CourseDetailContract.CourseDetailEvent.DeleteCourse -> setState { copy(loadState = event.loadState, deleteLoadState = event.deleteLoadState) }
is CourseDetailContract.CourseDetailEvent.PostUsePoint -> setState { copy(usePointLoadState = usePointLoadState) }
is CourseDetailContract.CourseDetailEvent.OnReportWebViewClicked -> setState { copy(isWebViewOpened = true) }
is CourseDetailContract.CourseDetailEvent.DismissReportWebView -> setState { copy(isWebViewOpened = false) }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import org.sopt.dateroad.presentation.ui.component.view.DateRoadLoadingView
import org.sopt.dateroad.presentation.ui.component.view.DateRoadWebView
import org.sopt.dateroad.presentation.ui.mypage.component.MyPageButton
import org.sopt.dateroad.presentation.ui.mypage.component.MyPagePointBox
import org.sopt.dateroad.presentation.util.CourseDetail.ASK_URL
import org.sopt.dateroad.presentation.util.WebViewUrl.ASK_URL
import org.sopt.dateroad.presentation.util.modifier.noRippleClickable
import org.sopt.dateroad.presentation.util.view.LoadState
import org.sopt.dateroad.ui.theme.DATEROADTheme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.sopt.dateroad.domain.model.SignIn
import org.sopt.dateroad.presentation.ui.component.button.DateRoadKakaoLoginButton
import org.sopt.dateroad.presentation.ui.component.view.DateRoadLoadingView
import org.sopt.dateroad.presentation.ui.component.view.DateRoadWebView
import org.sopt.dateroad.presentation.util.CourseDetail.PRIVACY_POLICY_URL
import org.sopt.dateroad.presentation.util.WebViewUrl.PRIVACY_POLICY_URL
import org.sopt.dateroad.presentation.util.modifier.noRippleClickable
import org.sopt.dateroad.presentation.util.view.LoadState
import org.sopt.dateroad.ui.theme.DateRoadTheme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ object DatePicker {
const val DATE_PATTERN = "yyyy.MM.dd"
}

object CourseDetail {
object WebViewUrl {
const val PRIVACY_POLICY_URL = "https://www.notion.so/hooooooni/04da4aa279ca4b599193784091a52859"
const val REPORT_URL = "https://tally.so/r/w4L1a5"
t1nm1ksun marked this conversation as resolved.
Show resolved Hide resolved
const val ASK_URL = "https://dateroad.notion.site/1055d2f7bfe94b3fa6c03709448def21?pvs=4"
}

Expand Down
9 changes: 8 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<string name="dialog_check">확인</string>
<string name="dialog_checked">확인했어요</string>
<string name="dialog_delete">삭제</string>
<string name="dialog_report">신고</string>
<string name="dialog_delete_schedule">삭제된 일정은 복구하실 수 없어요</string>

<!-- AdvertisementTitleType -->
Expand Down Expand Up @@ -167,9 +168,14 @@
<string name="two_button_dialog_with_description_free_read_title">무료 열람 기회를 사용해 보시겠어요?</string>
<string name="two_button_dialog_with_description_free_read_description">무료 열람 기회는 한 번 사용하면 취소할 수 없어요</string>
<string name="two_button_dialog_with_description_delete_timeline_title">데이트 일정을 삭제하시겠어요?</string>
<string name="two_button_dialog_with_description_delete_course_title">데이트 코스를 삭제하시겠어요?</string>
<string name="two_button_dialog_with_description_report_course_title">데이트 코스를 신고하시겠어요?</string>
<string name="two_button_dialog_with_description_delete_past_title">지난 데이트를 삭제하시겠어요?</string>
<string name="two_button_dialog_with_description_withdrawal_title">정말로 탈퇴하시겠어요?</string>
<string name="two_button_dialog_with_description_withdrawal_description">삭제된 계정은 복구하실 수 없어요</string>
<string name="two_button_dialog_with_description_delete_course_description">삭제된 코스는 복구하실 수 없어요</string>
<string name="two_button_dialog_with_description_report_course_description">신고된 게시물은 확인 후 서비스의 운영원칙에\n따라 조치 예정이에요</string>


<!-- Top Bar Title -->
<string name="top_bar_title_point_history">포인트 내역</string>
Expand Down Expand Up @@ -228,7 +234,8 @@
<string name="course_detail_tag">태그</string>
<string name="course_detail_bottom_sheet_title">데이트 코스 설정</string>
<string name="course_detail_bottom_sheet_confirm">글 삭제</string>
<string name="course_detail_bottom_sheet_delete">취소</string>
<string name="course_detail_bottom_sheet_delete">닫기</string>
<string name="course_detail_bottom_sheet_report">신고하기</string>

<!-- DateSchedule -->
<string name="home_timeline_is_not">다가오는 데이트 일정이 없어요</string>
Expand Down
Loading