intrepidshape/elm-web3-ui/2.2.0

NOTE: the latest version is 4.0.0

Web3.Ui.ActivityRow

One row of an on-chain activity feed. The dapp pattern is universal: "Alice bought 1.2M FOO", "Bob staked 50k BAR for 90 days", "0xABC graduated". This component renders one such row with a Kind enum that drives the icon and color modifier classes.

Web3.Ui.ActivityRow.view
    { kind = Web3.Ui.ActivityRow.Buy
    , primary = "1.2M FOO"
    , secondary = Just "by 0xABC...DEF"
    , atSec = activity.timestamp
    , nowSec = model.nowSec
    , onClick = Just (OpenTx activity.txHash)
    }

CSS classes: web3-activityrow, web3-activityrow--buy/--sell/--stake/..., web3-activityrow__icon, web3-activityrow__primary, web3-activityrow__secondary, web3-activityrow__time.

{ kind : Kind
, primary : String
, secondary : Maybe String
, atSec : Int
, nowSec : Int
, onClick : Maybe msg
}
-> Html msg

Render an activity row.

type Kind
= Buy
| Sell
| Stake
| Unstake
| Penalty
| Create
| Graduate
| Claim
| Other String

One of the standard on-chain activity kinds. Add more as the lib evolves.

defaultLabel : Kind -> String

Default short label per kind, suitable as the icon's accessibility name.