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
327 changes: 193 additions & 134 deletions app/src/main/java/com/paw/key/core/designsystem/component/CourseDetail.kt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package com.paw.key.core.designsystem.component

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
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.size
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Close
import androidx.compose.material3.Icon
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage

import androidx.compose.ui.window.Dialog
import coil.request.ImageRequest
import com.paw.key.core.designsystem.theme.PawKeyTheme

@Composable
fun ImageModal(
imageUrl: String,
onDismiss: () -> Unit
) {
Dialog(onDismissRequest = onDismiss) {
Column(
modifier = Modifier
.padding(16.dp)
.size(width = 328.dp, height = 228.dp)
.wrapContentSize(),
horizontalAlignment = Alignment.End
) {
Icon(
imageVector = Icons.Default.Close,
Copy link
Member

Choose a reason for hiding this comment

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

?

contentDescription = "닫기",
tint = Color.White,
modifier = Modifier
.align(Alignment.End)
.clickable { onDismiss() }
.padding(bottom = 8.dp)
.size(24.dp)
)
AsyncImage(
model = ImageRequest.Builder(LocalContext.current)
.data("https://pawkey-server.com/image.jpg") // ← 서버에서 받은 이미지 URL 넣깅
.crossfade(true)
.build(),
contentDescription = null,
Copy link
Member

Choose a reason for hiding this comment

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

null 금지

Copy link
Member

Choose a reason for hiding this comment

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

contentdesription 은 null로 하지 말아주잉

modifier = Modifier
)
}
}
}

@Preview(showBackground = true)
@Composable
fun ImageModalPreview() {
Copy link
Member

Choose a reason for hiding this comment

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

private

PawKeyTheme {
ImageModal(
imageUrl = "https://pawkey-server.com/image.jpg",
onDismiss = {}
)
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
package com.paw.key.presentation.ui.mypage

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.SnackbarHostState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.paw.key.core.designsystem.component.CourseDetail
import com.paw.key.core.designsystem.component.ImageModal
import com.paw.key.core.designsystem.component.PawkeyButton
import com.paw.key.core.designsystem.theme.PawKeyTheme
import com.paw.key.presentation.ui.mypage.ArchivedCourseDetailScreen
import com.paw.key.core.designsystem.theme.White1

@Composable
fun ArchivedDetailRoute(
Expand All @@ -25,34 +32,49 @@ fun ArchivedDetailRoute(
modifier = modifier
)
}

@Composable
fun ArchivedCourseDetailScreen(
navigateUp: () -> Unit,
modifier: Modifier = Modifier
){
Column(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp)
.verticalScroll(rememberScrollState())
) {
CourseDetail(
title = "한강 산책로",
petName = "후추",
date = "2025/06/02",
location = "뚝섬유원지",
distance = "4.5km",
option = listOf("풍경이 좋아요", "조용해요", "길이 깨끗해요"),
time = "1시간 30분 소요"
)
PawkeyButton(
text = "해당 루트로 산책하기",
enabled = true,
onClick = {},
modifier = Modifier
var isImageExpanded by remember { mutableStateOf(false) }

Box(modifier = Modifier.fillMaxSize()) {
LazyColumn(
modifier = modifier
.fillMaxWidth()
.padding(top = 16.dp)
)
.padding(16.dp)
.background(color = White1)
) {
item {
CourseDetail(
title = "한강 산책로",
petName = "후추",
date = "2025/06/02",
location = "뚝섬유원지",
distance = "4.5km",
option = listOf("풍경이 좋아요", "조용해요", "길이 깨끗해요"),
time = "1시간 30분 소요",
onImageClick = { isImageExpanded = true } // ← 콜백 전달
)
PawkeyButton(
text = "해당 루트로 산책하기",
enabled = true,
onClick = {},
modifier = Modifier
.fillMaxWidth()
.padding(top = 16.dp)
)
}
}

if (isImageExpanded) {
ImageModal(
imageUrl = "https://pawkey-server.com/image.jpg",
onDismiss = { isImageExpanded = false }
)
}
}
}

Expand All @@ -62,4 +84,4 @@ fun ArchivedCourseDetailPreview(){
PawKeyTheme {
ArchivedCourseDetailScreen(navigateUp = {})
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ fun ArchivedCourseListScreen(
CourseCard(
title = course.title,
petName = course.petName,
date = course.date,
location = course.location,
distance = course.distance,
time = course.time
date = course.date
)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
package com.paw.key.presentation.ui.mypage

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.SnackbarHostState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.paw.key.core.designsystem.component.CourseDetail
import com.paw.key.core.designsystem.component.ImageModal
import com.paw.key.core.designsystem.component.PawkeyButton
import com.paw.key.core.designsystem.theme.PawKeyTheme
import com.paw.key.core.designsystem.theme.White1

@Composable
fun SavedDetailRoute(
Expand All @@ -28,34 +33,49 @@ fun SavedDetailRoute(
modifier = modifier
Copy link
Member

Choose a reason for hiding this comment

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

파라미터 누락된건가유

)
}

@Composable
fun SavedCourseDetailScreen(
navigateUp: () -> Unit,
modifier: Modifier = Modifier
){
Column(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp)
.verticalScroll(rememberScrollState())
) {
CourseDetail(
title = "한강 산책로",
petName = "후추",
date = "2025/06/02",
location = "뚝섬유원지",
distance = "4.5km",
option = listOf("풍경이 좋아요", "조용해요", "길이 깨끗해요"),
time = "1시간 30분 소요"
)
PawkeyButton(
text = "해당 루트로 산책하기",
enabled = true,
onClick = {},
modifier = Modifier
var isImageExpanded by remember { mutableStateOf(false) }

Box(modifier = Modifier.fillMaxSize()) {
LazyColumn(
modifier = modifier
.fillMaxWidth()
.padding(top = 16.dp)
)
.padding(16.dp)
.background(color = White1)
) {
item {
CourseDetail(
title = "한강 산책로",
petName = "후추",
date = "2025/06/02",
location = "뚝섬유원지",
distance = "4.5km",
option = listOf("풍경이 좋아요", "조용해요", "길이 깨끗해요"),
time = "1시간 30분 소요",
onImageClick = { isImageExpanded = true } // ← 콜백 전달
)
PawkeyButton(
text = "해당 루트로 산책하기",
enabled = true,
onClick = {},
modifier = Modifier
.fillMaxWidth()
.padding(top = 16.dp)
)
}
}

if (isImageExpanded) {
ImageModal(
imageUrl = "https://pawkey-server.com/image.jpg",
onDismiss = { isImageExpanded = false }
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,7 @@ fun SavedCourseListScreen(
CourseCard(
title = course.title,
petName = course.petName,
date = course.date,
location = course.location,
distance = course.distance,
time = course.time
date = course.date
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ fun NavController.navigateArchivedDetail(
fun NavGraphBuilder.archivedDetailNavGraph(
navigateUp: () -> Unit,
modifier: Modifier = Modifier,

) {
composable<ArchivedDetail> {
ArchivedDetailRoute(
Expand Down