Skip to content

Commit

Permalink
Use ReadonlyArray
Browse files Browse the repository at this point in the history
  • Loading branch information
aerialist7 committed Apr 16, 2024
1 parent 1fd267e commit 1fb58f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/jsMain/kotlin/team/karakum/page/Sidebar.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package team.karakum.page

import emotion.styled.styled
import js.array.ReadonlyArray
import js.uri.decodeURIComponent
import js.uri.encodeURIComponent
import mui.material.*
Expand Down Expand Up @@ -65,7 +66,7 @@ val Sidebar = FC<Props> {
}

private val ShowcaseList = FC {
val showcases = useLoaderData().unsafeCast<Array<out Showcase>>()
val showcases = useLoaderData().unsafeCast<ReadonlyArray<Showcase>>()
val showcaseId = useShowcaseIdParam()

Box {
Expand Down
3 changes: 2 additions & 1 deletion src/jsMain/kotlin/team/karakum/router/Router.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package team.karakum.router

import js.array.ReadonlyArray
import js.objects.jso
import react.router.dom.createHashRouter
import remix.run.router.LoaderFunction
Expand Down Expand Up @@ -27,7 +28,7 @@ import team.karakum.showcase.material.surfaces.PaperShowcase
import team.karakum.showcase.material.utils.*
import kotlin.js.Promise.Companion.resolve

private val MATERIAL_SHOWCASES: Array<out Showcase> = arrayOf(
private val MATERIAL_SHOWCASES: ReadonlyArray<Showcase> = arrayOf(
// inputs
Showcase("material-ui/react-autocomplete", "Autocomplete", AutocompleteShowcase),
Showcase("material-ui/react-button", "Button", ButtonShowcase),
Expand Down

0 comments on commit 1fb58f4

Please sign in to comment.