fix: progress on Hyperbole view DSL - form tags, imports, constraints
- Fix tag calls to use \$ none for self-closing tags - Add IOE constraint to HyperView instances - Add warning suppressions where needed - Fix Form data type imports - Remove duplicate getUserHouseholds helpers - Remaining issues: String/Text mismatches in text calls, a few view DSL type errors in Dashboard/Chores
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{-# LANGUAGE FlexibleContexts, DeriveAnyClass, DeriveGeneric, MultiParamTypeClasses, FlexibleInstances, UndecidableInstances, TypeApplications, TypeOperators, OverloadedStrings #-}
|
||||
{-# OPTIONS_GHC -Wno-unused-imports -Wno-unused-do-bind -Wno-redundant-constraints #-}
|
||||
|
||||
module Sis.Page.Login (page) where
|
||||
import Effectful
|
||||
@@ -17,7 +18,7 @@ import Web.Hyperbole.Page
|
||||
data LoginPage = LoginPage
|
||||
deriving stock (Generic)
|
||||
deriving anyclass (ViewId)
|
||||
instance (DB :> es) => HyperView LoginPage es where
|
||||
instance (DB :> es, IOE :> es) => HyperView LoginPage es where
|
||||
data Action LoginPage
|
||||
= SubmitLogin
|
||||
| Noop
|
||||
@@ -46,11 +47,11 @@ loginView mError = do
|
||||
Nothing -> none
|
||||
form SubmitLogin $ do
|
||||
el @ att "class" nbLabelClass $ text "Email"
|
||||
tag "input" @ att "type" "email" . att "name" "lfEmail" . att "class" nbInputClass @ att "style" "width:100%"
|
||||
tag "input" @ att "type" "email" . att "name" "lfEmail" . att "class" nbInputClass @ att "style" "width:100%" $ none
|
||||
el @ att "class" nbLabelClass $ text "Password"
|
||||
tag "input" @ att "type" "password" . att "name" "lfPassword" . att "class" nbInputClass @ att "style" "width:100%"
|
||||
tag "input" @ att "type" "password" . att "name" "lfPassword" . att "class" nbInputClass @ att "style" "width:100%" $ none
|
||||
el @ att "style" "display:flex;align-items:center;gap:0.5rem;margin-bottom:1rem" $ do
|
||||
tag "input" @ att "type" "checkbox" . att "name" "lfRemember"
|
||||
tag "input" @ att "type" "checkbox" . att "name" "lfRemember" $ none
|
||||
text "Remember me"
|
||||
submit (text "Log In") @ att "class" nbButtonClass @ att "style" "width:100%"
|
||||
route RouteSignup $ text "Don't have an account? Sign Up"
|
||||
|
||||
Reference in New Issue
Block a user