Files
lootalot-client/src/Route.elm

26 lines
488 B
Elm

module Route exposing(..)
import Url
import Url.Parser as P exposing (Parser, (</>), oneOf, s)
---
-- ROUTES
---
type Route
= PlayerChest
| Merchant
| GroupLoot
| NewLoot
routeParser : Url.Url -> Maybe Route
routeParser url =
P.parse
(oneOf
[ P.map GroupLoot (P.s "coffre")
, P.map PlayerChest P.top
, P.map Merchant (P.s "marchand")
, P.map NewLoot (P.s "nouveau-tresor")
]
)
url