Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions packages/neuron-ui/src/components/NervosDAO/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useState, useEffect, useCallback, useMemo } from 'react'
import { RouteComponentProps } from 'react-router-dom'
import { useTranslation } from 'react-i18next'
import { Stack, Text, DefaultButton, Icon, TooltipHost, Spinner } from 'office-ui-fabric-react'
import PropertyList from 'widgets/PropertyList'

import appState from 'states/initStates/app'
import { AppActions, StateWithDispatch } from 'states/stateProvider/reducer'
Expand Down Expand Up @@ -282,6 +283,17 @@ const NervosDAO = ({
)
}, [epoch])

const lockAndFreeProperties = [
{
label: t('nervos-dao.free'),
value: `${shannonToCKBFormatter(`${free}`)} CKB`,
},
{
label: t('nervos-dao.locked'),
value: `${shannonToCKBFormatter(`${locked}`)} CKB`,
},
]

return (
<>
<Stack tokens={{ childrenGap: 15 }} horizontalAlign="stretch">
Expand All @@ -290,14 +302,7 @@ const NervosDAO = ({
</Text>
<Stack horizontal tokens={{ childrenGap: 15 }}>
<Stack style={{ minWidth: '250px' }} tokens={{ childrenGap: 10 }}>
<Stack horizontalAlign="space-between" horizontal>
<Text>{`${t('nervos-dao.free')}: `}</Text>
<Text>{`${shannonToCKBFormatter(`${free}`)} CKB`}</Text>
</Stack>
<Stack horizontalAlign="space-between" horizontal>
<Text>{`${t('nervos-dao.locked')}: `}</Text>
<Text>{`${shannonToCKBFormatter(`${locked}`)} CKB`}</Text>
</Stack>
<PropertyList properties={lockAndFreeProperties} />
</Stack>
<Stack horizontal verticalAlign="center" tokens={{ childrenGap: 15 }}>
<DefaultButton
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/widgets/PropertyList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const onRenderCell = (item?: Property & CellStyles) =>
</span>
<span
className={styles.value}
style={{ width: item.valueWidth || 'auto', fontSize: theme.fonts.small.fontSize }}
style={{ width: item.valueWidth || 'auto', fontSize: theme.fonts.small.fontSize, textAlign: 'right' }}
title={`${item.value}`}
aria-label={item.label}
>
Expand Down