Skip to content

Commit

Permalink
Fixed flash messages not being styled
Browse files Browse the repository at this point in the history
  • Loading branch information
mpscholten committed Nov 13, 2020
1 parent f4bbe67 commit d02a069
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions IHP/View/CSSFramework.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,24 @@ import IHP.ModelSupport
--
-- This way we can later add more properties to the CSSFramework without having update all the CSS Frameworks manually
instance Default CSSFramework where
def = CSSFramework { .. }
def = CSSFramework
{
styledFlashMessage = \cssFramework -> \case
SuccessFlashMessage message -> [hsx|<div>{message}</div>|]
ErrorFlashMessage message -> [hsx|<div>{message}</div>|]
, styledFlashMessages
, styledFormField
, styledSubmitButton
, styledSubmitButtonClass
, styledFormFieldHelp
, styledInputClass
, styledInputInvalidClass
, styledFormGroupClass
, styledValidationResult
, styledValidationResultClass
}
where
styledFlashMessage _ (SuccessFlashMessage message) = [hsx|<div>{message}</div>|]
styledFlashMessage _ (ErrorFlashMessage message) = [hsx|<div>{message}</div>|]

styledFlashMessages cssFramework flashMessages = forEach flashMessages (styledFlashMessage cssFramework)
styledFlashMessages cssFramework flashMessages = forEach flashMessages (styledFlashMessage cssFramework cssFramework)

styledFormField :: CSSFramework -> FormField -> Blaze.Html
styledFormField cssFramework formField =
Expand Down

0 comments on commit d02a069

Please sign in to comment.