add new collection page
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user