intrepidshape/elm-web3-ui/2.2.0

NOTE: the latest version is 4.0.0

Web3.Ui.StakeCard

Generic stake-position card: amount staked, lock-days remaining, accrued yield, eligibility badge (e.g., floor-protection eligibility), plus claim and unstake action buttons. Intended for any lock-and-yield staking contract.

Web3.Ui.StakeCard.view
    { amount = position.amount
    , symbol = "TKN"
    , decimals = 18
    , startTimeSec = position.startTime
    , lockDays = position.lockDays
    , nowSec = nowSec
    , yieldAccrued = position.yieldAccrued
    , yieldSymbol = "PLS"
    , badges = [ { active = position.floorEligible, label = "floor protected" } ]
    , onClaimYield = Just (ClaimYield idx)
    , onUnstake = Just (Unstake idx)
    , unstakeLabel = "Unstake"
    }

Style: web3-stakecard, web3-stakecard__amount, web3-stakecard__lock, web3-stakecard__yield, web3-stakecard__badge, web3-stakecard__actions, web3-stakecard__action.

view : Config msg -> Html msg

Render a stake-position card.

type alias Config msg =
{ amount : BigInt
, symbol : String
, decimals : Int
, startTimeSec : Int
, lockDays : Int
, nowSec : Int
, yieldAccrued : BigInt
, yieldSymbol : String
, badges :
List
{ active : Bool
, label : String
}
, onClaimYield : Maybe msg
, onUnstake : Maybe msg
, unstakeLabel : String
}