// @flow import type { OauthAppResponse } from 'services/api/oauth'; import React, { Component } from 'react'; import classNames from 'classnames'; import { FormattedMessage as Message } from 'react-intl'; import { Helmet } from 'react-helmet'; import { LinkButton } from 'components/ui/form'; import { COLOR_GREEN, COLOR_BLUE } from 'components/ui'; import { ContactLink } from 'components/contact'; import styles from './applicationsIndex.scss'; import messages from './ApplicationsIndex.intl.json'; import cubeIcon from './icons/cube.svg'; import loadingCubeIcon from './icons/loading-cube.svg'; import toolsIcon from './icons/tools.svg'; import ApplicationsList from './list'; type Props = { clientId?: ?string, resetClientId: () => void, // notify parent to remove clientId from current location.href displayForGuest: bool, applications: Array, isLoading: bool, deleteApp: string => Promise, resetApp: (string, bool) => Promise }; export default class ApplicationsIndex extends Component { render() { return (
{(pageTitle: string) => (

{pageTitle}

)}
) }} />
) }} />
{this.getContent()}
); } getContent() { const { displayForGuest, applications, isLoading, resetApp, deleteApp, clientId, resetClientId } = this.props; if (applications.length > 0) { return ( ); } else if (displayForGuest) { return ; } return ; } } function Loader({ noApps }: { noApps: bool }) { return (
); } function Guest() { return (
); }