From 378e007141c699945080bbf944aeef4abf67d75c Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Thu, 6 Jun 2024 23:05:41 +0200 Subject: add new collection page --- frontend/app/Route.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'frontend/app/Route.hs') diff --git a/frontend/app/Route.hs b/frontend/app/Route.hs index 546939c..d683b76 100644 --- a/frontend/app/Route.hs +++ b/frontend/app/Route.hs @@ -14,6 +14,7 @@ data Route = Home | ListCollection String | EditValue String String + | NewCollection deriving (Show, Eq) instance Default Route where @@ -27,6 +28,7 @@ parseURI uri = [ EditValue <$> (P.string "#collection/" *> P.manyTill P.anyChar (P.string "/")) <*> (P.many1 P.anyChar), + pure NewCollection <* (P.string "#collection/new"), ListCollection <$> (P.string "#collection/" *> P.many1 P.anyChar), pure Home ] @@ -38,3 +40,4 @@ routeToString :: Route -> String routeToString Home = "#" routeToString (ListCollection collection) = "#collection/" <> collection routeToString (EditValue collection fileName) = "#collection/" <> collection <> "/" <> fileName +routeToString NewCollection = "#collection/new" -- cgit v1.2.3