Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
There is no more search, therefore this variable isn't correct anymore
  • Loading branch information
lukaszreszke committed Jul 25, 2024
1 parent 442e272 commit b18b6b8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ruby_event_store-browser/elm/src/Search.elm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type alias Stream =


type alias Model a =
{ searchedStream : Stream
{ stream : Stream
, onSelectMsg : Stream -> a
}

Expand All @@ -35,7 +35,7 @@ emptyStreams =

init : (Stream -> a) -> Model a
init onSelectMsg =
{ searchedStream = emptyStreamName
{ stream = emptyStreamName
, onSelectMsg = onSelectMsg
}

Expand All @@ -49,24 +49,24 @@ update : Msg -> Model a -> ( Model a, Cmd a )
update msg model =
case msg of
StreamChanged stream ->
( { model | searchedStream = stream }, Cmd.none )
( { model | stream = stream }, Cmd.none )

GoToStream stream ->
( { model | searchedStream = emptyStreamName }
( { model | stream = emptyStreamName }
, onSelectCmd model.onSelectMsg stream
)


view : Model a -> Html Msg
view model =
form [ onSubmit (GoToStream model.searchedStream) ]
form [ onSubmit (GoToStream model.stream) ]
[ div [ class "relative" ]
[ FeatherIcons.search
|> FeatherIcons.withClass "size-4 text-gray-400 absolute pointer-events-none top-3.5 left-2"
|> FeatherIcons.toHtml []
, input
[ class "rounded text-gray-800 cursor-pointer pl-8 pr-12 py-2 w-full appearance-none outline-none focus:ring-2 focus:ring-red-500 focus:ring-opacity-50"
, value model.searchedStream
, value model.stream
, onInput StreamChanged
, placeholder "Quick search…"
, autofocus True
Expand Down

0 comments on commit b18b6b8

Please sign in to comment.