aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/app/Route.hs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-06-06 23:05:41 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-06-06 23:05:41 +0200
commit378e007141c699945080bbf944aeef4abf67d75c (patch)
tree0e734b64e6ba2549b5b5fd4df01a33880af7fe62 /frontend/app/Route.hs
parent3add980b73b1ac75d1ad1dde85f6c782439914be (diff)
add new collection page
Diffstat (limited to 'frontend/app/Route.hs')
-rw-r--r--frontend/app/Route.hs3
1 files changed, 3 insertions, 0 deletions
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"