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

[PC-253] 패키지 재정리, Auth 화면 생성 #22

Merged
merged 5 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions app/src/main/java/com/puzzle/piece/ViewModelsModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.puzzle.piece
import com.airbnb.mvrx.hilt.AssistedViewModelFactory
import com.airbnb.mvrx.hilt.MavericksViewModelComponent
import com.airbnb.mvrx.hilt.ViewModelKey
import com.puzzle.matching.MatchingViewModel
import com.puzzle.matching.detail.MatchingDetailViewModel
import com.puzzle.matching.page.main.MatchingViewModel
import com.puzzle.matching.page.detail.MatchingDetailViewModel
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
Expand Down
6 changes: 6 additions & 0 deletions core/navigation/src/main/java/com/puzzle/navigation/Route.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ data object AuthGraph : Route
sealed class AuthGraphDest : Route {
@Serializable
data object AuthRoute : AuthGraphDest()

@Serializable
data object AuthVerificationRoute : AuthGraphDest()

@Serializable
data object AuthRegistrationRoute : AuthGraphDest()
}

@Serializable
Expand Down
57 changes: 0 additions & 57 deletions feature/auth/src/main/java/com/puzzle/auth/AuthScreen.kt

This file was deleted.

11 changes: 0 additions & 11 deletions feature/auth/src/main/java/com/puzzle/auth/AuthViewModel.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.puzzle.auth.navigation
import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable
import androidx.navigation.navigation
import com.puzzle.auth.AuthRoute
import com.puzzle.auth.page.main.AuthRoute
import com.puzzle.navigation.AuthGraph
import com.puzzle.navigation.AuthGraphDest

Expand Down
61 changes: 61 additions & 0 deletions feature/auth/src/main/java/com/puzzle/auth/page/main/AuthScreen.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package com.puzzle.auth.page.main

import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.tooling.preview.Preview
import com.airbnb.mvrx.compose.collectAsState
import com.airbnb.mvrx.compose.mavericksViewModel

@Composable
fun AuthRoute(
viewModel: AuthViewModel = mavericksViewModel(),
) {
val state by viewModel.collectAsState()
val context = LocalContext.current

AuthScreen(

)
}

@Composable
fun AuthScreen() {
// Column(
// modifier = Modifier
// .fillMaxSize()
// .clickable {
// viewModel.navigationHelper.navigate(
// NavigationEvent.NavigateTo(
// route = MatchingGraph,
// popUpTo = AuthGraph,
// )
// )
// },
// ) {
// Text(
// text = "카카오 로그인",
// fontSize = 30.sp,
// modifier = Modifier.clickable {
// UserApiClient.instance.loginWithKakaoAccount(context) { token, error ->
// if (error != null) {
// Log.e("test", "로그인 실패", error)
// } else if (token != null) {
// Log.i("test", "로그인 성공 ${token.accessToken}")
// }
// }
// }
// )
//
// Text(
// text = "AuthRoute",
// fontSize = 30.sp,
// )
// }
}

@Preview
@Composable
fun PreviewAuthScreen() {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.puzzle.auth.page.main

import com.airbnb.mvrx.MavericksViewModel
import com.puzzle.auth.page.main.contract.AuthState
import com.puzzle.navigation.NavigationHelper
import dagger.assisted.Assisted
import dagger.assisted.AssistedInject

class AuthViewModel @AssistedInject constructor(
@Assisted initialState: AuthState,
private val navigationHelper: NavigationHelper,
) : MavericksViewModel<AuthState>(initialState) {
}
Copy link
Member

Choose a reason for hiding this comment

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

p4) EOL하나 있네용, 근데 지금 고치지 말고 나중에 ViewModel 작업할 때 하나 넣어주세요!~

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.puzzle.auth.page.main.contract

class AuthIntent {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.puzzle.auth.page.main.contract

class AuthSideEffect {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.puzzle.auth.page.main.contract

import com.airbnb.mvrx.MavericksState

data class AuthState(
val a: Boolean,
) : MavericksState
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.puzzle.auth.page.registration

import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import com.airbnb.mvrx.compose.collectAsState
import com.airbnb.mvrx.compose.mavericksViewModel

@Composable
internal fun AuthRegistrationScreen(
viewModel: AuthRegistrationViewModel = mavericksViewModel()
) {
val state by viewModel.collectAsState()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.puzzle.auth.page.registration

import com.airbnb.mvrx.MavericksViewModel
import com.puzzle.auth.page.registration.contract.AuthRegistrationState
import com.puzzle.navigation.NavigationHelper
import dagger.assisted.Assisted
import dagger.assisted.AssistedInject

class AuthRegistrationViewModel @AssistedInject constructor(
@Assisted initialState: AuthRegistrationState,
private val navigationHelper: NavigationHelper,
) : MavericksViewModel<AuthRegistrationState>(initialState) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.puzzle.auth.page.registration.contract

sealed class AuthRegistrationIntent {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.puzzle.auth.page.registration.contract

sealed class AuthRegistrationSideEffect {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.puzzle.auth.page.registration.contract

import com.airbnb.mvrx.MavericksState

data class AuthRegistrationState(
val a: Boolean,
) : MavericksState
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.puzzle.auth.page.verification

import com.airbnb.mvrx.MavericksViewModel
import com.puzzle.auth.page.verification.contract.AuthVerficationState
import com.puzzle.navigation.NavigationHelper
import dagger.assisted.Assisted
import dagger.assisted.AssistedInject

class AuthVerficationViewModel @AssistedInject constructor(
@Assisted initialState: AuthVerficationState,
private val navigationHelper: NavigationHelper,
) : MavericksViewModel<AuthVerficationState>(initialState) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.puzzle.auth.page.verification

import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import com.airbnb.mvrx.compose.collectAsState
import com.airbnb.mvrx.compose.mavericksViewModel

@Composable
internal fun AuthVerificationRoute(
viewModel: AuthVerficationViewModel = mavericksViewModel()
) {
val state by viewModel.collectAsState()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.puzzle.auth.page.verification.contract

import com.airbnb.mvrx.MavericksState

data class AuthVerficationState(
val a: Boolean,
) : MavericksState
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.puzzle.auth.page.verification.contract

sealed class AuthVerificationIntent {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.puzzle.auth.page.verification.contract

sealed class AuthVerificationSideEffect {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.puzzle.matching.detail.component
package com.puzzle.matching.common.component

import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.puzzle.matching.ui
package com.puzzle.matching.common.constant

enum class DialogType {
ACCEPT_MATCHING,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.puzzle.matching.detail.content
package com.puzzle.matching.common.ui

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
Expand All @@ -21,7 +21,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.puzzle.designsystem.R
import com.puzzle.designsystem.foundation.PieceTheme
import com.puzzle.matching.detail.component.BasicInfoHeader
import com.puzzle.matching.common.component.BasicInfoHeader

@Composable
internal fun BasicInfoBody(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.puzzle.matching.detail.content
package com.puzzle.matching.common.ui

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
Expand Down Expand Up @@ -45,7 +45,7 @@ import com.puzzle.designsystem.R
import com.puzzle.designsystem.component.PieceSubButton
import com.puzzle.designsystem.foundation.PieceTheme
import com.puzzle.domain.model.matching.ValuePick
import com.puzzle.matching.detail.component.BasicInfoHeader
import com.puzzle.matching.common.component.BasicInfoHeader

@Composable
internal fun ValuePickBody(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.puzzle.matching.detail.content
package com.puzzle.matching.common.ui

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
Expand Down Expand Up @@ -32,7 +32,7 @@ import com.puzzle.common.ui.CollapsingHeaderNestedScrollConnection
import com.puzzle.designsystem.R
import com.puzzle.designsystem.foundation.PieceTheme
import com.puzzle.domain.model.matching.ValueTalk
import com.puzzle.matching.detail.component.BasicInfoHeader
import com.puzzle.matching.common.component.BasicInfoHeader

@Composable
internal fun ValueTalkBody(
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.puzzle.matching.navigation
import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable
import androidx.navigation.navigation
import com.puzzle.matching.MatchingRoute
import com.puzzle.matching.detail.MatchingDetailRoute
import com.puzzle.matching.page.detail.MatchingDetailRoute
import com.puzzle.matching.page.main.MatchingRoute
import com.puzzle.navigation.MatchingGraph
import com.puzzle.navigation.MatchingGraphDest

Expand Down
Loading
Loading