-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
288 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module Web.Element.SubmitButton where | ||
|
||
import Web.View.Prelude | ||
|
||
import Application.Helper.Icons | ||
import Web.Element.ElementWrap | ||
import Web.Element.Types | ||
|
||
renderSubmitButtonwithFormStatus :: SubmitButton -> FormStatus -> Html | ||
renderSubmitButtonwithFormStatus submitButton formStatus = [hsx| | ||
{submitButton} | ||
|
||
{- We show only one of these messages -} | ||
<div class="form-status"> | ||
{formStatusMessage} | ||
</div> | ||
|] | ||
|> wrapHorizontalSpacing AlignEnd | ||
where | ||
formStatusWrapper element = [hsx|<div class="form-status">{element}</div>|] | ||
maybeFormStatusMessage = | ||
case formStatus of | ||
FormStatusNotSubmitted -> Nothing | ||
|
||
FormStatusSuccess -> | ||
"Changes saved" | ||
|> wrapTextColor Green600 | ||
|> Just | ||
|
||
FormStatusError -> | ||
"Errors in the form" | ||
|> wrapTextColor Red600 | ||
|> Just | ||
|
||
formStatusMessage = maybeFormStatusMessage | ||
|> fromMaybe "" | ||
|> wrapTextItalic | ||
|> \e -> [hsx|<div class="form-status-wrapper">{e}</div>|] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.