intrepidshape/elm-web3-ui/2.1.2

NOTE: the latest version is 4.0.0

Web3.Ui.Sign

Signing lifecycle UI components.

Pattern-match on Sign.SignState to render sign request status without missing any state.

-- Display current sign state:
Web3.Ui.Sign.stateView [] model.signState


-- Sign button disabled while pending:
Web3.Ui.Sign.signButton []
    { label = "Sign Permit", onSign = RequestSign }
    model.signState


-- Display the signature once signed:
Web3.Ui.Sign.signatureView [] model.signState
stateView : List (Attribute msg) -> SignState -> Html msg

Displays the sign lifecycle state as a labelled span.

Labels: "Idle" / "Waiting for signature…" / "Signed" / "Failed: <err>" / "Rejected"

CSS class: web3-sign-state

List (Attribute msg)
-> { label : String
, onSign : msg
}
-> SignState
-> Html msg

A sign button that is active in SignIdle and terminal states, and disabled while SignPending.

CSS class: web3-sign-btn

signatureView : List (Attribute msg) -> SignState -> Html msg

Displays the signature value when in the Signed state.

Returns an empty text node for all other states — safe to always render.

CSS classes: web3-signature (wrapper div), web3-signature-value (code element)