-
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
9 changed files
with
175 additions
and
142 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
13 changes: 0 additions & 13 deletions
13
...follower/src/commonMain/kotlin/com.stslex.feature.follower/domain/model/FollowerMapper.kt
This file was deleted.
Oops, something went wrong.
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
10 changes: 10 additions & 0 deletions
10
...e/follower/src/commonMain/kotlin/com.stslex.feature.follower/ui/model/FollowerUiMapper.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,10 @@ | ||
package com.stslex.feature.follower.ui.model | ||
|
||
import com.stslex.feature.follower.data.model.FollowerDataModel | ||
|
||
fun FollowerDataModel.toUi(): FollowerModel = FollowerModel( | ||
uuid = uuid, | ||
username = username, | ||
avatarUrl = avatarUrl, | ||
isFollowing = isFollowing | ||
) |
41 changes: 41 additions & 0 deletions
41
...ollower/src/commonMain/kotlin/com.stslex.feature.follower/ui/store/FollowerScreenState.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,41 @@ | ||
package com.stslex.feature.follower.ui.store | ||
|
||
import androidx.compose.runtime.Stable | ||
import com.stslex.core.ui.base.AppError | ||
import com.stslex.core.ui.pager.states.PagerLoadState | ||
|
||
@Stable | ||
sealed interface FollowerScreenState { | ||
|
||
@Stable | ||
sealed interface Content : FollowerScreenState { | ||
|
||
@Stable | ||
data object Data : Content | ||
|
||
@Stable | ||
data object Loading : Content | ||
|
||
@Stable | ||
data object Refresh : Content | ||
} | ||
|
||
@Stable | ||
data object Shimmer : FollowerScreenState | ||
|
||
@Stable | ||
data object Empty : FollowerScreenState | ||
|
||
@Stable | ||
data class Error(val error: AppError) : FollowerScreenState | ||
} | ||
|
||
fun PagerLoadState.toUi(): FollowerScreenState = when (this) { | ||
is PagerLoadState.Loading -> FollowerScreenState.Content.Loading | ||
is PagerLoadState.Error -> FollowerScreenState.Error(error) | ||
is PagerLoadState.Initial -> FollowerScreenState.Shimmer | ||
is PagerLoadState.Empty -> FollowerScreenState.Empty | ||
PagerLoadState.Data -> FollowerScreenState.Content.Data | ||
PagerLoadState.Refresh -> FollowerScreenState.Content.Refresh | ||
PagerLoadState.Retry -> FollowerScreenState.Shimmer | ||
} |
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
Oops, something went wrong.