Skip to content

Flash messages when user has scrolled down #1459

Answered by unhammer
nomeata asked this question in Q&A
Discussion options

You must be logged in to vote

I don't know if this is the best way, but I did this by modifying the cssFramework, e.g. with the default bootstrap

import IHP.FlashMessages.Types
import IHP.View.CSSFramework
import IHP.HSX.QQ (hsx)
import IHP.View.Types

myBootstrap = bootstrap { styledFlashMessage }
  where
    styledFlashMessage _ (SuccessFlashMessage message) = [hsx|<div class="alert alert-success js-scroll-into-view">{message}</div>|]
    styledFlashMessage _ (ErrorFlashMessage message)   = [hsx|<div class="alert alert-danger  js-scroll-into-view">{message}</div>|]

and then in Config.hs

config :: ConfigBuilder
config = do
    option myBootstrap

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@unhammer
Comment options

Answer selected by mpscholten
@mpscholten
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants