-
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.
Merge pull request #352 from 6QuizOnTheBlock/and/feat#351-teacher_homโฆ
โฆe_tab feat #351: ์ ์๋ ํ ํญ ํ๋ฉด ์ ๋ณด ํธ์ถ ๊ตฌํ
- Loading branch information
Showing
10 changed files
with
132 additions
and
26 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
40 changes: 40 additions & 0 deletions
40
...oid/feature/teacher/home/src/main/java/com/sixkids/teacher/home/main/HomeMainViewModel.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,40 @@ | ||
package com.sixkids.teacher.home.main | ||
|
||
import androidx.lifecycle.viewModelScope | ||
import com.sixkids.domain.usecase.organization.LoadSelectedOrganizationNameUseCase | ||
import com.sixkids.domain.usecase.user.LoadUserInfoUseCase | ||
import com.sixkids.ui.base.BaseViewModel | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import kotlinx.coroutines.launch | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class HomeMainViewModel @Inject constructor( | ||
private val loadUserInfoUseCase: LoadUserInfoUseCase, | ||
private val loadSelectedOrganizationNameUseCase: LoadSelectedOrganizationNameUseCase | ||
): BaseViewModel<HomeMainState, HomeMainEffect>(HomeMainState()){ | ||
fun loadUserInfo(){ | ||
viewModelScope.launch { | ||
loadUserInfoUseCase().onSuccess { | ||
intent { | ||
copy( | ||
teacherName = it.name, | ||
teacherImageUrl = it.photo | ||
) | ||
} | ||
} | ||
} | ||
} | ||
|
||
fun loadSelectedOrganizationName(){ | ||
viewModelScope.launch { | ||
loadSelectedOrganizationNameUseCase().onSuccess { | ||
intent { | ||
copy( | ||
classString = it.replace("\n"," ") | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} |
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