Skip to content

Commit

Permalink
remove clutter in account block transactions (closes #249)
Browse files Browse the repository at this point in the history
  • Loading branch information
soad003 committed Apr 4, 2024
1 parent e205f25 commit 2c48610
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/View/Graph/Browser.elm
Original file line number Diff line number Diff line change
Expand Up @@ -1755,7 +1755,7 @@ browseBlockTable vc gc block table =
table_ vc cm (TxsUtxoTable.config vc coinCode) t

BlockTxsAccountTable t ->
table_ vc cm (TxsAccountTable.config vc coinCode) t
table_ vc cm (TxsAccountTable.blockConfig vc coinCode) t


browseTxUtxoTable : View.Config -> Graph.Config -> Loadable String Api.Data.TxUtxo -> TxUtxoTable -> Html Msg
Expand Down
55 changes: 55 additions & 0 deletions src/View/Graph/Table/TxsAccountTable.elm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,61 @@ import Util.View exposing (longIdentifier)
import View.Graph.Table as T exposing (customizations)


blockConfig : View.Config -> String -> Table.Config Api.Data.TxAccount Msg
blockConfig vc coinCode =
let
toMsg field data =
UserClickedAddressInTable
{ currency = coinCode
, address = field data
}
in
Table.customConfig
{ toId = .txHash
, toMsg = TableNewState
, columns =
[ T.htmlColumn vc
titleTx
.txHash
(\data ->
longIdentifier vc data.txHash
|> List.singleton
|> a
[ Css.View.link vc |> css
, Route.txRoute
{ currency = coinCode
, txHash = data.txHash
, table = Nothing
, tokenTxId = data.tokenTxId
}
|> Route.graphRoute
|> toUrl
|> href
]
|> List.singleton
)
]
++ [ (if vc.locale.currency /= Model.Currency.Coin then
T.valueColumn

else
T.valueColumnWithoutCode
)
vc
(\x -> asset coinCode x.currency)
"Value"
.value
]
++ [ T.stringColumn vc "Currency" (.currency >> String.toUpper)
, toMsg .fromAddress
|> T.addressColumn vc titleSendingAddress .fromAddress
, toMsg .toAddress
|> T.addressColumn vc titleReceivingAddress .toAddress
]
, customizations = customizations vc
}


config : View.Config -> String -> Table.Config Api.Data.TxAccount Msg
config vc coinCode =
let
Expand Down

0 comments on commit 2c48610

Please sign in to comment.