diff options
author | Joris | 2021-01-03 13:40:40 +0100 |
---|---|---|
committer | Joris | 2021-01-03 13:54:20 +0100 |
commit | 11052951b74b9ad4b6a9412ae490086235f9154b (patch) | |
tree | 64526ac926c1bf470ea113f6cac8a33158684e8d /client/src/Component/Link.hs | |
parent | 371449b0e312a03162b78797b83dee9d81706669 (diff) |
Rewrite in Rust
Diffstat (limited to 'client/src/Component/Link.hs')
-rw-r--r-- | client/src/Component/Link.hs | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/client/src/Component/Link.hs b/client/src/Component/Link.hs deleted file mode 100644 index 1fd620e..0000000 --- a/client/src/Component/Link.hs +++ /dev/null @@ -1,33 +0,0 @@ -module Component.Link - ( view - ) where - -import Data.Map (Map) -import qualified Data.Map as M -import Data.Text (Text) -import qualified Data.Text as T -import Reflex.Dom (Dynamic, MonadWidget) -import qualified Reflex.Dom as R - -view :: forall t m a. MonadWidget t m => Text -> Dynamic t (Map Text Text) -> Text -> m () -view href inputAttrs content = - R.elDynAttr "a" attrs (R.text content) - where - - onclickHandler = - T.intercalate ";" - [ "history.pushState(0, '', event.target.href)" - , "dispatchEvent(new PopStateEvent('popstate', {cancelable: true, bubbles: true, view: window}))" - , "return false" - ] - - attrs = - R.ffor inputAttrs (\as -> - (M.union - (M.fromList - [ ("onclick", onclickHandler) - , ("href", href) - ] - ) - as) - ) |