-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply suggestions from Compose rules (#1199)
* Apply suggestions from Compose rules * Remove needless blank lines --------- Co-authored-by: Ashley Davies <[email protected]>
- Loading branch information
Showing
16 changed files
with
130 additions
and
125 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
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
32 changes: 32 additions & 0 deletions
32
dominion-app/src/commonMain/kotlin/io/ashdavies/dominion/BoxSetListPresenter.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,32 @@ | ||
package io.ashdavies.dominion | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.produceState | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.setValue | ||
import com.slack.circuit.runtime.Navigator | ||
|
||
@Composable | ||
internal fun BoxSetListPresenter( | ||
navigator: Navigator, | ||
boxSetStore: BoxSetStore, | ||
): DominionScreen.BoxSetList.State { | ||
var isLoading by remember { mutableStateOf(true) } | ||
val boxSetList by produceState(emptyList<BoxSet>()) { | ||
value = boxSetStore() | ||
isLoading = false | ||
} | ||
|
||
return DominionScreen.BoxSetList.State( | ||
boxSetList = boxSetList, | ||
isLoading = isLoading, | ||
) { event -> | ||
when (event) { | ||
is DominionScreen.BoxSetList.Event.ShowBoxSet -> { | ||
navigator.goTo(DominionScreen.BoxSetDetails(event.boxSet.title)) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.