intrepidshape/elm-web3-ui/2.2.0

NOTE: the latest version is 4.0.0

Web3.Ui.GaugeRow

One row of a vote-escrow gauge list: gauge label, current epoch, total votes on the gauge, total bribes pooled for voters, your vote share, and optional vote / bribe / claim actions. Generic for any Curve-style gauge voting design (Curve, Aerodrome, Velodrome, bribe markets generally).

The available actions depend on epoch state:

  • epoch == currentEpoch: vote and bribe both make sense; claim does not.
  • epoch < currentEpoch: epoch is closed; voters can claim, bribers can forfeit, no new votes/bribes possible.

The component does not enforce these — caller passes Nothing for actions that should be hidden in the current state.

Web3.Ui.GaugeRow.view
    { gaugeLabel = gauge.label
    , epoch = gauge.epoch
    , currentEpoch = market.currentEpoch
    , totalVotes = gauge.totalVotes
    , totalBribes = gauge.totalBribes
    , bribeSymbol = "PLS"
    , bribeDecimals = 18
    , veSymbol = "veToken"
    , veDecimals = 18
    , yourVote = gauge.yourVote
    , aprBps = Just gauge.aprBps
    , onVote = Just (Vote gauge.id)
    , onBribe = Just (Bribe gauge.id)
    , onClaim = Nothing
    }

CSS classes: web3-gaugerow, web3-gaugerow__label, web3-gaugerow__epoch, web3-gaugerow__votes, web3-gaugerow__bribes, web3-gaugerow__share, web3-gaugerow__apr, web3-gaugerow__actions, web3-gaugerow__action. Epoch gets a --closed modifier when epoch < currentEpoch.

view : Config msg -> Html msg

Render the row.

type alias Config msg =
{ gaugeLabel : String
, epoch : Int
, currentEpoch : Int
, totalVotes : BigInt
, totalBribes : BigInt
, bribeSymbol : String
, bribeDecimals : Int
, veSymbol : String
, veDecimals : Int
, yourVote : BigInt
, aprBps : Maybe Int
, onVote : Maybe msg
, onBribe : Maybe msg
, onClaim : Maybe msg
}