-
Notifications
You must be signed in to change notification settings - Fork 295
/
SidebarCategoryNetworkInfo.tsx
66 lines (62 loc) · 1.95 KB
/
SidebarCategoryNetworkInfo.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
// @flow
import React, { Component } from 'react';
import { defineMessages, intlShape } from 'react-intl';
import styles from './SidebarCategoryNetworkInfo.scss';
import type { networkType } from '../../types/networkTypes';
const messages = defineMessages({
mainnet: {
id: 'test.environment.mainnetLabel',
defaultMessage: '!!!Mainnet vx',
description: 'Label for mainnet network with version.',
},
flight: {
id: 'test.environment.daedalusFlightLabel',
defaultMessage: '!!!Cardano mainnet - Daedalus Flight',
description: 'Label for Daedalus Flight with version.',
},
testnet: {
id: 'test.environment.testnetLabel',
defaultMessage: '!!!Testnet vx',
description: 'Label for testnet with version.',
},
staging: {
id: 'test.environment.stagingLabel',
defaultMessage: '!!!Staging vx',
description: 'Label for staging network with version.',
},
shelley_qa: {
id: 'test.environment.shelleyQaLabel',
defaultMessage: '!!!Shelley QA',
description: 'Label for shelley_qa with version.',
},
alonzo_purple: {
id: 'test.environment.alonzoPurpleLabel',
defaultMessage: '!!!Alonzo Purple',
description: 'Label for alonzo_purple with version.',
},
selfnode: {
id: 'test.environment.selfnodeLabel',
defaultMessage: '!!!Selfnode vx',
description: 'Label for selfnode with version.',
},
development: {
id: 'test.environment.developmentLabel',
defaultMessage: '!!!Development vx',
description: 'Label for development with version.',
},
});
type Props = {
network: networkType,
};
export default class SidebarCategoryNetworkInfo extends Component<Props> {
static contextTypes = {
intl: intlShape.isRequired,
};
render() {
const { isFlight } = global;
const { network } = this.props;
const { intl } = this.context;
const label = messages[isFlight ? 'flight' : network];
return <div className={styles.component}>{intl.formatMessage(label)}</div>;
}
}