forked from opencollective/opencollective-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapplications.js
46 lines (41 loc) · 1.61 KB
/
applications.js
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
import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { PREVIEW_FEATURE_KEYS } from '../lib/preview-features';
import { getDashboardRoute } from '../lib/url-helpers';
import AuthenticatedPage from '../components/AuthenticatedPage';
import { Flex } from '../components/Grid';
import MessageBox from '../components/MessageBox';
import StyledButton from '../components/StyledButton';
import StyledLink from '../components/StyledLink';
class Apps extends React.Component {
static propTypes = {
LoggedInUser: PropTypes.object,
loadingLoggedInUser: PropTypes.bool,
};
render() {
return (
<AuthenticatedPage title="Applications">
{LoggedInUser => (
<Flex flexDirection="column" alignItems="center" justifyContent="center" width={1} my={5}>
<MessageBox type="info" withIcon>
<FormattedMessage defaultMessage="Applications have been deprecated in favor of personal token" />
</MessageBox>
<StyledLink
href={
LoggedInUser.hasPreviewFeatureEnabled(PREVIEW_FEATURE_KEYS.DASHBOARD)
? getDashboardRoute(LoggedInUser.collective, 'for-developers')
: `/${LoggedInUser.collective.slug}/admin/for-developers`
}
>
<StyledButton buttonStyle="primary" buttonSize="medium" mt={3}>
<FormattedMessage defaultMessage="View personal tokens" />
</StyledButton>
</StyledLink>
</Flex>
)}
</AuthenticatedPage>
);
}
}
export default Apps;