Skip to content

Commit

Permalink
Rename property
Browse files Browse the repository at this point in the history
  • Loading branch information
amitaibu committed Dec 23, 2023
1 parent abe950a commit f50f060
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions IHP/View/CSSFramework.hs
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ instance Default CSSFramework where

styledValidationResultClass = ""

styledSubmitButton cssFramework SubmitButton { label, buttonClass, disabled } =
styledSubmitButton cssFramework SubmitButton { label, buttonClass, buttonDisabled } =
let className :: Text = cssFramework.styledSubmitButtonClass
in [hsx|<button class={classes [(className, True), (buttonClass, not (null buttonClass))]} disabled={disabled} type="submit">{label}</button>|]
in [hsx|<button class={classes [(className, True), (buttonClass, not (null buttonClass))]} disabled={buttonDisabled} type="submit">{label}</button>|]

styledInputClass _ _ = ""
styledInputInvalidClass _ _ = "invalid"
Expand Down
2 changes: 1 addition & 1 deletion IHP/View/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ data FormField = FormField
data SubmitButton = SubmitButton
{ label :: Blaze.Html
, buttonClass :: Text
, buttonDisabled :: Bool
, cssFramework :: CSSFramework
, disabled :: Bool
}

data FormContext model = FormContext
Expand Down
2 changes: 1 addition & 1 deletion Test/View/FormSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ tests = do

let form = formForWithOptions project options [hsx|
{textField #title}
{submitButton {disabled = True}}
{submitButton {buttonDisabled = True}}
|]
form `shouldRenderTo` "<form method=\"GET\" action=\"/CreateProject\" id=\"\" class=\"new-form\" data-disable-javascript-submission=\"false\"><div class=\"mb-3\" id=\"form-group-project_title\"><label class=\"form-label\" for=\"project_title\">Title</label><input type=\"text\" name=\"title\" placeholder=\"\" id=\"project_title\" class=\"form-control\"> </div> <button class=\"btn btn-primary\" disabled=\"disabled\" type=\"submit\">Create Project</button></form>"

Expand Down

0 comments on commit f50f060

Please sign in to comment.