Skip to content
Open
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 @@ -3,6 +3,7 @@ package com.umcspot.spot.designsystem.component.appBar
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
Expand Down Expand Up @@ -46,6 +47,7 @@ fun AppBarHome (
hasAlert: Boolean = false,
onSearchClick: () -> Unit,
onAlertClick: () -> Unit,
onLogoClick : () -> Unit,
modifier: Modifier = Modifier
) {
Row(
Expand All @@ -57,16 +59,22 @@ fun AppBarHome (
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween
) {

Image(
painter = painterResource(id = R.drawable.spot_logo),
contentDescription = "App Logo",
modifier = Modifier.size(screenWidthDp(33.dp))
modifier = Modifier
.size(screenWidthDp(33.dp))
.clickable(
onClick = onLogoClick
)
)

Row(verticalAlignment = Alignment.CenterVertically) {
IconButton(
modifier = Modifier.size(screenWidthDp(32.dp)),
onClick = onSearchClick) {
onClick = onSearchClick
) {
Icon(
painter = painterResource(id = R.drawable.search),
contentDescription = "Search",
Expand Down Expand Up @@ -98,7 +106,8 @@ fun TopBarPreview_NoNotification() {
AppBarHome(
hasAlert = false,
onSearchClick = {},
onAlertClick = {}
onAlertClick = {},
onLogoClick = {}
)
}
}
Expand All @@ -110,7 +119,8 @@ fun TopBarPreview_WithNotification() {
AppBarHome(
hasAlert = true,
onSearchClick = {},
onAlertClick = {}
onAlertClick = {},
onLogoClick = {}
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ fun ReportModal(
)
)

Spacer(Modifier.height(screenHeightDp(16.dp)))
Spacer(Modifier.height(screenHeightDp(20.dp)))

TextButton(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.text.BasicTextField
import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExposedDropdownMenuBox
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -290,7 +289,6 @@ private fun BottomToolsRow(
}
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun BoardCategorySelector(
selected: PostType,
Expand All @@ -311,18 +309,14 @@ fun BoardCategorySelector(

Spacer(modifier = Modifier.width(screenWidthDp(7.dp)))

ExposedDropdownMenuBox (
expanded = expanded,
onExpandedChange = { expanded = !expanded }
) {
Box {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.menuAnchor() // โ˜… anchor ์ง€์ •
.width(screenWidthDp(85.dp))
.border(1.dp, SpotTheme.colors.G200, SpotShapes.Hard)
.clip(SpotShapes.Hard)
.clickable { expanded = true }
.clickable { expanded = !expanded }
.padding(
horizontal = screenWidthDp(10.dp),
vertical = screenHeightDp(6.dp)
Expand All @@ -343,14 +337,15 @@ fun BoardCategorySelector(
)
}

ExposedDropdownMenu(
DropdownMenu(
expanded = expanded,
onDismissRequest = { expanded = false },
shape = SpotShapes.Hard,
modifier = Modifier
.background(SpotTheme.colors.white)
.width(screenWidthDp(85.dp))
) {
PostType.entries.forEach { type ->
PostType.entries.forEachIndexed { index, type ->
DropdownMenuItem(
modifier = Modifier
.height(screenHeightDp(30.dp))
Expand All @@ -368,6 +363,14 @@ fun BoardCategorySelector(
expanded = false
}
)

if (index != PostType.entries.lastIndex) {
HorizontalDivider(
modifier = Modifier.fillMaxWidth(),
thickness = 1.dp,
color = SpotTheme.colors.gray300
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ private fun HomeScreen(
state = uiState.recommendStudies,
onStudyClick = onStudyClick
)
Spacer(modifier = Modifier.height(screenHeightDp(24.dp)))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ fun MainNavHost(
}
)
},
navigateToMakeStudy = {navigator.navigateToRegisterStudy()},
moveToRecruitingStudy = { navigator.navigateToRecruitingStudy() },
moveToPreferCategoryStudy = {
navigator.navigateToEditInterestStudy(
Expand Down Expand Up @@ -167,7 +168,7 @@ fun MainNavHost(
recruitingStudyGraph(
contentPadding = contentPadding,
onRegisterScrollToTop = onRegisterScrollToTop,
onItemClick = {},
onItemClick = { navigator.navigateToStudyDetail(it)},
onFilterClick = { navigator.navigateToRecruitingStudyFilter() },
)

Expand Down
11 changes: 10 additions & 1 deletion feature/main/src/main/java/com/umcspot/spot/main/MainScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.navigation.NavDestination.Companion.hasRoute
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.navOptions
import androidx.navigation.toRoute
import com.umcspot.spot.alert.navigation.Alert
import com.umcspot.spot.alert.navigation.navigateToAlert
Expand All @@ -39,6 +40,7 @@ import com.umcspot.spot.feature.board.post.content.navigation.POST_CONTENT_ROUTE
import com.umcspot.spot.feature.board.post.posting.navigation.Posting
import com.umcspot.spot.feature.board.post.posting.navigation.navigateToPostingNew
import com.umcspot.spot.home.navigation.Home
import com.umcspot.spot.home.navigation.navigateToHome
import com.umcspot.spot.jjim.navigation.JJim
import com.umcspot.spot.main.component.MainBottomBar
import com.umcspot.spot.mypage.navigation.MyPageGraph
Expand Down Expand Up @@ -125,8 +127,15 @@ fun MainScreen(
} else {
AppBarHome(
hasAlert = hasUnreadAlert,
onSearchClick = { /* TODO */ },
onSearchClick = { },
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

โš ๏ธ Potential issue | ๐ŸŸก Minor | โšก Quick win

๊ฒ€์ƒ‰ ๋ฒ„ํŠผ์ด ๋™์ž‘ํ•˜์ง€ ์•Š๋Š” ๋นˆ ์ฝœ๋ฐฑ์ž…๋‹ˆ๋‹ค.

onSearchClick = { }๋กœ ์ธํ•ด ๊ฒ€์ƒ‰ ์•„์ด์ฝ˜์„ ๋ˆŒ๋Ÿฌ๋„ ์•„๋ฌด ๋™์ž‘์ด ์—†์Šต๋‹ˆ๋‹ค. ์˜๋„๋œ ์ƒํƒœ(๋ฏธ๊ตฌํ˜„ ๋ณด๋ฅ˜)์ธ์ง€, ์•„๋‹ˆ๋ฉด ๊ฒ€์ƒ‰ ํ™”๋ฉด์œผ๋กœ์˜ ๋„ค๋น„๊ฒŒ์ด์…˜ ์—ฐ๊ฒฐ์ด ๋ˆ„๋ฝ๋œ ๊ฒƒ์ธ์ง€ ํ™•์ธํ•ด ์ฃผ์„ธ์š”.

๊ฒ€์ƒ‰ ๋„ค๋น„๊ฒŒ์ด์…˜ ์—ฐ๊ฒฐ์ด ํ•„์š”ํ•˜๋‹ค๋ฉด ํ•ธ๋“ค๋Ÿฌ ๊ตฌํ˜„์„ ๋„์™€๋“œ๋ฆฌ๊ฑฐ๋‚˜ ์ถ”์ ์šฉ ์ด์Šˆ๋ฅผ ์—ด์–ด๋“œ๋ฆด๊นŒ์š”?

๐Ÿค– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@feature/main/src/main/java/com/umcspot/spot/main/MainScreen.kt` at line 130,
The onSearchClick callback is currently a no-op (onSearchClick = { }) so the
search icon does nothing; update the MainScreen usage by implementing the search
handler: either wire it to the existing navigation action (call the
NavController navigate method or the existing navigateToSearch function if
present) or, if search is intentionally deferred, replace the empty lambda with
a clear TODO stub that logs or emits an event (e.g., onSearchRequested) so the
behavior is traceable and testable; locate the onSearchClick parameter in
MainScreen composable invocation to make the change.

onAlertClick = { navController.navigateToAlert() },
onLogoClick = {
navController.navigateToHome(
navOptions = navOptions {
popUpTo<Home> { inclusive = true }
}
)
},
modifier = Modifier.statusBarsPadding()
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,8 @@ fun CancelMemberShipScreen(
noButtonText = "์ทจ์†Œ",
onDismiss = { showDialog = false },
onClick = {
viewmodel.leaveSpot()
showSuccessDialog = true
showDialog = false
viewmodel.leaveSpot()
},
onCancel = { showDialog = false }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ fun NavGraphBuilder.myPageGraph(
navigateToParticipatingStudy: () -> Unit,
navigateToMyRecruitingStudy: () -> Unit,
navigateToWaitingStudy: () -> Unit,
navigateToMakeStudy: () -> Unit,
navigateToEditInterestStudy: () -> Unit,
navigateToEditInterestRegion: () -> Unit,
navigateToCancelMembership: () -> Unit,
Expand Down Expand Up @@ -141,7 +142,7 @@ fun NavGraphBuilder.myPageGraph(
onBackClick = navigateUp,
onRegisterScrollToTop = onRegisterScrollToTop,
onStudyClick = onStudyClick,
moveToMakeStudy = {},
moveToMakeStudy = navigateToMakeStudy,
moveToCheckApplied = navigateToStudyApplications
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fun RecruitingStudyScreen(
viewmodel: RecruitingStudyViewModel = hiltViewModel(),
onRegisterScrollToTop: ((() -> Unit)?) -> Unit,
onFilterClick: () -> Unit,
onItemClick: (StudyResult) -> Unit
onItemClick: (Long) -> Unit
) {
val state by viewmodel.uiState.collectAsStateWithLifecycle()
val sort by viewmodel.sortType.collectAsStateWithLifecycle()
Expand Down Expand Up @@ -228,7 +228,7 @@ private fun RecruitingStudyScreenContent(
modifier: Modifier = Modifier,
studies: List<StudyResult>,
listState: LazyListState,
onItemClick: (StudyResult) -> Unit,
onItemClick: (Long) -> Unit,
) {
LazyColumn(
state = listState,
Expand All @@ -245,7 +245,7 @@ private fun RecruitingStudyScreenContent(
item = item,
modifier = Modifier
.fillMaxWidth(),
onClick = { onItemClick(item) }
onClick = { onItemClick(item.id) }
)

if(studies.indexOf(item) != studies.lastIndex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fun NavGraphBuilder.recruitingStudyGraph(
contentPadding : PaddingValues,
onRegisterScrollToTop: ((() -> Unit)?) -> Unit,
onFilterClick : () -> Unit,
onItemClick : (StudyResult) -> Unit
onItemClick : (Long) -> Unit
) {
composable<Recruiting> {
RecruitingStudyScreen(
Expand Down