Skip to content

Commit

Permalink
feat(neuron-ui): use the same style of overview on nervos dao overview
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY committed Nov 13, 2019
1 parent 1784095 commit 20bbf33
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
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

0 comments on commit 20bbf33

Please sign in to comment.