-
Notifications
You must be signed in to change notification settings - Fork 295
/
StakingNavigation.tsx
93 lines (87 loc) · 2.29 KB
/
StakingNavigation.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// @flow
import React, { Component } from 'react';
import { observer } from 'mobx-react';
import { defineMessages, intlShape } from 'react-intl';
import Navigation from '../../navigation/Navigation';
const messages = defineMessages({
delegation_center: {
id: 'staking.navigation.delegation_center',
defaultMessage: '!!!Delegation center',
description:
'Label for the "Delegation" nav button in the staking navigation.',
},
stake_pools: {
id: 'staking.navigation.stake_pools',
defaultMessage: '!!!Stake pools',
description: 'Label for the "Stake" nav button in the staking navigation.',
},
rewards: {
id: 'staking.navigation.rewards',
defaultMessage: '!!!Rewards',
description:
'Label for the "Rewards" nav button in the staking navigation.',
},
epochs: {
id: 'staking.navigation.epochs',
defaultMessage: '!!!Epochs',
description: 'Label for the "Epochs" nav button in the staking navigation.',
},
info: {
id: 'staking.navigation.info',
defaultMessage: '!!!Info',
description: 'Label for the "Info" nav button in the staking navigation.',
},
});
type Props = {
activeItem: string,
showInfoTab: boolean,
onNavItemClick: Function,
isActiveNavItem: Function,
};
@observer
export default class StakingNavigation extends Component<Props> {
static contextTypes = {
intl: intlShape.isRequired,
};
render() {
const {
onNavItemClick,
activeItem,
isActiveNavItem,
showInfoTab,
} = this.props;
const { intl } = this.context;
const navigationItems = [
{
id: 'delegation-center',
label: intl.formatMessage(messages.delegation_center),
},
{
id: 'stake-pools',
label: intl.formatMessage(messages.stake_pools),
},
{
id: 'rewards',
label: intl.formatMessage(messages.rewards),
},
// {
// id: 'epochs',
// label: intl.formatMessage(messages.epochs),
// },
];
if (showInfoTab) {
navigationItems.push({
id: 'info',
label: intl.formatMessage(messages.info),
});
}
return (
<Navigation
activeItem={activeItem}
isActiveNavItem={isActiveNavItem}
onNavItemClick={onNavItemClick}
items={navigationItems}
/>
);
}
}