-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
344 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
feature/notice/src/commonMain/kotlin/team/aliens/dms/kmp/feature/notice/di/NoticeModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package team.aliens.dms.kmp.feature.notice.di | ||
|
||
import org.koin.core.module.dsl.viewModelOf | ||
import org.koin.dsl.module | ||
import team.aliens.dms.kmp.feature.notice.viewmodel.NoticeDetailsViewModel | ||
import team.aliens.dms.kmp.feature.notice.viewmodel.NoticesViewModel | ||
|
||
val noticeModule = module { | ||
viewModelOf(::NoticesViewModel) | ||
viewModelOf(::NoticeDetailsViewModel) | ||
} |
27 changes: 27 additions & 0 deletions
27
...ommonMain/kotlin/team/aliens/dms/kmp/feature/notice/navigation/NoticeDetailsNavigation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package team.aliens.dms.kmp.feature.notice.navigation | ||
|
||
import androidx.navigation.NavController | ||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.NavType | ||
import androidx.navigation.compose.composable | ||
import androidx.navigation.navArgument | ||
import team.aliens.dms.kmp.feature.notice.ui.NoticeDetails | ||
|
||
const val NAVIGATION_NOTICE_DETAILS = "noticeDetails" | ||
private const val NOTICE_ID = "notice-id" | ||
|
||
fun NavGraphBuilder.noticeDetails() { | ||
composable( | ||
route = "$NAVIGATION_NOTICE_DETAILS/{$NOTICE_ID}", | ||
arguments = listOf( | ||
navArgument(NOTICE_ID) { type = NavType.LongType }, | ||
), | ||
) { | ||
val noticeId = it.arguments?.getLong(NOTICE_ID) ?: 0L | ||
NoticeDetails(noticeId = noticeId) | ||
} | ||
} | ||
|
||
fun NavController.navigateToNoticeDetails(noticeId: Long) { | ||
navigate("$NAVIGATION_NOTICE_DETAILS/$noticeId") | ||
} |
13 changes: 0 additions & 13 deletions
13
...e/src/commonMain/kotlin/team/aliens/dms/kmp/feature/notice/navigation/NoticeNavigation.kt
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
.../src/commonMain/kotlin/team/aliens/dms/kmp/feature/notice/navigation/NoticesNavigation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package team.aliens.dms.kmp.feature.notice.navigation | ||
|
||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.compose.composable | ||
import team.aliens.dms.kmp.feature.notice.ui.Notices | ||
|
||
const val NAVIGATION_NOTICES = "notices" | ||
|
||
fun NavGraphBuilder.notices( | ||
onNoticeDetailsClick: (Long) -> Unit, | ||
) { | ||
composable(NAVIGATION_NOTICES) { | ||
Notices( | ||
onNoticeDetailsClick = onNoticeDetailsClick, | ||
) | ||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
...notice/src/commonMain/kotlin/team/aliens/dms/kmp/feature/notice/ui/NoticeDetailsScreen.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package team.aliens.dms.kmp.feature.notice.ui | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Arrangement | ||
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.material3.HorizontalDivider | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.collectAsState | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import org.koin.compose.koinInject | ||
import team.aliens.dms.kmp.core.designsystem.appbar.DmsTopAppBar | ||
import team.aliens.dms.kmp.core.designsystem.foundation.DmsTheme | ||
import team.aliens.dms.kmp.core.designsystem.foundation.DmsTypography | ||
import team.aliens.dms.kmp.core.designsystem.text.DmsText | ||
import team.aliens.dms.kmp.feature.notice.viewmodel.NoticeDetailsState | ||
import team.aliens.dms.kmp.feature.notice.viewmodel.NoticeDetailsViewModel | ||
|
||
@Composable | ||
internal fun NoticeDetails( | ||
noticeId: Long, | ||
) { | ||
val viewModel: NoticeDetailsViewModel = koinInject() | ||
val state by viewModel.state.collectAsState() | ||
|
||
NoticeDetailsScreen(state = state) | ||
} | ||
|
||
@Composable | ||
private fun NoticeDetailsScreen( | ||
state: NoticeDetailsState, | ||
) { | ||
Column( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.background(DmsTheme.colors.background), | ||
) { | ||
DmsTopAppBar( | ||
title = "안내", | ||
onBackPressed = { }, | ||
) | ||
Notice() | ||
} | ||
} | ||
|
||
@Composable | ||
private fun Notice( | ||
modifier: Modifier = Modifier, | ||
) { | ||
Column( | ||
modifier = modifier | ||
.fillMaxWidth() | ||
.padding(24.dp), | ||
verticalArrangement = Arrangement.spacedBy(12.dp), | ||
) { | ||
DmsText( | ||
text = "기숙사생들에 알립니다.", | ||
style = DmsTypography.Header3, | ||
color = DmsTheme.colors.surfaceBright, | ||
) | ||
DmsText( | ||
text = "22/21/22 12:1", | ||
style = DmsTypography.Body1, | ||
color = DmsTheme.colors.inverseSurface, | ||
) | ||
HorizontalDivider( | ||
modifier = Modifier.fillMaxWidth(), | ||
thickness = 1.dp, | ||
color = DmsTheme.colors.surface, | ||
) | ||
DmsText( | ||
text = "sdasdasdasd", | ||
style = DmsTypography.Body2, | ||
color = DmsTheme.colors.onTertiaryContainer, | ||
) | ||
} | ||
} |
14 changes: 0 additions & 14 deletions
14
feature/notice/src/commonMain/kotlin/team/aliens/dms/kmp/feature/notice/ui/NoticeScreen.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.