Display event blockNumber (#5503)

This commit is contained in:
Jaco 2021-06-08 15:43:15 +03:00 committed by GitHub
parent 229a5ebae6
commit 7c8018881e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,7 +63,7 @@ function createLink (to: string, desc: string): React.ReactNode {
return <div className='itemLink'><a href={`#/${to}`}>{desc}</a></div>;
}
function DayItem ({ className, item: { date, info, type }, showAllEvents }: Props): React.ReactElement<Props> {
function DayItem ({ className, item: { blockNumber, date, info, type }, showAllEvents }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const [description, setDescription] = useState<string>('');
@ -183,6 +183,7 @@ function DayItem ({ className, item: { date, info, type }, showAllEvents }: Prop
<div className='itemDate'>{date.toLocaleString(undefined, FORMAT_OPTIONS)}</div>
}
<div className='itemTime'>{date.toLocaleTimeString().split(':').slice(0, 2).join(':')}</div>
<div className='itemBlock'>#{formatNumber(blockNumber)}</div>
{desc}
{date && (
<Button
@ -205,6 +206,10 @@ export default React.memo(styled(DayItem)`
margin-left: 0.5rem;
}
> div.itemTime+div.itemBlock {
margin-left: 0.25rem;
}
.exportCal {
padding: 0;
position: absolute;
@ -220,6 +225,15 @@ export default React.memo(styled(DayItem)`
right: 3.5rem;
}
.itemBlock {
background: #aaa;
color: #eee;
font-size: 0.85rem;
align-self: center;
padding: 0.075rem 0.375rem;
border-radius: 0.25rem;
}
.itemDate {
padding: 0 0.375rem;
border-radius: 0.25rem;
@ -228,8 +242,8 @@ export default React.memo(styled(DayItem)`
.itemTime {
background: #999;
color: #eee;
padding: 0 0.375rem;
border-radius: 0.25rem;
color: #eee;
}
`);